You are here

function og_get_node_groups_result in Organic groups 5.7

Same name and namespace in other branches
  1. 5.8 og.module \og_get_node_groups_result()
  2. 5 og.module \og_get_node_groups_result()
  3. 5.2 og.module \og_get_node_groups_result()
  4. 5.3 og.module \og_get_node_groups_result()
  5. 6.2 og.module \og_get_node_groups_result()
  6. 6 og.module \og_get_node_groups_result()
2 calls to og_get_node_groups_result()
og_get_node_groups in ./og.module
og_handler_field_nodelink in ./og_views.inc

File

./og.module, line 1273

Code

function og_get_node_groups_result($nid) {

  // We do not run db_rewrite_sql() here since we need to know about groups that the user cannot access as well (i.e. node edit).
  $sql = "SELECT oga.group_nid, n.title FROM {node} n INNER JOIN {og_ancestry} oga ON n.nid = oga.group_nid WHERE oga.nid = %d";
  return db_query($sql, $nid);
}