Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.407
diff -u -p -r1.407 forum.module
--- modules/forum/forum.module	2 Jul 2007 17:08:35 -0000	1.407
+++ modules/forum/forum.module	10 Jul 2007 18:13:00 -0000
@@ -693,9 +693,14 @@ function forum_link_alter(&$links, $node
  *
  * @TODO Give a better description. Not sure where this function is used yet.
  */
-function _forum_format($topic) {
+function _forum_format($topic, $show_title = FALSE) {
   if ($topic && !empty($topic->timestamp)) {
-    return t('@time ago<br />by !author', array('@time' => format_interval(time() - $topic->timestamp), '!author' => theme('username', $topic)));
+    if (!$show_title) {
+      return t('@time ago<br />by !author', array('@time' => format_interval(time() - $topic->timestamp), '!author' => theme('username', $topic)));
+    }
+    else {
+      return t('!title<br />@time ago<br />by !author', array('!title' => l(truncate_utf8($topic->title, 25, TRUE, TRUE), "node/$topic->nid"),'@time' => format_interval(time() - $topic->timestamp), '!author' => theme('username', $topic)));
+    }
   }
   else {
     return t('n/a');
@@ -750,7 +755,7 @@ 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.nid = tn.nid 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 ncs.last_comment_timestamp, IF (ncs.last_comment_uid != 0, u2.name, ncs.last_comment_name) AS last_comment_name, ncs.last_comment_uid, n.nid, n.title FROM {node} n INNER JOIN {users} u1 ON n.uid = u1.uid INNER JOIN {term_node} tn ON n.nid = tn.nid 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));
 
@@ -759,6 +764,8 @@ function forum_get_forums($tid = 0) {
       $last_post->timestamp = $topic->last_comment_timestamp;
       $last_post->name = $topic->last_comment_name;
       $last_post->uid = $topic->last_comment_uid;
+      $last_post->nid = $topic->nid;
+      $last_post->title = $topic->title;
     }
     $forum->last_post = $last_post;
 
@@ -1000,7 +1007,7 @@ function theme_forum_list($forums, $pare
             array('data' => $description, 'class' => 'forum'),
             array('data' => $forum->num_topics . ($new_topics ? '<br />'. l(format_plural($new_topics, '1 new', '@count new'), "forum/$forum->tid", array('fragment' => 'new')) : ''), 'class' => 'topics'),
             array('data' => $forum->num_posts, 'class' => 'posts'),
-            array('data' => _forum_format($forum->last_post), 'class' => 'last-reply'),
+            array('data' => _forum_format($forum->last_post, TRUE), 'class' => 'last-reply'),
           ),
         );
         if ($new_topics > 0) {
