theme_comment_block

Versions
4.7 – 7
theme_comment_block()

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

ingroup themeable

Return value

The comment list HTML.

Code

modules/comment/comment.module, line 459

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

  if ($items) {
    return theme('item_list', array('items' => $items));
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.