_forum_icon

Definition

_forum_icon($new_posts, $num_posts = 0, $comment_mode = 0, $sticky = 0)
modules/forum.module, line 923

Code

<?php
function _forum_icon($new_posts, $num_posts = 0, $comment_mode = 0, $sticky = 0) {

  $base_path = variable_get('forum_icon_path', '');
  if ($base_path) {
    if ($num_posts > variable_get('forum_hot_topic', 15)) {
      $icon = $new_posts ? 'hot-new' : 'hot';
    }
    else {
      $icon = $new_posts ? 'new' : 'default';
    }

    if ($comment_mode == 1) {
      $icon = 'closed';
    }

    if ($sticky == 1) {
      $icon = 'sticky';
    }

    // default
    $file = variable_get('forum_icon_path', 'misc') ."/forum-$icon.png";

    $output = theme('image', $file);
  }
  else {
    $output = '&nbsp;';
  }

  if ($new_posts) {
    $output = "<a name=\"new\">$output</a>";
  }

  return $output;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.