diff --git a/checkin_notes b/checkin_notes index 1e0c4734db..ef37d510ea 100755 --- a/checkin_notes +++ b/checkin_notes @@ -13896,3 +13896,9 @@ David 30 Dec 2006 sched/ start + +Rytis 30 Dec 2006 + - Forum: do not show hidden threads when the user is logged out. + + html/user/ + forum_thread.php diff --git a/html/user/forum_thread.php b/html/user/forum_thread.php index ad448f4def..046a4de0c1 100644 --- a/html/user/forum_thread.php +++ b/html/user/forum_thread.php @@ -17,12 +17,23 @@ if ($filter != "false"){ $filter = false; } +$logged_in_user = re_get_logged_in_user(false); + // Fetch the thread and increment the number of views $thread = new Thread($threadid); +if ($thread->isHidden()) { + if ((!$logged_in_user) || (($logged_in_user) && (!$logged_in_user->isSpecialUser(S_MODERATOR)))) { + /* If the user logged in is a moderator, show him the + * thread if he goes so far as to name it by ID like this. + * Otherwise, hide the thread. + */ + error_page(tr(FORUM_THREAD_HIDDEN)); + } +} + $forum = $thread->getForum(); $category = $forum->getCategory(); -$logged_in_user = re_get_logged_in_user(false); $title = cleanup_title($thread->getTitle()); if (!$sort_style) { @@ -54,19 +65,13 @@ if ($logged_in_user && $logged_in_user->hasJumpToUnread()){ $is_subscribed = $logged_in_user && $thread->isSubscribed($logged_in_user); show_forum_title($forum, $thread); -if (($thread->isHidden()) && $logged_in_user && (!$logged_in_user->isSpecialUser(S_MODERATOR))) { - /* If the user logged in is a moderator, show him the - * thread if he goes so far as to name it by ID like this. - * Otherwise, hide the thread. - */ - error_page(tr(FORUM_THREAD_HIDDEN)); -} else { - if ($thread->getType()!=0 && $thread->getStatus()==0){ - $thread_owner = $thread->getOwner(); - if ($logged_in_user){ + +if ($thread->getType()!=0 && $thread->getStatus()==0){ + $thread_owner = $thread->getOwner(); + if ($logged_in_user){ if ($thread_owner->getID() == $logged_in_user->getID()){ - if ($thread->getPostCount()==0){} else { - // Show a "this question has been answered" to the author + if ($thread->getPostCount()!=0) { + // Show a "this question has been answered" to the author echo "
".$reply_text; - show_forum_title($forum, $thread); - $thread->incViews(); - } +echo " +
\n"; + +// Here is where the actual thread begins. +$headings = array(array(tr(FORUM_AUTHOR),"authorcol"), array(tr(FORUM_MESSAGE),"",2)); + +start_forum_table($headings, "id=\"thread\" width=100%"); +show_posts($thread, $sort_style, $filter, $logged_in_user, true); +end_forum_table(); + +echo "".$reply_text; +show_forum_title($forum, $thread); +$thread->incViews(); + page_tail(); ?>