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 470
<?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 