You are here

function og_vocab_get_vocabularies in OG Vocabulary 6

API function; Get all the vocabularies associated with a group.

Parameters

$nid: The node id of the group.

3 calls to og_vocab_get_vocabularies()
og_vocab_admin_overview_vocabularies in ./og_vocab.admin.inc
List and manage vocabularies for a given group.
og_vocab_nodeapi in ./og_vocab.module
Implementation of hook_nodeapi().
og_vocab_service_get_vocabularies in ./og_vocab.services.inc
Service callback; Returns the vocabularies associated with a group.

File

./og_vocab.module, line 437
Give each group its own system controlled vocabularies.

Code

function og_vocab_get_vocabularies($nid) {
  $sql = "SELECT * FROM {og_vocab} WHERE nid = %d";
  $result = db_query($sql, $nid);
  $vocabs = array();
  while ($row = db_fetch_object($result)) {
    $vocabs[$row->vid] = taxonomy_vocabulary_load($row->vid);
  }
  return $vocabs;
}