From 36fce2f00111f75c6ef2cdd68c8abefc95753210 Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Sat, 30 Dec 2006 21:20:38 +0000 Subject: #18870 by zen. Only allow the new comment anchor to be output forthe first new comment. --- modules/comment/comment.module | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index a6e7f4cd8..867bc61df 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1679,10 +1679,14 @@ function theme_comment_preview($comment, $links = array(), $visible = 1) { }; function theme_comment_view($comment, $links = array(), $visible = 1) { + static $first_new = TRUE; - // Emit selectors: $output = ''; - if (($comment->new = node_mark($comment->nid, $comment->timestamp)) != MARK_READ) { + $comment->new = node_mark($comment->nid, $comment->timestamp); + if ($first_new && $comment->new != MARK_READ) { + // Assign the anchor only for the first new comment. This avoids duplicate + // id attributes on a page. + $first_new = FALSE; $output .= "\n"; } -- cgit v1.2.3