You are here

function notifications_tags_node_get_terms in Notifications 6

Same name and namespace in other branches
  1. 5 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()
  2. 6.4 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()
  3. 6.2 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()
  4. 6.3 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()
  5. 7 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()

Helper function to get latest node terms.

We cannot use the one from taxonomy module because it has static caching and we'll be sending notifications right after the node has been updated

1 call to notifications_tags_node_get_terms()
notifications_tags_notifications in notifications_tags/notifications_tags.module
Implementation of hook_notifications().

File

notifications_tags/notifications_tags.module, line 284
Subscriptions to taxonomy terms

Code

function notifications_tags_node_get_terms($nid) {
  static $terms;
  if (!isset($terms[$nid])) {
    $result = db_query('SELECT tid FROM {term_node} WHERE nid = %d', $nid);
    $terms[$nid] = array();
    while ($term = db_fetch_object($result)) {
      $terms[$nid][] = $term->tid;
    }
  }
  return $terms[$nid];
}