From b1fe1c941eeadd471c06babc02dd0d59160578a0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 28 Jan 2004 22:10:34 +0000 Subject: - Replaced the 'active post' and 'recent post' by better integrated and easier to understand 'new' links. The 'new' links are clickable both at the forum overview (to get to the new forum topics) and at the topic overview (to get to the new comments). --- modules/forum.module | 22 ++++++++++------------ modules/forum/forum.module | 22 ++++++++++------------ 2 files changed, 20 insertions(+), 24 deletions(-) (limited to 'modules') diff --git a/modules/forum.module b/modules/forum.module index 4dcbaa061..340535775 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -554,14 +554,6 @@ function theme_forum_list($forums, $parents, $tid) { $links = array(); - if ($new_topics) { - $links[] = l(t("newest topic"), "forum/$forum->tid/new"); - } - - if ($forum->last_post) { - $links[] = l(t("active topic"), "node/view/". $forum->last_post->nid); - } - $description = "
depth * 30) ."px;\">\n"; $description .= "
". l($forum->name, "forum/$forum->tid") ."
\n"; @@ -575,7 +567,7 @@ function theme_forum_list($forums, $parents, $tid) { $rows[] = array( array("data" => $description, "class" => "forum"), - array("data" => $forum->num_topics . ($new_topics ? "
(". t("%a new", array("%a" => $new_topics)) .")" : ""), "class" => "topics"), + array("data" => $forum->num_topics . ($new_topics ? "
(". l(t("%a new", array("%a" => $new_topics)), "forum/$forum->tid", NULL, NULL, 'new') .")" : ""), "class" => "topics"), array("data" => $forum->num_posts, "class" => "posts"), array("data" => _forum_format($forum->last_post), "class" => "last-reply")); } @@ -614,7 +606,7 @@ function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset $rows[] = array( array("data" => _forum_icon($topic->new, $topic->num_comments, $topic->comment_mode), "class" => "icon"), array("data" => l($topic->title, "node/view/$topic->nid"), "class" => "topic"), - array("data" => $topic->num_comments . ($topic->new_replies ? "
(". t("%a new", array("%a" => $topic->new_replies)) .")" : ""), "class" => "replies"), + array("data" => $topic->num_comments . ($topic->new_replies ? "
(". l(t("%a new", array("%a" => $topic->new_replies)), "node/view/$topic->nid", NULL, NULL, 'new') .")" : ""), "class" => "replies"), array("data" => _forum_format($topic), "class" => "created"), array("data" => _forum_format($topic->last_reply), "class" => "last-reply") ); @@ -656,11 +648,17 @@ function _forum_icon($new_posts, $num_posts = 0, $comment_mode = 0) { // default $file = $base_path ."/forum-$icon.gif"; - return "\"\""; + $output = "\"\""; } else { - return " "; + $output = " "; } + + if ($new_posts) { + $output = "$output"; + } + + return $output; } function _forum_user_last_visit($nid) { diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 4dcbaa061..340535775 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -554,14 +554,6 @@ function theme_forum_list($forums, $parents, $tid) { $links = array(); - if ($new_topics) { - $links[] = l(t("newest topic"), "forum/$forum->tid/new"); - } - - if ($forum->last_post) { - $links[] = l(t("active topic"), "node/view/". $forum->last_post->nid); - } - $description = "
depth * 30) ."px;\">\n"; $description .= "
". l($forum->name, "forum/$forum->tid") ."
\n"; @@ -575,7 +567,7 @@ function theme_forum_list($forums, $parents, $tid) { $rows[] = array( array("data" => $description, "class" => "forum"), - array("data" => $forum->num_topics . ($new_topics ? "
(". t("%a new", array("%a" => $new_topics)) .")" : ""), "class" => "topics"), + array("data" => $forum->num_topics . ($new_topics ? "
(". l(t("%a new", array("%a" => $new_topics)), "forum/$forum->tid", NULL, NULL, 'new') .")" : ""), "class" => "topics"), array("data" => $forum->num_posts, "class" => "posts"), array("data" => _forum_format($forum->last_post), "class" => "last-reply")); } @@ -614,7 +606,7 @@ function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset $rows[] = array( array("data" => _forum_icon($topic->new, $topic->num_comments, $topic->comment_mode), "class" => "icon"), array("data" => l($topic->title, "node/view/$topic->nid"), "class" => "topic"), - array("data" => $topic->num_comments . ($topic->new_replies ? "
(". t("%a new", array("%a" => $topic->new_replies)) .")" : ""), "class" => "replies"), + array("data" => $topic->num_comments . ($topic->new_replies ? "
(". l(t("%a new", array("%a" => $topic->new_replies)), "node/view/$topic->nid", NULL, NULL, 'new') .")" : ""), "class" => "replies"), array("data" => _forum_format($topic), "class" => "created"), array("data" => _forum_format($topic->last_reply), "class" => "last-reply") ); @@ -656,11 +648,17 @@ function _forum_icon($new_posts, $num_posts = 0, $comment_mode = 0) { // default $file = $base_path ."/forum-$icon.gif"; - return "\"\""; + $output = "\"\""; } else { - return " "; + $output = " "; } + + if ($new_posts) { + $output = "$output"; + } + + return $output; } function _forum_user_last_visit($nid) { -- cgit v1.2.3