summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-01-03 11:32:38 +0000
committerDries Buytaert <dries@buytaert.net>2007-01-03 11:32:38 +0000
commit1ec2b45be72297cd4bcf9af21979fbca15f0d714 (patch)
tree13b3c29c3bd06ceebc6777fb5458214f69da1215 /modules/comment
parent3c6d61e73c65d89f97474f75abbadc9ac457a43b (diff)
downloadbrdo-1ec2b45be72297cd4bcf9af21979fbca15f0d714.tar.gz
brdo-1ec2b45be72297cd4bcf9af21979fbca15f0d714.tar.bz2
- Patch #104156 by chromeyellow and Heine: avoid redundant SQL queries.
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.module3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 28d85b5a3..5ead8b861 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -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'),