diff options
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index 1f2b24f0d..d16b60127 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -75,7 +75,8 @@ function node_help_page() { * Gather a listing of links to nodes. * * @param $result - * A DB result object from a query to fetch node objects. + * A DB result object from a query to fetch node objects. If your query joins the <code>node_comment_statistics</code> table so that the <code>comment_count</code> field is available, a title attribute will be added to show the number of comments. + * field to be set. * @param $title * A heading for the resulting list. * @@ -84,8 +85,7 @@ function node_help_page() { */ function node_title_list($result, $title = NULL) { while ($node = db_fetch_object($result)) { - $number = module_invoke('comment', 'num_all', $node->nid); - $items[] = l($node->title, 'node/'. $node->nid, $number ? array('title' => format_plural($number, '1 comment', '%count comments')) : ''); + $items[] = l($node->title, 'node/'. $node->nid, $node->comment_count ? array('title' => format_plural($node->comment_count, '1 comment', '%count comments')) : ''); } return theme('node_list', $items, $title); |