1 comment.module comment_block_view($delta = '', $settings = array())

Implements hook_block_view().

Generates a block with the most recent comments.

File

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

Code

function comment_block_view($delta = '', $settings = array()) {
  if (user_access('access comments') && $delta === 'recent') {
    $settings += array(
      'comment_count' => 10,
    );
    $comments = comment_get_recent($settings['comment_count']);
    $block['subject'] = t('Recent comments');
    $block['content'] = theme('comment_block', array('comments' => $comments));

    return $block;
  }
}