theme_comment_block

5 comment.module theme_comment_block()
6 comment.module theme_comment_block()
7 comment.module theme_comment_block()
8 comment.module theme_comment_block()

1 theme call to theme_comment_block()

File

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

Code

function theme_comment_block() {
  $result = db_query_range(db_rewrite_sql('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', 'c'), COMMENT_PUBLISHED, 0, 10);
  $items = array();
  while ($comment = db_fetch_object($result)) {
    $items[] = l($comment->subject, 'node/' . $comment->nid, NULL, NULL, 'comment-' . $comment->cid) . '<br />' . t('%time ago', array('%time' => format_interval(time() - $comment->timestamp)));
  }
  return theme('item_list', $items);
}
Login or register to post comments