? .DS_Store
? drupal6-feature_forum_latest_post.patch
? modules/.DS_Store
? modules/forum/.DS_Store
? modules/forum/a.patch
? sites/default/files
? sites/default/settings.php
Index: modules/forum/forum-submitted.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum-submitted.tpl.php,v
retrieving revision 1.3
diff -u -p -r1.3 forum-submitted.tpl.php
--- modules/forum/forum-submitted.tpl.php	7 Aug 2007 08:39:35 -0000	1.3
+++ modules/forum/forum-submitted.tpl.php	11 May 2008 08:09:42 -0000
@@ -10,6 +10,7 @@
  *
  * - $author: The author of the post.
  * - $time: How long ago the post was created.
+ * - $title: A truncated & linked version of the post title.
  * - $topic: An object with the raw data of the post. Unsafe, be sure
  *   to clean this data before printing.
  *
@@ -18,11 +19,21 @@
  */
 ?>
 <?php if ($time): ?>
-  <?php print t(
-  '@time ago<br />by !author', array(
-    '@time' => $time,
-    '!author' => $author,
-    )); ?>
+  <?php if ($page == 0): ?>
+    <?php print t(
+      '!title<br />@time ago<br />by !author', array(
+        '!title' => $title,
+        '@time' => $time,
+        '!author' => $author,
+        )); ?>
+  <?php else: ?>
+    <?php print t(
+      '@time ago<br />by !author', array(
+        '@time' => $time,
+        '!author' => $author,
+        )); ?>
+  <?php endif; ?>
+
 <?php else: ?>
   <?php print t('n/a'); ?>
 <?php endif; ?>
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.456
diff -u -p -r1.456 forum.module
--- modules/forum/forum.module	6 May 2008 12:18:47 -0000	1.456
+++ modules/forum/forum.module	11 May 2008 08:09:42 -0000
@@ -59,7 +59,7 @@ function forum_theme() {
     ),
     'forum_submitted' => array(
       'template' => 'forum-submitted',
-      'arguments' => array('topic' => NULL),
+      'arguments' => array('topic' => NULL, 'page' => NULL),
     ),
   );
 }
@@ -527,12 +527,14 @@ function forum_get_forums($tid = 0) {
     // This query does not use full ANSI syntax since MySQL 3.x does not support
     // table1 INNER JOIN table2 INNER JOIN table3 ON table2_criteria ON table3_criteria
     // used to join node_comment_statistics to users.
-    $sql = "SELECT ncs.last_comment_timestamp, IF (ncs.last_comment_uid != 0, u2.name, ncs.last_comment_name) AS last_comment_name, ncs.last_comment_uid FROM {node} n INNER JOIN {users} u1 ON n.uid = u1.uid INNER JOIN {term_node} tn ON n.vid = tn.vid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {users} u2 ON ncs.last_comment_uid=u2.uid WHERE n.status = 1 AND tn.tid = %d ORDER BY ncs.last_comment_timestamp DESC";
+    $sql = "SELECT n.nid, n.title, ncs.last_comment_timestamp, IF (ncs.last_comment_uid != 0, u2.name, ncs.last_comment_name) AS last_comment_name, ncs.last_comment_uid FROM {node} n INNER JOIN {users} u1 ON n.uid = u1.uid INNER JOIN {term_node} tn ON n.vid = tn.vid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {users} u2 ON ncs.last_comment_uid=u2.uid WHERE n.status = 1 AND tn.tid = %d ORDER BY ncs.last_comment_timestamp DESC";
     $sql = db_rewrite_sql($sql);
     $topic = db_fetch_object(db_query_range($sql, $forum->tid, 0, 1));
 
     $last_post = new stdClass();
     if (!empty($topic->last_comment_timestamp)) {
+      $last_post->nid = $topic->nid;
+      $last_post->title = $topic->title;
       $last_post->timestamp = $topic->last_comment_timestamp;
       $last_post->name = $topic->last_comment_name;
       $last_post->uid = $topic->last_comment_uid;
@@ -818,8 +820,8 @@ function template_preprocess_forum_topic
         $variables['topics'][$id]->title = l($topic->title, "node/$topic->nid");
         $variables['topics'][$id]->message = '';
       }
-      $variables['topics'][$id]->created = theme('forum_submitted', $topic);
-      $variables['topics'][$id]->last_reply = theme('forum_submitted', isset($topic->last_reply) ? $topic->last_reply : NULL);
+      $variables['topics'][$id]->created = theme('forum_submitted', $topic, TRUE);
+      $variables['topics'][$id]->last_reply = theme('forum_submitted', isset($topic->last_reply) ? $topic->last_reply : NULL, TRUE);
 
       $variables['topics'][$id]->new_text = '';
       $variables['topics'][$id]->new_url = '';
@@ -917,6 +919,12 @@ function template_preprocess_forum_topic
 function template_preprocess_forum_submitted(&$variables) {
   $variables['author'] = isset($variables['topic']->uid) ? theme('username', $variables['topic']) : '';
   $variables['time'] = isset($variables['topic']->timestamp) ? format_interval(time() - $variables['topic']->timestamp) : '';
+  if ($variables['page'] === NULL) {
+    // Pass on the last post information for forum category listings.
+    $nid = isset($variables['topic']->nid) ? $variables['topic']->nid : NULL;
+    $title = isset($variables['topic']->title) ? $variables['topic']->title : NULL;
+    $variables['title'] = l(truncate_utf8($title, 25, TRUE, TRUE), "node/$nid", array('fragment' => 'new'));
+  }
 }
 
 function _forum_user_last_visit($nid) {
