Multisite buddypress member directory per site?

I'll try to be as specific as possible so here it goes.

Using wordpress multisite (not multi-network).
wordpress v. 3.7.1
buddypress v. 1.8.1
using many other mpmudev plugins. :slight_smile:
needed buddypress files have been copied to my current theme.
using specifically "members-loop.php" from buddypress.
using Membership with multiple member levels.

Example problem of what I want to do:

I have 100 websites. Each is a "chapter" of a national organization. Each chapter has their own website with member directory and member levels. (wrinkle: a member can be apart of multiple chapters. I'll explain later) I am using buddypress for chapter profiles, etc.
I want to only display, on the Member's Directory page, the members of the current website.
Ex: if multisite (if current site)){ ..... }
(wrinkle: members can be apart of multiple chapters, so they should be displayed in the directory of all the chapters they are members of.)

So trying to nail down to one sentence:
With my national member database; display only the members associated with the Member's Directory on the website the member is apart of for their current level.

This is what I've done so far that works to an extent:

<?php while ( bp_members() ) : bp_the_member(); ?>
$chapterxprofile = bp_get_member_profile_data('field=Chapter');
$sitetitle = get_bloginfo('name');
if($chapterxprofile == $sitetitle) :
?>
....
....
<?php endif; endwhile: ?>

I've created a buddypress xprofile field with all the Chapter website, site-titles, and assigning the members the chapter they should be associated with. (multi-selection a big plus using the buddypress xprofile field option.)

What I would like to do is display these members on a "per site basis" depending on their membership level.

ie:
member 1 - level1,
member 2 - level2,level3,
member 3 - level3,
member 4 - level2,level1
....
(member levels are the same for all chapter websites)

Using this data:

Ex:
site1.com/level1-directory
site1.com/level2-directory
site1.com/level3-directory
site2.com/level1-directory
site2.com/level2-directory
site2.com/level3-directory
site3.com/level1-directory
site3.com/level2-directory
site3.com/level3-directory

So, per site, the directory on each site displays only the current member for the current site who has the current level.

Hope this makes sense at all. Sorry if I have redundancy going. Im trying to wrap my head around everything I need to do also. Please ask any questions. Thanks

  • Jack Kitterhing
    • Code Norris

    Hi there @Jarel

    Hope your well today and thanks for your question.

    Quite a setup you have there! :slight_smile:

    So if I'm understanding this correctly, are you not using any form of Membership plugin? Rather the chapter is a profile field multi-select, they can be part of the multiple chapters and you want to show the chapters their a member of in the members directory, correct?

    Thanks!

    Kind Regards
    Jack.

  • Jarel
    • Site Builder, Child of Zeus

    Yes. The Chapter(s) the member is apart of would not be editable by the user himself. It would only be editable by the admin of the individual site. But the member could be apart of multiple chapters. Ideally, admins of all chapters could at least "see" the profile of all members in the admin area, and assign a member to their specific chapter if desired. Kind of like in grade school where the team captains could pick who they wanted on their team.

    Yeah complex indeed.

  • Jack Kitterhing
    • Code Norris

    Hi there @Jarel

    Hope your well today and thanks for the link :slight_smile:

    Right, what we need first is to enable BuddyPress in a multiblog way, using the define shown here http://codex.buddypress.org/getting-started/customizing/bp_enable_multiblog/

    We should then be able to use the get_bloginfo function like here http://codex.wordpress.org/Function_Reference/get_bloginfo to show the blog name that the user is assigned to if that makes sense?

    Thanks!

    kind Regards
    Jack.

  • Jarel
    • Site Builder, Child of Zeus

    Thanks. I already have multiblog set up in my wp-config and am using the get_bloginfo function you mentioned.

    <?php while ( bp_members() ) : bp_the_member(); ?>
    
        	<?php
    		$chapterxprofile = bp_get_member_profile_data('field=Chapter');
    		$sitetitle = get_bloginfo('name');
    
    		if($chapterxprofile == $sitetitle) :
    		?>

    So I've already created an xprofile field select list, which will contain all the Site Titles for the chapters. This way I can display only members of the current chapter website.

    The part Im struggling with right now is being able to show the member's list on a per membership level (based on the Level from the Membership plugin). Either tapping into the buddypress filter select list like so:

    Alphabetical
    Newly Registered
    Last Active
    Level 1
    Level 2
    Level 3

    Or another option of of having tabs across the top of the member directory like so:

    All Members / Level 1 / Level 3 / Level 3 (ideally if this was a nice ajax-ified filter that would be great. But no necessary. I could just create additional member-loop pages with this additional conditional.

    Another great feature would be to choose which levels, in the membership plugin, I want to assign to the members directory, to be these filters.

  • Jack Kitterhing
    • Code Norris

    Hi there @Jarel

    Hope your well today and sorry about the extreme delay here, I had missed your previous response.

    I can see exactly what you want to do here, unfortunately it isn't quite possible with membership out of the box right now, I've added this as a feature request :slight_smile:

    Maybe it would be possible to use some of the template tags for checking if a user is on ex subscription, for example.

    <?php
    if(current_user_on_level(1)) {

    Where 1 is the access level ID, would that be of any use at all?

    Thanks!

    Kind Regards
    Jack.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.