special_user, $specialbit,1)==1); } function getHasRated($user, $postid){ return (strstr($user->rated_posts,"|".$postid)); } function getSortStyle($user,$place){ if ($user->id!=""){ list($forum,$thread,$faq,$answer)=explode("|",$user->sorting); } else { list($forum,$thread,$faq,$answer)=explode("|",$_COOKIE['sorting']); } return $$place; } // display functions function show_posts($thread, $sort_style, $filter, $show_controls=true, $do_coloring=true, $is_helpdesk=false) { global $logged_in_user; $n = 1; if ($show_controls && !$is_helpdesk) { $controls = FORUM_CONTROLS; } else if ($show_controls && $is_helpdesk) { $controls = HELPDESK_CONTROLS; } else { $controls = NO_CONTROLS; } // If logged in user is moderator, // let him see all posts - including hidden ones // if (isSpecialUser($logged_in_user,0)){ $show_hidden_posts = true; } else { $show_hidden_posts = false; } $posts = getPosts($thread->id, -1, -1, $sort_style, $show_hidden_posts); $logged_in_user = getThreadLastVisited($logged_in_user,$thread); setThreadLastVisited($logged_in_user,$thread); $firstPost = getFirstPost($thread->id); if ($is_helpdesk) { if ($firstPost) { show_post($firstPost, $thread, $logged_in_user, $n, $controls, true,$filter); if ($firstPost->timestamp>$logged_in_user->thread_last_visited){ $first_unread_post=$firstPost; } } } while ($post = mysql_fetch_object($posts)) { if (!$is_helpdesk || ($is_helpdesk && $post->id != $firstPost->id)) { show_post($post, $thread, $logged_in_user, $n, $controls, false, $filter); if ($do_coloring) $n = ($n+1)%2; if (($post->timestamp>$logged_in_user->thread_last_visited) && (($post->timestamp<$first_unread_post->timestamp) || $first_unread_post->timestamp==0)){ $first_unread_post=$post; } } } if ($logged_in_user->jump_to_unread){ if ($first_unread_post->id!=""){ echo ""; } else { echo ""; } } } function show_post($post, $thread, $logged_in_user, $n, $controls=FORUM_CONTROLS, $separate=false, $filter=true) { $user = lookup_user_id($post->user); $user = getForumPreferences($user); $user->has_avatar = ($user->avatar != ""); //If the user that made this post is on the list of people to ignore, change thresholds to be more strict if (in_array($user->id,explode("|",$logged_in_user->ignorelist))){ $user_is_on_ignorelist=true; $rated_below_threshold = ($logged_in_user->high_rating_threshold>($post->score*$post->votes)); $rated_above_threshold = ($logged_in_user->high_rating_threshold+abs($logged_in_user->low_rating_threshold)<($post->score*$post->votes)); } else { //Use normal threshold values $rated_below_threshold = ($logged_in_user->low_rating_threshold>($post->score*$post->votes)); $rated_above_threshold = ($logged_in_user->high_rating_threshold<($post->score*$post->votes)); } $can_edit = ($logged_in_user && $user->id == $logged_in_user->id); //Only the creator can edit the post //$can_edit = ((isSpecialUser($logged_in_user,0)) || ($logged_in_user && $user->id == $logged_in_user->id));// Everybody assumes we can edit posts, why not make it so? echo "
", $posttext, "
"; echo "ID: ", $post->id; if ($controls == HELPDESK_CONTROLS && $separate) { echo " | "; } else if ($controls == HELPDESK_CONTROLS && !$separate) { echo " / Score: ", round(($post->score * $post->votes),0), ""; } else { $rating = floor($post->score*$post->votes + 0.01); echo " | Rating: ", $rating, " | rate: id."&choice=p\"> / id."&choice=n\"> - id."\">"; } if ($controls == FORUM_CONTROLS) { echo "[id . "&post=" . $post->id . "#input\">Reply to this post] | "; } else if ($controls == HELPDESK_CONTROLS && !$separate) { echo "[id . "&post=" . $post->id . "&helpdesk=1#input\">Reply to this answer] | "; } echo "
Author | Answers | "; } } // utility functions function start_forum_table($headings, $extra="width=100%") { start_table($extra); echo "
---|---|
\n"; if (!$forum && !$thread) { echo "
"; if ($helpdesk) { echo " Questions and problems
"; } else { echo " Message boards"; } } else if ($forum && !$thread) { echo ""; if ($helpdesk) { echo "", " Questions and problems : "; } else { echo "", " Message boards : "; } echo $forum->title; echo "