template_preprocess_forum_icon
- Versions
- 6 – 7
template_preprocess_forum_icon(&$variables)
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
@see theme_forum_icon()
Code
modules/forum/forum.module, line 851
<?php
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';
}
}
?>Login or register to post comments 