You are here

function og_list_users_sql in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og.module \og_list_users_sql()
  2. 5 og.module \og_list_users_sql()
  3. 5.2 og.module \og_list_users_sql()
  4. 5.3 og.module \og_list_users_sql()
  5. 5.7 og.module \og_list_users_sql()
  6. 6.2 og.module \og_list_users_sql()
6 calls to og_list_users_sql()
og_broadcast_form_submit in ./og.module
og_node_delete_move_memberships in ./og.module
og_subscriber_count_link in ./og.module
Determine the number of active and pending members and the current user's membership state.
og_subscribe_user in ./og.module
Create a new membership for a given user to given group. Edits to membership should go through og_save_subscription(). No access control since this is an API function.
og_views_handler_field_og_member_count::query in modules/og_views/includes/og_views_handler_field_og_member_count.inc

... See full list

File

./og.module, line 1145

Code

function og_list_users_sql($min_is_active = 1, $min_is_admin = 0, $orderby = 'u.name ASC', $count = FALSE) {
  $order = '';
  if ($count) {
    $fields = 'COUNT(*)';
  }
  else {
    $fields = "u.uid, u.name, u.mail, u.picture, ou.*";
    if ($orderby) {
      $order = "ORDER BY {$orderby}";
    }
  }
  return "SELECT {$fields} FROM {og_uid} ou INNER JOIN {users} u ON ou.uid = u.uid WHERE ou.nid = %d AND u.status > 0 AND ou.is_active >= {$min_is_active} AND ou.is_admin >= {$min_is_admin} {$order}";
}