You are here

function og_subgroups_get_children in Subgroups for Organic groups 5.3

Return an array of children groups of the group

4 calls to og_subgroups_get_children()
og_subgroups_edit_children_page in ./og_subgroups.module
og_subgroups_get_users in ./og_subgroups.module
Retrieve an array of all users that are members of the group If the recursive flag is true, then users of children are returned as well
og_subgroups_save_children in ./og_subgroups.module
og_subgroups_tree in ./og_subgroups.module

File

./og_subgroups.module, line 663
Maintains a hierarchy of group/subgroup relationships.

Code

function og_subgroups_get_children($gid) {
  $result = db_query('SELECT oga.nid, n.title, n.type FROM {og_ancestry} oga INNER JOIN {node} n WHERE oga.group_nid=%d AND oga.nid=n.nid', $gid);
  $children = array();
  while ($row = db_fetch_object($result)) {
    if (og_is_group_type($row->type)) {
      $children[$row->nid] = $row->title;
    }
  }
  return $children;
}