function og_block_subscribers_list in Organic groups 5.3
Same name and namespace in other branches
- 5.8 og.module \og_block_subscribers_list()
- 5 og.module \og_block_subscribers_list()
- 5.7 og.module \og_block_subscribers_list()
API function for retrieving a list of group members. Used by og and og_panels
Return value
string An HTML list.
2 calls to og_block_subscribers_list()
File
- ./
og.module, line 2261
Code
function og_block_subscribers_list($gid, $max = 10, $is_admin = array(
'members',
'admins',
), $show_more = TRUE, $show_picture = NULL) {
$placeholders = array_fill(0, count(array_filter($is_admin)), '%d');
$placeholders = implode(', ', $placeholders);
$sql = "SELECT DISTINCT(u.uid), u.*, ogu.created FROM {og_uid} ogu INNER JOIN {users} u ON ogu.uid = u.uid WHERE ogu.is_admin IN ({$placeholders}) AND ogu.nid = %d AND ogu.is_active = 1 AND u.status = 1 ORDER BY ogu.created DESC";
if (!empty($is_admin['members'])) {
$args[] = 0;
}
if (!empty($is_admin['admins'])) {
$args[] = 1;
}
$args[] = $gid;
$result = db_query_range($sql, $args, 0, $max);
return og_user_title_list($result, $gid, $show_more, $show_picture);
}