function notifications_tags_term_tid in Notifications 6.4
Same name and namespace in other branches
- 6 notifications_tags/notifications_tags.module \notifications_tags_term_tid()
- 6.2 notifications_tags/notifications_tags.module \notifications_tags_term_tid()
- 6.3 notifications_tags/notifications_tags.module \notifications_tags_term_tid()
Fields information, translate term name to tid
1 string reference to 'notifications_tags_term_tid'
- notifications_tags_notifications in notifications_tags/
notifications_tags.module - Implementation of hook_notifications().
File
- notifications_tags/
notifications_tags.module, line 207 - Subscriptions to taxonomy terms
Code
function notifications_tags_term_tid($name, $field = NULL) {
if ($vocabs = notifications_tags_vocabularies()) {
// Add vids and name to args
$args = array_keys($vocabs);
$args[] = $name;
$tid = db_result(db_query_range(db_rewrite_sql("SELECT t.tid FROM {term_data} t WHERE t.vid IN (" . db_placeholders($vocabs) . ") AND LOWER(t.name) = LOWER('%s')", 't', 'tid'), $args, 0, 1));
if ($tid) {
return $tid;
}
elseif ($field) {
form_set_error($field, t('Term name not found.'));
}
}
}