You are here

function nodeorder_orderable_tids in Node Order 5

Same name and namespace in other branches
  1. 6 nodeorder.module \nodeorder_orderable_tids()
  2. 7 nodeorder.module \nodeorder_orderable_tids()

Returns an array of the node's tids that are in orderable vocabularies...

1 call to nodeorder_orderable_tids()
nodeorder_nodeapi in ./nodeorder.module
Implementation of hook_nodeapi().

File

./nodeorder.module, line 557

Code

function nodeorder_orderable_tids($node) {
  $tids = array();
  $sql = "SELECT v.vid AS vid FROM {vocabulary_node_types} vnt JOIN {vocabulary} v ON vnt.vid = v.vid WHERE vnt.type = '%s' AND v.module = 'nodeorder'";
  $result = db_query($sql, $node->type);
  while ($row = db_fetch_object($result)) {
    $tree = taxonomy_get_tree($row->vid);
    foreach ($tree as $term) {
      $tids[] = $term->tid;
    }
  }
  return $tids;
}