\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 "";
}
if ($user && ($thread->getRating()<$user->getLowRatingThreshold())) {
echo "";
}
if ($thread->isHidden()) {
echo "X";
}
if ($unread) {
if ($thread->isSticky()) {
if ($thread->isLocked()) {
echo "";
} else {
echo "";
}
} else {
if ($thread->isLocked()) {
echo "";
} else {
echo "";
}
}
} else {
if ($thread->isSticky()) {
if ($thread->isLocked()) {
echo "";
} else {
echo "";
}
} else {
if ($thread->isLocked()) {
echo "";
}
}
}
echo "