comment_node_search_result

Versions
7
comment_node_search_result($node)

Implement hook_node_search_result().

Code

modules/comment/comment.module, line 1176

<?php
function comment_node_search_result($node) {
  if ($node->comment != COMMENT_NODE_HIDDEN) {
    $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
    return format_plural($comments, '1 comment', '@count comments');
  }
  return '';
}
?>
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.