function taxonomy_vocabulary_load in Advanced Forum 5
1 call to taxonomy_vocabulary_load()
- template_preprocess_forums in ./d6_compat.inc
- Process variables for forums.tpl.php
File
- ./d6_compat.inc, line 275
- Code needed to backport functionality from D6.
Code
function taxonomy_vocabulary_load($vid) {
static $vocabularies = array();
if (!isset($vocabularies[$vid])) {
$vocabularies[$vid] = FALSE;
$result = db_query('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE v.vid = %d', $vid);
$node_types = array();
while ($voc = db_fetch_object($result)) {
if (!empty($voc->type)) {
$node_types[$voc->type] = $voc->type;
}
unset($voc->type);
$voc->nodes = $node_types;
$vocabularies[$vid] = $voc;
}
}
return !empty($vocabularies[$vid]) ? $vocabularies[$vid] : NULL;
}