New Poll"; $pollimg = "\"Post  "; } $posting_options = "
New Topic$polltxt
"; if ($usenet == 1) { header("Location: $forumlocation/usenetdisplay.php3?FID=$FID&newsgroup=$newsgroup"); exit; } function multipage($count,$TID,$FID){ $count++; // really, we have count+1 number of posts, the original post (1) + count. $pages = $count / $GLOBALS[topicsper]; $pages = ceil($pages); for ($i = 1; $i <= $pages; $i++) { $fwd_back .= " $i "; } $pages = "( Pages: $fwd_back)"; return $pages; } if ($FID == "") { echo "No board defined!"; exit; } cookie($lastactive, $lastvisit, $cookiepath); check_session($username, "Forums", "forumdisplay.php3?FID=$FID&usenet=$usenet", getenv(REMOTE_ADDR)); if (isset($perpage)==0 or $perpage==0) { $perpage=$topicsper; } if (isset($pagenumber)==0 or $pagenumber==0) { $pagenumber=1; } if (isset($userdaysprune) && $userdaysprune > 0){ $prunedays = $userdaysprune; } else { $prunedays = $daysprune; } $prune = time()-$prunedays*86400; $limitlower=($pagenumber-1)*$perpage; $sql = "SELECT title,description,category,active,private,rate,poll,PASSPROTECT,PASSWORD FROM forum WHERE FID=$FID"; $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $info = mysql_fetch_array($query); $forum_name = stripslashes(htmlspecialchars($info[title])); if ($info[active]==0) { echo "$forum_name is inactive, please visit another board!"; exit; } $notify = "$lang[not_loggedin]"; if ($username != "") { $notify = "$lang[loggedin]"; } $sql = "SELECT status FROM members WHERE username='$username'"; $member_query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $memberinfo = mysql_fetch_array($member_query); $status = $memberinfo[status]; //Private Forums code begins if ($info[private] == "0") { $view = "true"; } if ($info[private] == "3") { $view = "true"; } if ($info[private] == "4") { $view = "true"; } if ($info[private] == "1") { if ($status == "Administrator") { $view = "true"; } else { $denied = "This forum is private, and you are not allowed here. Sorry!"; } } if ($info[private] == "2") { if ($status == "Administrator" || $status == "Moderator") { $view = "true"; } else { $denied = "This forum is private, and you are not allowed here. Sorry!"; } } if ($info[rate] == "0") { $ratesystemtop = ""; } else { $ratesystemtop = "
Rating
"; } if($info[poll] == "0") { $polloption = ""; } else { $polloption = "\"Post  "; } if ($info[private] == "5") { $sql = "SELECT * FROM forumprivate WHERE username='$username' AND FID='$FID'"; $query = mysql_query($sql) or die(geterrdesc($sql)); $private = mysql_fetch_array($query); if ($status == "Administrator" || $status == "Moderator" || $private[FID] == "$FID") { $view = "true"; } else { $denied = "This forum is private. Please make sure you are logged in before trying to access it again."; } } if ($info[PASSPROTECT] == "1"){ if($HTTP_COOKIE_VARS["F$FID"] == $info[PASSWORD]){ $view = "true"; } else { $view = "false"; $IFORM = "


"; $denied = "This forum is private, a password is required to access it.
\n$IFORM"; } } // Private forums code ends $description = htmlspecialchars($info[description]); $forumtitle = htmlspecialchars($info[title]); $sql = "DELETE FROM announcements WHERE dateline_end < '" . time() . "'"; $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); /* Begin Announcement Code */ $sql = "SELECT * FROM announcements WHERE FID=-1"; $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $ann2 = mysql_fetch_array($query); $sql = "SELECT * FROM announcements WHERE FID=$FID ORDER BY AID DESC"; $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $announcement = mysql_fetch_array($query); if ($ann2[title] != "" && $ann2[FID] == "-1") { $announcement = "

Here is an annoucement: $ann2[title]"; } elseif ($announcement[title] != "") { $announcement = "

Here is an announcement: $announcement[title]"; } elseif ($announcement[title] != "" && $ann2[title] != "" && $ann2[FID] == "-1") { $announcement = "

Here is a Global Announcement: $announcement[title]
Here is your Local Announcement: $ann2[title]"; } else { $announcement = ""; } /* End Announcements code */ if ($username == "") { $logoutlink = ""; } else { $loginform = ""; $logoutlink = "| Log Out"; $notify = "$lang[loggedin]"; } $adminlink = ""; if($status == 'Administrator') { $adminlink = "| admin"; } $navigation = "Index > $forumtitle"; $prunedis = "
"; $newline = template("header.html"); eval("echo stripslashes(\"$newline\");"); if ($view != "true") { echo $denied; exit; } if ($view == "true") { $sql = "SELECT * FROM forum WHERE pID=$FID AND active=1 ORDER BY displayorder"; $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); if (mysql_num_rows($query) >= 1) { echo ""; $newline = template("forumdisplay_forums_header.html"); eval("echo stripslashes(\"$newline\");"); while ($forum = mysql_fetch_array($query)) { /* $sql = "SELECT username,TID FROM post WHERE dateline<='$forum[lastpost]' ORDER BY dateline DESC LIMIT 0, 1"; $query_lastpost = mysql_db_query("$database", $sql) or die(geterrdesc($sql)); $newpost = mysql_fetch_array($query_lastpost); if ($newpost[username] == "") { $lastpost = ""; } else { $lastpost = "By: $newpost[username]"; } */ if ($lastvisit == "") { $onoff="on"; } else { if ($lastvisit<$forum[lastpost]) { $onoff="on"; } else { $onoff="off"; } } if ($forum[lastpost] == 0) { $lastreplydate = "N/A"; $lastreplytime = ""; $arrow = ""; } else { $sql="select max(tid) as TID from thread where FID=$forum[FID]"; $rslt=mysql_db_query($database,$sql) or die (geterrdesc($sql)); if ($rslt) $newpost=mysql_fetch_array($rslt); else $newpost=""; $lastreplydate = date("F d, Y",$forum[lastpost]+($timeoffset*3600)); $lastreplytime = date("h:i A",$forum[lastpost]+($timeoffset*3600)); $arrow = ""; } if ($onoff == "on") { $newpost = "\"New"; } else { $newpost = "\"No"; } $sql = "SELECT * FROM moderator WHERE FID=$forum[FID]"; $query_moderator = mysql_db_query("$database", $sql) or die(geterrdesc($sql)); $moderator = ""; while ($moderator_info = mysql_fetch_array($query_moderator)) { $moderator .= "$moderator_info[moderator] "; } $forumdisplay_forums = " $newpost $forum[title]
$forum[description] $forum[threadcount] $forum[replycount] $lastreplydate $lastreplytime $arrow $lastpost  $moderator "; echo "$forumdisplay_forums"; } $newline = template("forumdisplay_forums_footer.html"); eval("echo stripslashes(\"$newline\");"); echo ""; } } ?>
$prune ORDER BY lastpost DESC LIMIT $limitlower,$perpage"; $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); if (mysql_num_rows($query) <= 0) { print("\n"); } else { while ($thread = mysql_fetch_array($query)) { $multipage = ""; $threadtitle = htmlspecialchars($thread[title]); $threadtitle = stripslashes($threadtitle); $TID = $thread[TID]; $sql = "SELECT username FROM post WHERE TID='$thread[TID]' ORDER BY dateline DESC LIMIT 0, 1"; $last = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $lastposted = mysql_fetch_array($last); $lastpostedby = $lastposted[username]; if (($thread[icon] == "none") or ($thread[icon] == "")) { $icon = ""; } else { $icon = ""; } $replies = $thread[replycount]; $viewed_num = $thread[viewed_num]; $firstposter = htmlspecialchars($thread[postusername]); $lastreplydate = date("F d, Y",$thread[lastpost]+($timeoffset*3600)); $lastreplytime = date("h:i A",$thread[lastpost]+($timeoffset*3600)); if ($thread[rating] == 1) { $rating = "\"This"; } elseif ($thread[rating] == 2) { $rating = "\"This"; } elseif ($thread[rating] == 3) { $rating = "\"This"; } elseif ($thread[rating] == 4) { $rating = "\"This"; } elseif ($thread[rating] == 5) { $rating = "\"This"; } else { $rating = ""; } $newoldhot="folder"; if ($thread[replycount] > $hottopic) { $newoldhot="hot".$newoldhot; $multipage = multipage($thread[replycount],$thread[TID],$FID); } if ($thread[thread_lock] == 1) { $newoldhot="lock".$newoldhot; } if ($lastvisitdate == "Never") { $newoldhot="new".$newoldhot; } elseif ($lastvisit < $thread[lastpost]) { $newoldhot="new".$newoldhot; } else { } $ratesystemcol = ""; if ($info[rate] == "1") { $ratesystemcol = ""; } $forumdisplay_threads = " $ratesystemcol "; echo "$forumdisplay_threads"; } } //FWD Back $sql = "SELECT COUNT(FID) FROM thread WHERE FID=$FID AND lastpost > '$prune'"; $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $count = mysql_result($query,0); $pages = $count / $perpage; $pages = ceil($pages); if ($pages >= $pagenumber) { for ($i = 1; $i <= $pages; $i++) { if ($i == $pagenumber) { $fwd_back .= " $i "; } else { $fwd_back .= " $i "; } } } $pages = "Pages: $fwd_back"; $jump = jump_to(); echo "
    Thread
Author
Replies
Viewed
Last Date Posted
No posts made in the last $prunedays days.
  $rating
 $icon $threadtitle $multipage $firstposter $replies $viewed_num $lastreplydate $lastreplytime     $lang[lastpost] $lastpostedby
$lang[timezone]
$pages

\"New \"No $lang[opentopic] (\"New  \"Hot $lang[hottopic] ).
\"Closed \"Closed $lang[closedtopic] (\"New \"Hot  $lang[hottopic]).

$jump
$pollimg\"Post
"; $newline = template("footer.html"); eval("echo stripslashes(\"$newline\");"); $mtime2 = microtime(); $mtime2 = explode(" ",$mtime2); $mtime2 = $mtime2[1] + $mtime2[0]; $endtime = $mtime2; $totaltime = ($endtime - $starttime); echo "
$totaltime seconds processing time
"; ?>