? forum-fix-duplicate-ids-rev2.patch
? forum-fix-duplicate-ids-rev3.patch
? improve_menu_inc_documentation-D7.patch
? rename_drupal_execute.patch
? modules/aggregator/.directory
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	21 Mar 2009 15:26:40 -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'.
+ * - $is_first_new_topic: 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 endif; ?>
+<?php if ($is_first_new_topic) { ?>
+  <a id="new"></a>
+<?php } ?>
 
 <?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.489
diff -u -p -r1.489 forum.module
--- modules/forum/forum.module	17 Mar 2009 12:41:54 -0000	1.489
+++ modules/forum/forum.module	21 Mar 2009 15:26:43 -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, 'is_first_new_topic' => FALSE),
     ),
     'forum_topic_navigation' => array(
       'template' => 'forum-topic-navigation',
@@ -661,12 +661,13 @@ function forum_get_topics($tid, $sortby,
 
   $sql = db_rewrite_sql("SELECT n.nid, r.tid, n.title, n.type, n.sticky, u.name, u.uid, n.created AS timestamp, n.comment AS comment_mode, l.last_comment_timestamp, IF(l.last_comment_uid != 0, cu.name, l.last_comment_name) AS last_comment_name, l.last_comment_uid, l.comment_count AS num_comments, f.tid AS forum_tid FROM {node_comment_statistics} l INNER JOIN {node} n ON n.nid = l.nid INNER JOIN {users} cu ON l.last_comment_uid = cu.uid INNER JOIN {taxonomy_term_node} r ON n.vid = r.vid INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {forum} f ON n.vid = f.vid WHERE n.status = 1 AND r.tid = %d");
   $sql .= tablesort_sql($forum_topic_list_header, 'n.sticky DESC,');
-  $sql .= ', n.created DESC';  // Always add a secondary sort order so that the news forum topics are on top.
+  $sql .= ', n.created DESC';  // Always add a secondary sort order so that the new forum topics are on top.
 
   $sql_count = db_rewrite_sql("SELECT COUNT(n.nid) FROM {node} n INNER JOIN {taxonomy_term_node} r ON n.vid = r.vid AND r.tid = %d WHERE n.status = 1");
 
   $result = pager_query($sql, $forum_per_page, 0, $sql_count, $tid);
   $topics = array();
+  $was_first_new_found = FALSE;
   while ($topic = db_fetch_object($result)) {
     if ($user->uid) {
       // folder is new if topic is new or there are new comments since last visit
@@ -685,6 +686,13 @@ function forum_get_topics($tid, $sortby,
       $topic->new = 0;
     }
 
+    // Make sure only one topic is indicated as the first new topic.
+    $topic->is_first_new_topic = FALSE;
+    if (($topic->new != 0) && (!$was_first_new_found)) {
+      $topic->is_first_new_topic = TRUE;
+      $was_first_new_found = TRUE;
+    }
+
     if ($topic->num_comments > 0) {
       $last_reply = new stdClass();
       $last_reply->timestamp = $topic->last_comment_timestamp;
@@ -872,7 +880,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->is_first_new_topic);
       $variables['topics'][$id]->zebra = $row % 2 == 0 ? 'odd' : 'even';
       $row++;
 
@@ -920,6 +928,7 @@ function template_preprocess_forum_topic
  * - $num_posts = 0
  * - $comment_mode = 0
  * - $sticky = 0
+ * - $is_first_new_topic
  *
  * @see forum-icon.tpl.php
  * @see theme_forum_icon()
