You are here

function theme_forum_icon in Drupal 5

Same name and namespace in other branches
  1. 4 modules/forum.module \theme_forum_icon()

Format the icon for each individual topic.

Related topics

1 theme call to theme_forum_icon()
theme_forum_topic_list in modules/forum/forum.module
Format the topic listing.

File

modules/forum/forum.module, line 1014
Enable threaded discussions about general topics.

Code

function theme_forum_icon($new_posts, $num_posts = 0, $comment_mode = 0, $sticky = 0) {
  if ($num_posts > variable_get('forum_hot_topic', 15)) {
    $icon = $new_posts ? 'hot-new' : 'hot';
  }
  else {
    $icon = $new_posts ? 'new' : 'default';
  }
  if ($comment_mode == COMMENT_NODE_READ_ONLY || $comment_mode == COMMENT_NODE_DISABLED) {
    $icon = 'closed';
  }
  if ($sticky == 1) {
    $icon = 'sticky';
  }
  $output = theme('image', "misc/forum-{$icon}.png");
  if ($new_posts) {
    $output = "<a name=\"new\">{$output}</a>";
  }
  return $output;
}