template_preprocess_forum_icon
modules/forum/forum.module, строка 851
- Версии
- 6
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
forum-icon.tpl.php
@see theme_forum_icon()
Код
<?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';
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии