- 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')) {
|
if (user_access('access comments')) {
|
||||||
$all = comment_num_all($node->nid);
|
$all = comment_num_all($node->nid);
|
||||||
$new = comment_num_new($node->nid);
|
|
||||||
|
|
||||||
if ($all) {
|
if ($all) {
|
||||||
$links['comment_comments'] = array(
|
$links['comment_comments'] = array(
|
||||||
|
@ -308,6 +307,8 @@ function comment_link($type, $node = NULL, $teaser = FALSE) {
|
||||||
'fragment' => 'comments'
|
'fragment' => 'comments'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$new = comment_num_new($node->nid);
|
||||||
|
|
||||||
if ($new) {
|
if ($new) {
|
||||||
$links['comment_new_comments'] = array(
|
$links['comment_new_comments'] = array(
|
||||||
'title' => format_plural($new, '1 new comment', '@count new comments'),
|
'title' => format_plural($new, '1 new comment', '@count new comments'),
|
||||||
|
|
Loading…
Reference in New Issue