theme_comment_block

Definition

theme_comment_block()
drupal/modules/comment/comment.module, line 409

Description

Returns a formatted list of recent comments to be displayed in the comment block.

ingroup themeable

Return value

The comment list HTML.

Related topics

Namesort iconDescription
Default theme implementationsFunctions and templates that present output to the user, and can be implemented by themes.

Code

function theme_comment_block() {
  $items = array();
  $number = variable_get('comment_block_count', 10);
  foreach (comment_get_recent($number) as $comment) {
    $items[] = l($comment->subject, 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)) . '<br />' . t('@time ago', array('@time' => format_interval(REQUEST_TIME - $comment->timestamp)));
  }

  if ($items) {
    return theme('item_list', $items);
  }
}