function comment_num_replies in Drupal 5
Same name and namespace in other branches
- 4 modules/comment.module \comment_num_replies()
- 6 modules/comment/comment.module \comment_num_replies()
1 call to comment_num_replies()
- comment_access in modules/
comment/ comment.module - This is *not* a hook_access() implementation. This function is called to determine whether the current user has access to a particular comment.
File
- modules/
comment/ comment.module, line 1333 - Enables users to comment on published content.
Code
function comment_num_replies($pid) {
static $cache;
if (!isset($cache[$pid])) {
$cache[$pid] = db_result(db_query('SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND status = %d', $pid, COMMENT_PUBLISHED));
}
return $cache[$pid];
}