function themekey_taxonomy_nid2tid in ThemeKey 6
Same name and namespace in other branches
- 6.2 modules/themekey.taxonomy.inc \themekey_taxonomy_nid2tid()
- 7.3 modules/themekey.taxonomy.inc \themekey_taxonomy_nid2tid()
- 7 modules/themekey.taxonomy.inc \themekey_taxonomy_nid2tid()
- 7.2 modules/themekey.taxonomy.inc \themekey_taxonomy_nid2tid()
1 string reference to 'themekey_taxonomy_nid2tid'
File
- modules/
themekey.taxonomy.inc, line 85
Code
function themekey_taxonomy_nid2tid($nid, $object = NULL) {
if (is_array($object) && isset($object['#raw']['taxonomy'])) {
return array_keys($object['#raw']['taxonomy']);
}
$tid = array();
$result = db_query('SELECT tid FROM {term_node} WHERE nid = %d', $nid);
while ($term = db_fetch_object($result)) {
$tid[] = $term->tid;
}
return count($tid) ? $tid : FALSE;
}