Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Open members list in group page


Burt Adsit
Participant

@burtadsit

If I were gonna do what you want to do I’d do something like this:

// group_id, limit, page, exclude_admins_mods, exclude_banned
$group = BP_Groups_Member::get_all_for_group( $group_id, false, false, false, false ) {
if ( $group['members'] ) {
foreach ( (array) $group['members']['user_id'] as $member ) {
$user= new BP_Core_User($member);
// do some formatting and display of this user obj
// see: bp-core-classes.php, 'class BP_Core_User' for what's available

// $user->avatar_thumb is html link to avatar
// $user->user_link is html link to user full name
}
}

I’m kinda hazy about the returned array from get_all_for_group(). It looks like it returns an array structured like this:

array( ‘members’ => $members, ‘count’ => $total_member_count )

Which means we need the $groups and it is actually composed of:

array( ‘user_id’, ‘date_modified’)

Which means we need:

$group['members']['user_id'] (syntax?)

As the foreach loop array.

(sigh) Gotta be a better way but I don’t see any. I have no place to test this easily at the moment.

Skip to toolbar