You are here

function boost_taxonomy_node_get_tids in Boost 6

Return taxonomy terms given a nid.

Needed because of a weird bug with CCK & node_load() http://drupal.org/node/545922

3 calls to boost_taxonomy_node_get_tids()
boost_expire_node in ./boost.module
Expires a node from the cache; including related pages.
boost_node_get_basics in ./boost.module
Get some basic node attribues from the database given node id.
_boost_views_runit in ./boost.module

File

./boost.module, line 2000
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_taxonomy_node_get_tids($nid) {
  $vid = db_result(db_query('SELECT vid FROM {node} WHERE nid = %d', $nid));
  $result = db_query(db_rewrite_sql('SELECT t.tid FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.vid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), $vid);
  $tids = array();
  while ($term = db_result($result)) {
    $tids[$term] = $term;
  }
  return $tids;
}