comment_num_all($nid)
comment/comment.module, line 1113
Get comment count for a node.
$nid The node id.
The comment count.
<?php
function comment_num_all($nid) {
static $cache;
if (!isset($cache[$nid])) {
$cache[$nid] = db_result(db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = %d', $nid));
}
return $cache[$nid];
}
?>