diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-01-03 11:32:38 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-01-03 11:32:38 +0000 |
commit | 1ec2b45be72297cd4bcf9af21979fbca15f0d714 (patch) | |
tree | 13b3c29c3bd06ceebc6777fb5458214f69da1215 /modules/comment/comment.module | |
parent | 3c6d61e73c65d89f97474f75abbadc9ac457a43b (diff) | |
download | brdo-1ec2b45be72297cd4bcf9af21979fbca15f0d714.tar.gz brdo-1ec2b45be72297cd4bcf9af21979fbca15f0d714.tar.bz2 |
- Patch #104156 by chromeyellow and Heine: avoid redundant SQL queries.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 3 |
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'), |