function notifications_tags_node_get_terms in Notifications 5
Same name and namespace in other branches
- 6.4 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()
- 6 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()
- 6.2 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()
- 6.3 notifications_tags/notifications_tags.module \notifications_tags_node_get_terms()
- 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 234 - 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];
}