Commit 1ec2b45b authored by Dries's avatar Dries

- Patch #104156 by chromeyellow and Heine: avoid redundant SQL queries.

parent 3c6d61e7
...@@ -298,7 +298,6 @@ function comment_link($type, $node = NULL, $teaser = FALSE) { ...@@ -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) { ...@@ -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'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment