getForumSortStyle(); } else { list($sort_style,$thread_style)=explode("|",$_COOKIE['sorting']); } } else { // set the sort style if ($user){ $user->setForumSortStyle($sort_style); } else { list($old_style,$thread_style)=explode("|",$_COOKIE['sorting']); setcookie('sorting', implode("|",array($sort_style,$thread_style)), time()+3600*24*365); } } $Category = $forum->getCategory(); if ($Category->getType()!=0){ page_head(tr(LINKS_QA).' : '.$forum->getTitle()); } else { page_head(tr(FORUM_TITLE_SHORT).' : '.$forum->getTitle()); } // Allow users with a linktab-browser to get some usefull links echo ''; show_forum_title($forum, NULL); echo ' "; echo ' '; echo ''; echo "\n
'; echo ''; echo "[Create a new thread]

'; echo select_from_array("sort", $forum_sort_styles, $sort_style); echo '

\n"; show_forum($forum, $start, $sort_style, $user); page_tail(); /** * This function shows the threadlist for the given forum * Starting from $start, * using the given $sort_style (as defined in forum.php) * and using the features for the logged in user in $user. **/ function show_forum($forum, $start, $sort_style, $user) { $gotoStr = "
".show_page_nav($forum,$start)."
"; echo $gotoStr; // Display the navbar start_forum_table(array("", tr(FORUM_THREADS), tr(FORUM_POSTS), tr(FORUM_AUTHOR), tr(FORUM_VIEWS), "".tr(FORUM_LAST_POST)."")); $sticky_first = !$user || !$user->hasIgnoreStickyPosts(); // Show hidden threads if logged in user is a moderator $show_hidden = $user && $user->isSpecialUser(S_MODERATOR); $threads = $forum->getThreads($start, THREADS_PER_PAGE, $sort_style, $show_hidden, $sticky_first); // Run through the list of threads, displaying each of them $n = 0; $i=0; foreach ($threads as $key => $thread) { $owner = $thread->getOwner(); $timestamp = $thread->getLastTimestamp(); $unread = $user && ($timestamp>$thread->getLastReadTimestamp($user)) && ($timestamp > $user->getReadTimestamp()); if ($thread->getStatus()==1){ // This is an answered helpdesk thread echo ''; } else { // Just a standard thread. echo ''; } echo ""; if ($user && ($thread->getRating()>$user->getHighRatingThreshold())) { echo "\"Emphasized"; } if ($user && ($thread->getRating()<$user->getLowRatingThreshold())) { echo "\"Filtered"; } if ($thread->isHidden()) { echo "X"; } if ($unread) { if ($thread->isSticky()) { if ($thread->isLocked()) { echo "\"Unread"; } else { echo "\"Unread"; } } else { if ($thread->isLocked()) { echo "\"Unread"; } else { echo "\"Unread"; } } } else { if ($thread->isSticky()) { if ($thread->isLocked()) { echo "\"Sticky,"; } else { echo "\"Sticky\""; } } else { if ($thread->isLocked()) { echo "\"Thread"; } } } echo ""; $titlelength = 48; $title = $thread->getTitle(); if (strlen($title) > $titlelength) { $title = substr($title,0,$titlelength)."..."; } $title = cleanup_title($title); echo ''.$title.'
'; $n = ($n+1)%2; echo ' '.($thread->getPostCount()+1).'
'.re_user_links($owner).'
'.$thread->getViewCount().' '.time_diff_str($thread->getLastTimestamp(), time()).' '; flush(); } end_forum_table(); echo $gotoStr; // Display the navigation bar at the bottom as well. } ?>