function advanced_forum_is_forum_tagged in Advanced Forum 7.2
Same name and namespace in other branches
- 6.2 includes/style.inc \advanced_forum_is_forum_tagged()
Returns whether forum is tagged.
1 call to advanced_forum_is_forum_tagged()
- advanced_forum_node_is_styled in includes/
style.inc - Returns whether node is styled.
File
- includes/
style.inc, line 343 - Functions relating to the style system, not including core hooks and preprocess / theme functions.
Code
function advanced_forum_is_forum_tagged($node, $preview = FALSE) {
// Is this a forum node at all?
if (empty($node->taxonomy_forums)) {
return FALSE;
}
$vid = variable_get('forum_nav_vocabulary');
// Check for language used.
if (empty($node->taxonomy_forums[$node->language])) {
$langcode = LANGUAGE_NONE;
}
else {
$langcode = $node->language;
}
if ($preview) {
foreach ($node->taxonomy_forums[$langcode] as $tforum) {
if ($tforum['taxonomy_term']->vid == $vid) {
return TRUE;
}
}
}
else {
// Get a list of the terms attached to this node.
$terms = $node->taxonomy_forums[$langcode];
if (count($terms) > 0) {
return TRUE;
}
}
}