comment_num_replies
- Versions
- 4.6 – 7
comment_num_replies($pid)
Get replies count for a comment.
Parameters
$pid The comment id.
Return value
The replies count.
Code
modules/comment/comment.module, line 1533
<?php
function comment_num_replies($pid) {
$cache = &drupal_static(__FUNCTION__, array());
if (!isset($cache[$pid])) {
$cache[$pid] = db_query('SELECT COUNT(cid) FROM {comment} WHERE pid = :pid AND status = :status', array(
':pid' => $pid,
':status' => COMMENT_PUBLISHED,
))->fetchField();
}
return $cache[$pid];
}
?>Login or register to post comments 