You are here

function hashtags_node_get_terms in Hashtags 6

Same name and namespace in other branches
  1. 6.2 hashtags.module \hashtags_node_get_terms()
  2. 7.2 hashtags.module \hashtags_node_get_terms()

File

./hashtags.module, line 201

Code

function hashtags_node_get_terms($nid) {
  $terms = array();
  $vid = variable_get('hashtags_vocabulary', '');
  $sql = "SELECT lower(td.name), td.tid FROM {term_data} td \n  INNER JOIN {term_node} tn ON td.tid = tn.tid \n  WHERE tn.nid = %d AND td.vid = %d";
  $result = db_query($sql, $nid, $vid);
  while ($term = db_fetch_object($result)) {
    $terms[$term->name] = $term->tid;
  }
  return $terms;
}