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 25 Aug 2007 05:42:21 -0000 @@ -18,11 +18,20 @@ */ ?> - by !author', array( - '@time' => $time, - '!author' => $author, - )); ?> + + @time ago
by !author', array( + '!title' => l(truncate_utf8($topic->title, 25, TRUE, TRUE), "node/$topic->nid", array('fragment' => 'new')), + '@time' => $time, + '!author' => $author, + )); ?> + + by !author', array( + '@time' => $time, + '!author' => $author, + )); ?> + Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.413 diff -u -p -r1.413 forum.module --- modules/forum/forum.module 12 Aug 2007 15:55:36 -0000 1.413 +++ modules/forum/forum.module 25 Aug 2007 05:42:25 -0000 @@ -55,7 +55,7 @@ function forum_theme() { ), 'forum_submitted' => array( 'file' => 'forum-submitted', - 'arguments' => array('topic' => NULL), + 'arguments' => array('topic' => NULL, 'page' => FALSE), ), ); } @@ -482,7 +482,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)); @@ -491,6 +491,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; @@ -762,8 +764,8 @@ function template_preprocess_forum_topic $row++; $variables['topics'][$id]->title = l($topic->title, "node/$topic->nid"); - $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 = ''; @@ -865,6 +867,10 @@ 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) { + $variables['nid'] = $variables['topic']->nid; + $variables['title'] = $variables['topic']->title; + } } function _forum_user_last_visit($nid) {