- Patch #104156 by chromeyellow and Heine: avoid redundant SQL queries.
parent
3c6d61e73c
commit
1ec2b45be7
|
@ -298,7 +298,6 @@ function comment_link($type, $node = NULL, $teaser = FALSE) {
|
|||
|
||||
if (user_access('access comments')) {
|
||||
$all = comment_num_all($node->nid);
|
||||
$new = comment_num_new($node->nid);
|
||||
|
||||
if ($all) {
|
||||
$links['comment_comments'] = array(
|
||||
|
@ -308,6 +307,8 @@ function comment_link($type, $node = NULL, $teaser = FALSE) {
|
|||
'fragment' => 'comments'
|
||||
);
|
||||
|
||||
$new = comment_num_new($node->nid);
|
||||
|
||||
if ($new) {
|
||||
$links['comment_new_comments'] = array(
|
||||
'title' => format_plural($new, '1 new comment', '@count new comments'),
|
||||
|
|
Loading…
Reference in New Issue