1 comment.theme.inc | theme_comment_block($variables) |
Returns HTML for a list of recent comments.
Related topics
File
- core/
modules/ comment/ comment.theme.inc, line 12 - Theme functions for the Comment module.
Code
function theme_comment_block($variables) {
$items = array();
foreach ($variables['comments'] as $comment) {
$items[] = l($comment->subject, 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)) . ' <span>' . t('@time ago', array('@time' => format_interval(REQUEST_TIME - $comment->changed))) . '</span>';
}
if ($items) {
return theme('item_list', array('items' => $items));
}
else {
return t('No comments available.');
}
}