? .buildpath
? .project
? .settings
? default-profile-create-bundle-581764-4.patch
? dupids.patch
? forum-fix-duplicate-ids-rev11.patch
? sites/private
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: modules/forum/forum-icon.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum-icon.tpl.php,v
retrieving revision 1.5
diff -u -p -r1.5 forum-icon.tpl.php
--- modules/forum/forum-icon.tpl.php	8 Mar 2009 20:58:19 -0000	1.5
+++ modules/forum/forum-icon.tpl.php	19 Sep 2009 13:32:36 -0000
@@ -9,17 +9,16 @@
  * - $new_posts: Indicates whether or not the topic contains new posts.
  * - $icon: The icon to display. May be one of 'hot', 'hot-new', 'new',
  *   'default', 'closed', or 'sticky'.
+ * - $first_new: Indicates whether this is the first topic with
+ *   new posts.
  *
  * @see template_preprocess_forum_icon()
  * @see theme_forum_icon()
  */
 ?>
-<?php if ($new_posts): ?>
-  <a id="new">
+<?php if ($first_new): ?>
+  <a id="new"></a>
 <?php endif; ?>
 
 <?php print theme('image', "misc/forum-$icon.png") ?>
 
-<?php if ($new_posts): ?>
-  </a>
-<?php endif; ?>
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.519
diff -u -p -r1.519 forum.module
--- modules/forum/forum.module	18 Sep 2009 00:04:22 -0000	1.519
+++ modules/forum/forum.module	19 Sep 2009 13:32:37 -0000
@@ -51,7 +51,7 @@ function forum_theme() {
     ),
     'forum_icon' => array(
       'template' => 'forum-icon',
-      'arguments' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0),
+      'arguments' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0, 'first_new' => FALSE),
     ),
     'forum_submitted' => array(
       'template' => 'forum-submitted',
@@ -746,6 +746,7 @@ function forum_get_topics($tid, $sortby,
   $query->setCountQuery($count_query);
   $result = $query->execute();
   $topics = array();
+  $first_new_found = FALSE;
   foreach ($result as $topic) {
     if ($user->uid) {
       // folder is new if topic is new or there are new comments since last visit
@@ -764,6 +765,13 @@ function forum_get_topics($tid, $sortby,
       $topic->new = 0;
     }
 
+    // Make sure only one topic is indicated as the first new topic.
+    $topic->first_new = FALSE;
+    if (($topic->new != 0) && (!$first_new_found)) {
+      $topic->first_new = TRUE;
+      $first_new_found = TRUE;
+    }
+
     if ($topic->num_comments > 0) {
       $last_reply = new stdClass();
       $last_reply->timestamp = $topic->last_comment_timestamp;
@@ -951,7 +959,7 @@ function template_preprocess_forum_topic
   if (!empty($variables['topics'])) {
     $row = 0;
     foreach ($variables['topics'] as $id => $topic) {
-      $variables['topics'][$id]->icon = theme('forum_icon', $topic->new, $topic->num_comments, $topic->comment_mode, $topic->sticky);
+      $variables['topics'][$id]->icon = theme('forum_icon', $topic->new, $topic->num_comments, $topic->comment_mode, $topic->sticky, $topic->first_new);
       $variables['topics'][$id]->zebra = $row % 2 == 0 ? 'odd' : 'even';
       $row++;
 
@@ -999,6 +1007,7 @@ function template_preprocess_forum_topic
  * - $num_posts = 0
  * - $comment_mode = 0
  * - $sticky = 0
+ * - $first_new
  *
  * @see forum-icon.tpl.php
  * @see theme_forum_icon()
