function template_preprocess_forum_icon in Drupal 6
Same name and namespace in other branches
- 8 core/modules/forum/forum.module \template_preprocess_forum_icon()
- 7 modules/forum/forum.module \template_preprocess_forum_icon()
- 9 core/modules/forum/forum.module \template_preprocess_forum_icon()
Process variables to format the icon for each individual topic.
$variables contains the following data:
- $new_posts
- $num_posts = 0
- $comment_mode = 0
- $sticky = 0
See also
theme_forum_icon()
File
- modules/
forum/ forum.module, line 871 - Enable threaded discussions about general topics.
Code
function template_preprocess_forum_icon(&$variables) {
$variables['hot_threshold'] = variable_get('forum_hot_topic', 15);
if ($variables['num_posts'] > $variables['hot_threshold']) {
$variables['icon'] = $variables['new_posts'] ? 'hot-new' : 'hot';
}
else {
$variables['icon'] = $variables['new_posts'] ? 'new' : 'default';
}
if ($variables['comment_mode'] == COMMENT_NODE_READ_ONLY || $variables['comment_mode'] == COMMENT_NODE_DISABLED) {
$variables['icon'] = 'closed';
}
if ($variables['sticky'] == 1) {
$variables['icon'] = 'sticky';
}
}