Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'group_id'

Viewing 25 results - 51 through 75 (of 567 total)
  • Author
    Search Results
  • #311317
    N33D
    Participant

    Oh man, was breaking my head about this one for the past days. But found the solution, of course the answer was right there. I forgot to exclude admins and mods in the loop. Don’t understand why they would be excluded in the first place.

    There is the complete code, including to get xProfile fields for anyone that is interested:

    
    <?php
        $args = array(
            'group_id' => bp_get_group_id(),
            'exclude_admins_mods' => false
        );
    
        if ( bp_group_has_members( $args ) ) : ?>
            <ul id="member-list" class="item-list">
                <?php while ( bp_group_members() ) : bp_group_the_member(); ?>
                    
                    <?php $user_id = bp_get_group_member_id(); ?>
                    <li>
                        <span class="avatar">
                            <a href="<?php bp_group_member_domain(); ?>">
                                <?php bp_group_member_avatar_thumb(); ?>
                            </a>
                        </span>
                        <span class="name">
                            <a href="<?php bp_group_member_domain(); ?>">
                                <h4><?php bp_group_member_name(); ?></h4>
                            </a>
                        </span>
                        <span class="platforms">
                            <?php $user_psn_handle = bp_get_profile_field_data('field=PSN handle&user_id='.$user_id); ?>
                            <?php if($user_psn_handle): ?>
                                <i class="icon saturated standalone platform psn"></i>
                            <?php endif; ?>
    
                            <?php $user_xbox_handle = bp_get_profile_field_data('field=XBOX handle&user_id='.$user_id); ?>
                            <?php if($user_xbox_handle): ?>
                                <i class="icon saturated standalone platform xbox"></i>
                            <?php endif; ?>
                        
                        </span>
                        <span class="actions">
                            <a class="button small" href="<?php bp_group_member_domain(); ?>">
                                <?php esc_html_e('View profile', 'mvp'); ?>
                            </a>
                        </span>
    
                    </li>
    
                <?php endwhile; ?>
    
            </ul>
    
        <?php else: ?>
    
            <div id="message" class="info">
                <p><?php _e( 'No members were found.', 'buddypress' ); ?></p>
            </div>
    
        <?php endif; ?>
    
    #311316
    N33D
    Participant

    A link in this documentation gives a 404: https://codex.buddypress.org/developer/loops-reference/the-group-members-loop-bp_group_has_members/ – see Accepted Parameters – group_id required link to “bp_has_groups() loop”.

    This is my code at the moment:

    
    <?php
        $args = array(
            'group_id' => bp_get_group_id()
        );
    
        if ( bp_group_has_members( $args ) ) : ?>
    
            <ul id="member-list" class="item-list">
                <?php while ( bp_group_members() ) : bp_group_the_member(); ?>
    
                    <li>
                        <span class="avatar">
                            <a href="<?php bp_group_member_domain(); ?>">
                                <?php bp_group_member_avatar_thumb(); ?>
                            </a>
                        </span>
                        <span class="name">
                            <a href="<?php bp_group_member_domain(); ?>">
                                <h4><?php bp_group_member_name(); ?></h4>
                            </a>
                        </span>
                        <span class="actions">
                            <a class="button small" href="<?php bp_group_member_domain(); ?>">
                                <?php esc_html_e('View profile', 'mvp'); ?>
                            </a>
                        </span>
    
                    </li>
    
                <?php endwhile; ?>
    
            </ul>
    
        <?php else: ?>
    
            <div id="message" class="info">
                <p><?php _e( 'No members were found.', 'buddypress' ); ?></p>
            </div>
    
        <?php endif; ?>
    

    Any help appreciated. I’m stuck here.

    Carlen
    Participant

    I am setting up a site where we want to give a standard name to each new group that they can change later in their settings.

    That way each new group is say: “Team #1” Where each new team gets the next number.

    I tried to put in by using something like:

    value="Team #<?php echo bp_new_group_id(); ?>"

    in the group registration form, but it only returned: Team #0. The group ID hasn’t been created by that step yet…

    Any magic to make this possible?

    #310332

    In reply to: BuddyPress 5.1.2

    Mathieu Viet
    Moderator

    Hi, I advise you to check if the wp-content/uploads directory of your WordPress can be used by the http user to write/delete files and create/delete sub directories. When you upload a group avatar, check if a file named like this wp-content/uploads/group-avatars/{group_id}/{name-of-your-file}.[jpg|png|gif] exists.

    Is it possible to upload user avatars ?

    #310246
    shanebp
    Moderator

    You don’t need the meta_query in your example.

    You can use one of these classes:
    buddypress\bp-core\classes\class-bp-user-query.php
    buddypress\bp-groups\classes\class-bp-group-member-query.php

    Using the former class is more verbose but maybe easier to follow at first:

    function group_members_counter() {
    
    	$args = array(
    		'group_id' 		=> 1,  // bp_get_group_id(), or pass in a group id
    		'exclude_admins_mods' 	=> false
    	);
    
    	$group_members_result = groups_get_group_members( $args );
    	$group_members_ids = array();
    
    	foreach(  $group_members_result['members'] as $member ) {
    		$group_members_ids[] = $member->ID;
    	}
    
    	echo 'group member ids: ' . implode(", ", $group_members_ids);
    
    	if ( ! empty ( $group_members_ids ) ) {
    
    		$args = array(
    			'include' 		=> $group_members_ids,
    			'meta_key'		=> 'action_one_total',
    			'meta_value'		=> '88',  
    			'populate_extras' 	=> false
    		);
    
    		$members = new BP_User_Query( $args );
    
    		echo '<br>matching meta count: ' . $members->total_users;
    
    	} else {
    		echo 'There are no group members.';
    
    	}
    
    }
    add_action( 'bp_ready', 'group_members_counter' );
    #309694
    commium
    Participant

    God daaaaamn it work !!!!!!

    function dashboardStats($member_group_ids = NULL) {
    
    	$member_group_ids = groups_get_user_groups(get_current_user_id());
    	
    	foreach( $member_group_ids["groups"] as $id ) { 
      	$group = groups_get_group( array( 'group_id' => $id) );	
      	echo '<pre>';		
      	var_dump( $id );	
      	echo '</pre>';
    	}
    
    	$setting = groups_get_groupmeta( $id, 'entreprise_statistiques_setting' );
    	$setting2 = groups_get_groupmeta( $id, 'entreprise_statistiques_setting2' );
    	
    
    	?>
    
    	<div id="stats">
    		<script>StatHatEmbed.render({s1: '<?php echo($setting); ?>', w: 760, h: 235, tf:'month_compare', style:'fill', title:'<?php echo($setting2); ?>'});</script>
    	</div>
    
    	<?php
    			if ($setting == NULL) {
    			echo ("Aucun site internet détecté, merci de contacter l'équipe COMMIUM.");
    		}
    
    	if (isset($setting))
    	{
    		echo ("test");
    		} else {
    			echo ("notest");
    		}
    		var_dump($setting);
    		var_dump($setting2);
    	}

    I added new function, you touched me by saying “You should probably hire a developer”, so i searched 😀
    Thanks again my friend for your help ! it’s soooo peaceful to solve a problem..

    #309691
    shanebp
    Moderator

    As I said, the Group Extension only works on group pages. Stop trying to use that code on other pages.

    In your last example, you are calling groups_get_user_groups( bp_loggedin_user_id() ); AFTER you try to use it to gather group meta.
    As I said, groups_get_user_groups() will return an array.
    But you are trying to use the return value in groups_get_groupmeta which only takes a single group id.

    It seems like you are trying to copy and paste various bits of code.
    You should probably hire a developer.

    This is my guess at what you are trying to do.

    function display2() {
    
    	$member_group_ids = groups_get_user_groups(bp_loggedin_user_id());
    	
    	$setting = groups_get_groupmeta( $member_group_ids[0], 'entreprise_statistiques_setting' );
    	$setting2 = groups_get_groupmeta( $member_group_ids[0], 'entreprise_statistiques_setting2' );
    
    	?>
    	<div id="stats">
    	<script>StatHatEmbed.render({s1: '<?php echo($setting); ?>', w: 760, h: 235, tf:'month_compare', style:'fill', title:'<?php echo($setting2); ?>'});</script>
    	</div>
    
    	<?php
    	
    	if ($setting == NULL) {
    		echo ("Aucun site internet détecté, merci de contacter l'équipe COMMIUM.");
    	
    }
    #309688
    commium
    Participant

    i used this code on an other page (dashboard) to display the stats functionnality but it didn’t worked..

        function display2( $member_group_ids = NULL ) {
    		$setting = groups_get_groupmeta( $member_group_ids, 'entreprise_statistiques_setting' );
    		$setting2 = groups_get_groupmeta( $member_group_ids, 'entreprise_statistiques_setting2' );
            $member_group_ids = groups_get_user_groups(bp_loggedin_user_id());
    		?>
    		<div id="stats">
    		<script>StatHatEmbed.render({s1: '<?php echo($setting); ?>', w: 760, h: 235, tf:'month_compare', style:'fill', title:'<?php echo($setting2); ?>'});</script>
    		</div>
    
    		<?php
    		
    		if ($setting == NULL) {
    			echo ("Aucun site internet détecté, merci de contacter l'équipe COMMIUM.");
    		}
        }
    echo display2();
    #309687
    commium
    Participant

    Thanks @shanebp for informations, i tried with $member_group_ids, it’s take the good user group id but it’s didn’t take the $setting and $setting2 variable, they are empty but in group page they aren’t.. i don’t know why.

    #309684
    shanebp
    Moderator

    The BP_Group_Extension is for use within a specific group. And the group_id is ‘known’ within that context.

    To show data specific to a member’s groups, anywhere on the site, use: groups_get_user_groups to get all the group ids for that member.
    For example: $member_group_ids = groups_get_user_groups( bp_loggedin_user_id() );
    So $member_group_ids will be an array of group ids that you can use in a custom function to gather and display group data specific to the current user.

    For more info on that function and other useful group functions, see:
    buddypress\bp-groups\bp-groups-functions.php

    #309683
    commium
    Participant

    Hi,

    I have here a code to show in group section -> stats page the stats of the group website with an Stats embedded tool.

    But i have a problem, the php work perfectly in group page and i would like to show it on the all users groups on their dashboard like in a widget, i tried with only using the “function display()) but $setting and $setting2 have no value, i don’t know why.

    Someone can maybe help me ?

    Thanks.

    function stats() {
    	
    if ( bp_is_active( 'groups' ) ) :
     
    class Entreprise_Statistiques extends BP_Group_Extension {
        /**
         * Your __construct() method will contain configuration options for 
         * your extension, and will pass them to parent::init()
         */
        function __construct() {
            $args = array(
                'slug' => 'entreprise_statistiques',
                'name' => 'Statistiques',
            );
            parent::init( $args );
        }
     
        /**
         * display() contains the markup that will be displayed on the main 
         * plugin tab
         */
    
    	
    	
        function display( $group_id = NULL ) {
    		$setting = groups_get_groupmeta( $group_id, 'entreprise_statistiques_setting' );
    		$setting2 = groups_get_groupmeta( $group_id, 'entreprise_statistiques_setting2' );
            $group_id = bp_get_group_id();
    		?>
    			
    		<script>
    		StatHatEmbed=new function(){function d(){var a=document.getElementsByTagName("script");return a[a.length-1]}function e(a,b){var d=document.createElement("script"),c="//www.stathat.com/embed/"+a+"/"+b.s1;b.dev&&(c="//localhost:8081/embed/"+a+"/"+b.s1);b.s2&&(c+="/"+b.s2);b.s3&&(c+="/"+b.s3);c+="?w="+b.w+"&h="+b.h+"&tf="+b.tf;b.style&&(c+="&style="+b.style);b.dev&&(c+="&dev=1");b.title&&(c+="&title="+b.title);d.src=c;d.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(d)}function f(a){return[a.s1,
    		a.s2,a.s3,a.w,a.h,a.tf,a.style].join("_")}this.render_graph=function(a){DIV_ID="statd_embed_graph_"+f(a);d().insertAdjacentHTML("AfterEnd","<div id='"+DIV_ID+"' style='display:none'></div>");e("graph",a)};this.render_histogram=function(a){DIV_ID="statd_embed_histogram_"+f(a);d().insertAdjacentHTML("AfterEnd","<div id='"+DIV_ID+"' style='display:none'></div>");e("histogram",a)};this.render_data=function(a){DIV_ID="statd_embed_data_"+f(a);d().insertAdjacentHTML("AfterEnd","<div id='"+DIV_ID+"' style='display:none'></div>");
    		e("data",a)};this.render_table=function(a){DIV_ID="statd_embed_table_"+f(a);d().insertAdjacentHTML("AfterEnd","<div id='"+DIV_ID+"' style='display:none'></div>");e("table",a)};this.render_text=function(a){DIV_ID=["statd_embed_text",a.s1,a.u].join("_");d().insertAdjacentHTML("AfterEnd","<div id='"+DIV_ID+"' style='display:none'></div>");e("text",a)};this.render=function(a){a.tf||(a.tf="week_compare");a.kind||(a.kind="graph");switch(a.kind){case "graph":this.render_graph(a);break;case "histogram":this.render_histogram(a);
    		break;default:this.render_graph(a)}}};
    
    		</script>
    		<div id="stats">
    		<script>StatHatEmbed.render({s1: '<?php echo($setting); ?>', w: 760, h: 235, tf:'month_compare', style:'fill', title:'<?php echo($setting2); ?>'});</script>
    		</div>
    
    		<?php
    		
    		if ($setting == NULL) {
    			echo ("Aucun site internet détecté, merci de contacter l'équipe COMMIUM.");
    		}
        }
     
        /**
         * Création
         */
        function settings_screen( $group_id = NULL ) {
            $setting = groups_get_groupmeta( $group_id, 'entreprise_statistiques_setting' );
    		$setting2 = groups_get_groupmeta( $group_id, 'entreprise_statistiques_setting2' );
     
            ?>
    				<input type="text" name="entreprise_statistiques_setting2" id="entreprise_statistiques_setting2" placeholder="Nom d'entreprise"><?php echo esc_attr( $setting2 ) ?></input>
    				<input type="text" name="entreprise_statistiques_setting" id="entreprise_statistiques_setting"placeholder="Code suivi"><?php echo esc_attr( $setting ) ?></input>
            <?php
    			$settingInfo = $_POST['entreprise_statistiques_setting'];
    			$settingInfo2 = $_POST['entreprise_statistiques_setting2'];
        }
    	function settings_screen_save( $group_id = NULL ) {
    		$setting = '';
    		$setting2 = '';
    
    		if ( isset( $_POST['entreprise_statistiques_setting']) && isset($_POST['entreprise_statistiques_setting2'] ) ) {
    			$setting = $_POST['entreprise_statistiques_setting'];
    			$setting2 = $_POST['entreprise_statistiques_setting2'];
    		}
    
    		groups_update_groupmeta( $group_id, 'entreprise_statistiques_setting', $setting );
    		groups_update_groupmeta( $group_id, 'entreprise_statistiques_setting2', $setting2 );
    		}
    	}
    bp_register_group_extension( 'Entreprise_Statistiques' );
     
    endif; // if ( bp_is_active( 'groups' ) )
    }
    echo stats();
    #309194
    denisprogrammer
    Participant

    I’ve tried all of these hooks an some of them are firing but none of them are providing activity_id (INT). ROW id.

    //Should fire after activity post saved/updated
    // do_action( ‘bp_activity_posted_update’, $content, $user_id, $activity_id );`
    // do_action( ‘bp_groups_posted_update’, $content, $user_id, $group_id, $activity_id );
    // do_action( ‘bp_activity_add’, $r, $activity->id );
    // do_action( ‘bp_activity_posted_update’, $r[‘content’], $r[‘user_id’], $activity_id );
    // do_action( ‘bp_activity_post_type_published’, $activity_id, $post, $activity_args );
    // do_action( ‘bp_activity_post_type_updated’, $post, $activity, $activity_post_object );

    #308891
    Mathieu Viet
    Moderator

    Hi,

    Well, as a start, you can try to paste the first example of code of this section: https://codex.buddypress.org/developer/group-extension-api/#examples into a bp-custom.php file and replace the display method of the Group Extension with:

    
    public function display( $group_id = NULL ) {
       $group_id = bp_get_group_id();
       
       $page = get_post( 27 );
       echo apply_filters( 'the_content', $page->post_content );
    }
    
    #308537
    David Cavins
    Keymaster

    Well, you’ll have to be sure that the “Profile Field URL” field has the id of 6 on your installation. On your site, visit the Profile Fields admin at Wp Admin > Users > Profile Fields (/wp-admin/users.php?page=bp-profile-setup) and hover over the “Edit” button for the field you want to affect. The link will look something like /wp-admin/users.php?page=bp-profile-setup&mode=edit_field&group_id=1&field_id=7 showing you the field_id you want to use.

    zaheer01
    Participant

    I wan to display my custom created action activities in activity tab of groups but it is displaying in activity tab which is global. I had tried alot of solution on internet but no one is working.

    add_action(‘wp_insert_post’, array($this, ‘bd_custom_bp_record_activity’));
    function bd_custom_bp_record_activity() {

    $gid = bp_get_group_id();
    groups_record_activity(array(
    ‘action’ => apply_filters(‘groups_activity_new_update_action’, sprintf(__(‘%1$s created an event %2$s’, ‘buddypress’), bp_core_get_userlink(get_current_user_id()), ‘‘ . esc_attr(bp_get_group_name()) . ‘‘)),
    ‘content’ => ‘new post’,
    ‘type’ => ‘created_event’,
    ‘item_id’ => $gid,
    ‘user_id’ => get_current_user_id(),
    )
    );
    }

    yusufhm
    Participant

    Looks like we both followed the same article: https://codex.buddypress.org/plugindev/how-to-edit-group-meta-tutorial/

    I was able to resolve the issue you were having by modifying the custom_field function a bit, so it becomes like this:

    
    function custom_field($meta_key='') {
            $value = groups_get_groupmeta( bp_get_group_id(), $meta_key);
            if ($value) {
                return $value;
            }
    
            $bp   = buddypress();
            if ($bp->groups->current_group) {
                $group_id = $bp->groups->current_group->id;
                return groups_get_groupmeta($group_id, $meta_key, TRUE);
            }
            return FALSE;
    }
    

    It looks like the meta value’s already saved after the first step, and your group already has an ID; so it’s just a question of retrieving that. bp_get_group_id() somehow does not do the job for I don’t know what reason (maybe the group is not yet visible, or the cache has not been updated yet).

    colingdi
    Participant

    So I found (though I can now track it down) a page with how to add custom fields to a group and it worked (yipee) however during testing we’ve realised that when you add the fields and select ‘Create Group and Continue’ and on the next page select ‘Previous’ your fields are blank. But when you just proceed straight through and don’t ever go back they store. I’m pasting the groups code below if someone knows a hook I can use or similar I’d greatly appreciate it.

    function bp_group_meta_init() {
            function custom_field($meta_key='') {
                //get current group id and load meta_key value if passed. If not pass it blank
                return groups_get_groupmeta( bp_get_group_id(), $meta_key) ;
            }
            //code if using seperate files require( dirname( __FILE__ ) . '/buddypress-group-meta.php' );
            // This function is our custom field's form that is called in create a group and when editing group details
            function group_header_fields_markup() {
                global $bp, $wpdb;?>
    <label for="group-guidelines">Group Guidelines</label>
    <textarea name="group-guidelines" id="group-guidelines" aria-required="true"></textarea>
    <br>
    <label for="group-aims">Group Aims</label>
    <textarea name="group-aims" id="group-aims" aria-required="true"></textarea>
    <?php }
        // This saves the custom group meta – props to Boone for the function
        // Where $plain_fields = array.. you may add additional fields, eg
        //  $plain_fields = array(
        //      'field-one',
        //      'field-two'
        //  );
        function group_header_fields_save( $group_id ) {
            global $bp, $wpdb;
            $plain_fields = array(
                                  'group-guidelines',
                                  'group-aims'
                                  );
            foreach( $plain_fields as $field ) {
                $key = $field;
                if ( isset( $_POST[$key] ) ) {
                    $value = $_POST[$key];
                    groups_update_groupmeta( $group_id, $field, $value );
                }
            }
        }
        add_filter( 'groups_custom_group_fields_editable', 'group_header_fields_markup' );
        add_action( 'groups_group_details_edited', 'group_header_fields_save' );
        add_action( 'groups_created_group',  'group_header_fields_save' );
    #305234
    Venutius
    Moderator

    One option would be to add a php widget and use a plugin to only display it in the groups pages then add some code which uses the bp_get_current_group_id() function to return the group id, which you could check in a conditional such as:

    if ( bp_get_current_group_id() == 1 ) {
    echo ‘your link‘;
    }

    #304437
    joshreid
    Participant

    i tried changing the code still nothing please see if maybe I am doing somthing wrong.

    <?php if ( bp_nouveau_member_has_meta() ) : ?>
    <p class=”item-meta last-activity”>

    <?php if ( bp_has_profile(‘profile_group_id=2’) ) : ?>
    <?php bp_nouveau_member_meta(); ?>
    </p><!– #item-meta –>

    <?php endif; ?>`

    <?php if ( bp_has_profile(‘profile_group_id=2’) ) : ?>`
    is the new code i was trying but is seams every time i put any php code in there it frezzes that part of the page. Maybe an array or I dont know. thanks

    #304153
    Venutius
    Moderator

    I’m a bit uncertain as to the use case here: joining a group does not change the members role on the site, they started off as subscriber and they remained subscriber after joining. however you could acheive what you want by using the groups_send_invites action.

    So something like:

    add_action( 'groups_send_invites', 'venutius_invited_users_role', 10, 3);
    
    function venutius_invited_users_role( $group_id, $invited_users, $user_id ) {
        foreach ( $invited_users as $invited_user ) {
            $user = get_userdata( $invited_user );
            $user->add_role( 'invited_members' );
        }
    }
    Venutius
    Moderator

    I’ve come up with a workaround, if we can’t stop them joining, after they’ve joined we can undo it:

    add_action( 'groups_join_group', 'venutius_group_join_filter', 10, 2 );
    
    function venutius_group_join_filter( $group_id, $user_id ) {
    	global $bp;
    	
    	if ( current_user_can( 'manage_options' ) ) {
    		return;
    	}
    	
    	$membership_total = count( BP_Groups_Member::get_membership_ids_for_user( $user_id ) );
    	
    	if ( $membership_total >= 2 ) {
    		groups_leave_group( $group_id, $user_id )
    	}
    	
    }
    #303654
    pratibhasvaksha
    Participant

    @venutius
    This is the code which I’m using to add two fields in group creation form.

    function custom_field($meta_key='') {
      //get current group id and load meta_key value if passed. If not pass it blank
      return groups_get_groupmeta( bp_get_group_id(), $meta_key) ;
    }
    
    function group_header_fields_save( $group_id ) {
      global $bp, $wpdb;
      $plain_fields = array(
        'group-month',
        'group-year'
      );
      foreach( $plain_fields as $field ) {
        $key = $field;
        if ( isset( $_POST[$key] ) ) {
          $value = $_POST[$key];
          groups_update_groupmeta( $group_id, $field, $value );
        }
      }
    }
    add_action( 'groups_group_details_edited', 'group_header_fields_save' );
    add_action( 'groups_created_group',  'group_header_fields_save' );
    
    // Show the custom field in the group header
    function show_field_in_header( ) {
      echo "<p> Month: " . custom_field('group-month') . "</p>";
      echo "<p> Year: " . custom_field('group-year') . "</p>";
    }
    add_action('bp_group_header_meta' , 'show_field_in_header') ;

    I’ve manually added the code to display the fields in create.php file. In frontend, the field is visible on group listing (groups-loop.php) and on single group page.

    Now, I want to add a meta box to the group edit to update the field information directly from the admin panel.

    I’ll be grateful If you can help me out! Looking forward to your reply.

    Thanks!

    #303549
    airsid
    Participant

    Hello,
    Please find attached my plugins/buddypress/bp-themes/bp-default/registration/register.php content

    <?php get_header( 'buddypress' ); ?>
    
    	<div id="content">
    		<div class="padder">
    
    		<?php do_action( 'bp_before_register_page' ); ?>
    
    		<div class="page" id="register-page">
    
    			<form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
    
    			<?php if ( 'registration-disabled' == bp_get_current_signup_step() ) : ?>
    				<?php do_action( 'template_notices' ); ?>
    				<?php do_action( 'bp_before_registration_disabled' ); ?>
    
    					<p><?php _e( 'User registration is currently not allowed.', 'buddypress' ); ?></p>
    
    				<?php do_action( 'bp_after_registration_disabled' ); ?>
    			<?php endif; // registration-disabled signup setp ?>
    
    			<?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
    
    				<h2><?php _e( 'Create an Account', 'buddypress' ); ?></h2>
    
    				<?php do_action( 'template_notices' ); ?>
    
    				<p><?php _e( 'Registering for this site is easy, just fill in the fields below and we\'ll get a new account set up for you in no time.', 'buddypress' ); ?></p>
    
    				<?php do_action( 'bp_before_account_details_fields' ); ?>
    
    				<div class="register-section" id="basic-details-section">
    
    					<?php /***** Basic Account Details ******/ ?>
    
    					<h4><?php _e( 'Account Details', 'buddypress' ); ?></h4>
    
    					<label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    					<?php do_action( 'bp_signup_username_errors' ); ?>
    					<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" />
    
    					<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    					<?php do_action( 'bp_signup_email_errors' ); ?>
    					<input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" />
    
    					<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    					<?php do_action( 'bp_signup_password_errors' ); ?>
    					<input type="password" name="signup_password" id="signup_password" value="" />
    
    					<label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    					<?php do_action( 'bp_signup_password_confirm_errors' ); ?>
    					<input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" />
    
    					<?php do_action( 'bp_account_details_fields' ); ?>
    
    				</div><!-- #basic-details-section -->
    
    				<?php do_action( 'bp_after_account_details_fields' ); ?>
    
    				<?php /***** Extra Profile Details ******/ ?>
    
    				<?php if ( bp_is_active( 'xprofile' ) ) : ?>
    
    					<?php do_action( 'bp_before_signup_profile_fields' ); ?>
    
    					<div class="register-section" id="profile-details-section">
    
    						<h4><?php _e( 'Profile Details', 'buddypress' ); ?></h4>
    
    						<?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
    						<?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( array( 'profile_group_id' => 1, 'fetch_field_data' => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    
    						<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    
    							<div class="editfield">
    
    								<?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
    
    									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
    									<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    									<input type="text" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" value="<?php bp_the_profile_field_edit_value(); ?>" />
    
    								<?php endif; ?>
    
    								<?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
    
    									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
    									<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    									<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_edit_value(); ?></textarea>
    
    								<?php endif; ?>
    
    								<?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>
    
    									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
    									<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    									<select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>">
    										<?php bp_the_profile_field_options(); ?>
    									</select>
    
    								<?php endif; ?>
    
    								<?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
    
    									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
    									<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    									<select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" multiple="multiple">
    										<?php bp_the_profile_field_options(); ?>
    									</select>
    
    								<?php endif; ?>
    
    								<?php if ( 'radio' == bp_get_the_profile_field_type() ) : ?>
    
    									<div class="radio">
    										<span class="label"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></span>
    
    										<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    										<?php bp_the_profile_field_options(); ?>
    
    										<?php if ( !bp_get_the_profile_field_is_required() ) : ?>
    											<a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name(); ?>' );"><?php _e( 'Clear', 'buddypress' ); ?></a>
    										<?php endif; ?>
    									</div>
    
    								<?php endif; ?>
    
    								<?php if ( 'checkbox' == bp_get_the_profile_field_type() ) : ?>
    
    									<div class="checkbox">
    										<span class="label"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></span>
    
    										<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    										<?php bp_the_profile_field_options(); ?>
    									</div>
    
    								<?php endif; ?>
    
    								<?php if ( 'datebox' == bp_get_the_profile_field_type() ) : ?>
    
    									<div class="datebox">
    										<label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
    										<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    
    										<select name="<?php bp_the_profile_field_input_name(); ?>_day" id="<?php bp_the_profile_field_input_name(); ?>_day">
    											<?php bp_the_profile_field_options( 'type=day' ); ?>
    										</select>
    
    										<select name="<?php bp_the_profile_field_input_name(); ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month">
    											<?php bp_the_profile_field_options( 'type=month' ); ?>
    										</select>
    
    										<select name="<?php bp_the_profile_field_input_name(); ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year">
    											<?php bp_the_profile_field_options( 'type=year' ); ?>
    										</select>
    									</div>
    
    								<?php endif; ?>
    
    								<?php if ( 'url' == bp_get_the_profile_field_type() ) : ?>
    
    									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
    									<input type="text" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" value="<?php bp_the_profile_field_edit_value(); ?>" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>/>
    
    								<?php endif; ?>
    
    								<?php do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?>
    
    								<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
    									<p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
    										<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></a>
    									</p>
    
    									<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
    										<fieldset>
    											<legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
    
    											<?php bp_profile_visibility_radio_buttons() ?>
    
    										</fieldset>
    										<a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
    
    									</div>
    								<?php else : ?>
    									<p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
    										<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
    									</p>
    								<?php endif ?>
    
    								<?php do_action( 'bp_custom_profile_edit_fields' ); ?>
    
    								<p class="description"><?php bp_the_profile_field_description(); ?></p>
    
    							</div>
    
    						<?php endwhile; ?>
    
    						<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" />
    
    						<?php endwhile; endif; endif; ?>
    
    						<?php do_action( 'bp_signup_profile_fields' ); ?>
    
    					</div><!-- #profile-details-section -->
    
    					<?php do_action( 'bp_after_signup_profile_fields' ); ?>
    
    				<?php endif; ?>
    
    				<?php if ( bp_get_blog_signup_allowed() ) : ?>
    
    					<?php do_action( 'bp_before_blog_details_fields' ); ?>
    
    					<?php /***** Blog Creation Details ******/ ?>
    
    					<div class="register-section" id="blog-details-section">
    
    						<h4><?php _e( 'Blog Details', 'buddypress' ); ?></h4>
    
    						<p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new site', 'buddypress' ); ?></p>
    
    						<div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
    
    							<label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    							<?php do_action( 'bp_signup_blog_url_errors' ); ?>
    
    							<?php if ( is_subdomain_install() ) : ?>
    								http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_blogs_subdomain_base(); ?>
    							<?php else : ?>
    								<?php echo home_url( '/' ); ?> <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" />
    							<?php endif; ?>
    
    							<label for="signup_blog_title"><?php _e( 'Site Title', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    							<?php do_action( 'bp_signup_blog_title_errors' ); ?>
    							<input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value(); ?>" />
    
    							<span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>:</span>
    							<?php do_action( 'bp_signup_blog_privacy_errors' ); ?>
    
    							<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes', 'buddypress' ); ?></label>
    							<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No', 'buddypress' ); ?></label>
    
    							<?php do_action( 'bp_blog_details_fields' ); ?>
    
    						</div>
    
    					</div><!-- #blog-details-section -->
    
    					<?php do_action( 'bp_after_blog_details_fields' ); ?>
    
    				<?php endif; ?>
    
    				<?php do_action( 'bp_before_registration_submit_buttons' ); ?>
    
    				<div class="submit">
    					<input type="submit" name="signup_submit" id="signup_submit" value="<?php esc_attr_e( 'Complete Sign Up', 'buddypress' ); ?>" />
    				</div>
    
    				<?php do_action( 'bp_after_registration_submit_buttons' ); ?>
    
    				<?php wp_nonce_field( 'bp_new_signup' ); ?>
    
    			<?php endif; // request-details signup step ?>
    
    			<?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>
    
    				<h2><?php _e( 'Check Your Email To Activate Your Account!', 'buddypress' ); ?></h2>
    
    				<?php do_action( 'template_notices' ); ?>
    				<?php do_action( 'bp_before_registration_confirmed' ); ?>
    
    				<?php if ( bp_registration_needs_activation() ) : ?>
    					<p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ); ?></p>
    				<?php else : ?>
    					<p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ); ?></p>
    				<?php endif; ?>
    
    				<?php do_action( 'bp_after_registration_confirmed' ); ?>
    
    			<?php endif; // completed-confirmation signup step ?>
    
    			<?php do_action( 'bp_custom_signup_steps' ); ?>
    
    			</form>
    
    		</div>
    
    		<?php do_action( 'bp_after_register_page' ); ?>
    
    		</div><!-- .padder -->
    	</div><!-- #content -->
    
    	<?php get_sidebar( 'buddypress' ); ?>
    
    	<script type="text/javascript">
    		jQuery(document).ready( function() {
    			if ( jQuery('div#blog-details').length && !jQuery('div#blog-details').hasClass('show') )
    				jQuery('div#blog-details').toggle();
    
    			jQuery( 'input#signup_with_blog' ).click( function() {
    				jQuery('div#blog-details').fadeOut().toggle();
    			});
    		});
    	</script>
    
    <?php get_footer( 'buddypress' ); ?>
    Venutius
    Moderator

    This code will display the email addresses in the group members list:

    <?php
    $group_id = bp_get_current_group_id();
    $user_id = get_current_user_id();
    if ( groups_is_user_admin( $user_id, $group_id ) || groups_is_user_mod( $user_id, $group_id ) || current_user_can( 'manage_options' ) ) :
        $user_data = get_userdata( bp_get_group_member_id() ); ?>
        <div class="user_email">
    	<label><?php echo $user_data->user_email; ?></label>
        </div>
        <?php
    endif;

    You’d need to overload the members.php for your BP theme and place this code in there.

    To automatically remove their membership you could write a script to hook on the member role change and automatically remove them from the group but that’s a more complex job, you’d probably need to pay someone to write it specifically for your site.

    #302810

    In reply to: Get group fields

    Artyom
    Participant

    I use this code echo bp_get_group_permalink(groups_get_group( get_post_meta(get_the_ID(), '_bcg_group_id') )) ; and I have only “localhost/blog/groups/”

Viewing 25 results - 51 through 75 (of 567 total)
Skip to toolbar