You are here

function theme_comment_block in Drupal 5

Same name and namespace in other branches
  1. 4 modules/comment.module \theme_comment_block()
  2. 6 modules/comment/comment.module \theme_comment_block()
  3. 7 modules/comment/comment.module \theme_comment_block()

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

Related topics

1 theme call to theme_comment_block()
comment_block in modules/comment/comment.module
Implementation of hook_block().

File

modules/comment/comment.module, line 277
Enables users to comment on published content.

Code

function theme_comment_block() {
  $items = array();
  foreach (comment_get_recent() as $comment) {
    $items[] = l($comment->subject, 'node/' . $comment->nid, NULL, NULL, 'comment-' . $comment->cid) . '<br />' . t('@time ago', array(
      '@time' => format_interval(time() - $comment->timestamp),
    ));
  }
  if ($items) {
    return theme('item_list', $items);
  }
}