summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-12-30 21:20:38 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-12-30 21:20:38 +0000
commit36fce2f00111f75c6ef2cdd68c8abefc95753210 (patch)
tree65cc480c660c19b386f02296470b4ba643b2d8f4 /modules/comment/comment.module
parent77176a8f647b5db696c68528da3f9fd15786db61 (diff)
downloadbrdo-36fce2f00111f75c6ef2cdd68c8abefc95753210.tar.gz
brdo-36fce2f00111f75c6ef2cdd68c8abefc95753210.tar.bz2
#18870 by zen. Only allow the new comment anchor to be output forthe first new comment.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module8
1 files changed, 6 insertions, 2 deletions
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 .= "<a id=\"new\"></a>\n";
}