BP Multi Network & Members Directory [closed]

With bp-multi-network it appears members are shared across all networks.

Example – networks based on location.

newyork.mydomain.com, losangeles.mydomain.com, vancouver.mydomain.com

At present a member of any network is listed in any other network’s members directory if they are active in the other network.

So each Members Directory lists all members of the entire installation who have accessed that network.

So if a “New York” member becomes active on the “Los Angeles” network they are listed in the Los Angeles Members Directory and vice-versa

Now what if I also wanted a members list of just those members who joined in New York and
a members list of just those members who joined in Los Angeles and
a members list of just those members who joined in Vancouver
etc etc.

A viable solution is perhaps if I had

1) a required registration field (Your Location) drop down with the locations and then

2) a page on each network listing the members who have listed this location in the required field registration form

I understand this involves interacting with WP_Query about which I have not got the faintest clue.

If there is anyone out there who can attempt this or even point me in the right direction I’d be thrilled.

1 Answer
1

You can filter the members loop in BuddyPress by meta values for the members. So you would need to change the loop in the template file members/members-loop.php to be:

<?php
// Getting current blog_id 
global $wpdb, $current_blog;
$id = $current_blog->blog_id;
// Setting variable for current blog_prefix
$blog_prefix = $wpdb->get_blog_prefix( $id );
// Start the BuddyPress Ajax Members Loop
if ( bp_has_members( bp_ajax_querystring( 'members' ).'&meta_key='.$blog_prefix.'capabilities' ) )  : ?>

Leave a Comment