Get group ids a given user is admin of

Public

takes user id as input parameter

</> CopyGet raw version
php
  1. function _mymodulename_get_group_ids_current_user_is_admin_of($uid) {
  2. $query = db_select('og_users_roles', 'og');
  3. $query->condition('rid', '3', '=');
  4. $query->condition('uid', $uid, '=');
  5. $query->fields('og', array('gid'));
  6. $result = $query->execute();
  7. while ($record = $result->fetchAssoc()) {
  8. $gids[] = $record;
  9. } return $gids;
  10. }