From 1ec2b45be72297cd4bcf9af21979fbca15f0d714 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 3 Jan 2007 11:32:38 +0000 Subject: - Patch #104156 by chromeyellow and Heine: avoid redundant SQL queries. --- modules/comment/comment.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/comment/comment.module') 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'), -- cgit v1.2.3