"; for($cat = 0; $cat < mysql_num_rows($cats); $cat++) { $catname = mysql_result($cats, $cat, "catname"); $catno = mysql_result($cats, $cat, "catno"); $catorder = mysql_result($cats, $cat, "catorder"); $forumdetails = mysql_query("SELECT * FROM ${table_prefix}forums WHERE cat='$catorder' ORDER BY fororder ASC"); $catrightsq = mysql_query("SELECT * FROM ${table_prefix}userrights WHERE userid='$logincookie[user]'"); $catrights = mysql_result($catrightsq, 0, "access"); $anytodisp = 0; for($count = 0; $count < mysql_num_rows($forumdetails); $count++) { $forrest = mysql_result($forumdetails, $count, "restricted"); $j = mysql_result($forumdetails, $count, "forumno"); if(strstr($catrights, " $j,") || $forrest == 0) { $anytodisp = 1; } } if($admincheck == 1) { $anytodisp = 1; } if(mysql_num_rows($forumdetails) > 0 && $anytodisp == 1) { echo "
$catname
"; echo "
"; echo ""; for ($i = 0; $i < mysql_num_rows($forumdetails); $i++) { $forumname = mysql_result($forumdetails, $i, "forumname"); $forumdesc = mysql_result($forumdetails, $i, "forumdesc"); $forumno = mysql_result($forumdetails, $i, "forumno"); $forumposts = mysql_query("SELECT * FROM ${table_prefix}threads WHERE forum='$forumno' ORDER BY lastreptime DESC"); $forumlastid = mysql_result($forumposts, 0, "lastrepid"); $threadlastid = mysql_result($forumposts, 0, "threadid"); $postsinlastthread = mysql_query("SELECT * FROM ${table_prefix}public WHERE reply='$threadlastid'"); $postsinlastthread = mysql_num_rows($postsinlastthread); $postsinlastthread++; $postsinlastthread = $postsinlastthread/$postsperpage; $postsinlastthread = ceil($postsinlastthread); $lastpost = mysql_query("SELECT * FROM ${table_prefix}public WHERE msgnumber='$forumlastid'"); $lastuser = mysql_result($lastpost, 0, "userfrom"); $result = mysql_query ("SELECT UNIX_TIMESTAMP(posttime) as epoch_time FROM ${table_prefix}public WHERE msgnumber='$forumlastid'"); $lasttime = mysql_result ($result, 0, 0); $origthread = mysql_result($lastpost, 0, "reply"); if ($origthread == "0") { $lastsubj = mysql_result($lastpost, 0, "subject"); $lastid = mysql_result($lastpost, 0, "msgnumber"); } else { $origpost = mysql_query("SELECT * FROM ${table_prefix}public WHERE msgnumber='$origthread'"); $lastsubj = mysql_result($origpost, 0, "subject"); $lastid = mysql_result($origpost, 0, "msgnumber"); } $totalthreads = mysql_query("SELECT * FROM ${table_prefix}threads WHERE forum='$forumno'"); $tot = mysql_num_rows($totalthreads); $restricted = mysql_result($forumdetails, $i, "restricted"); $rights = mysql_query("SELECT * FROM ${table_prefix}userrights WHERE userid='$logincookie[user]'"); $rights = mysql_result($rights, 0, "access"); $j = $forumno; if(strstr($rights, " $j,")) { $allowed = 1; } else { $allowed = 0; } if($admincheck == 1) { $allowed = 1; } $forumlocked = mysql_result($forumdetails, $i, "locked"); if ($forumlocked == 0) { if(!isset($lastvisit)) { $lastvisit = $logincookie[last]; } $newmsgcheck = mysql_query("SELECT * FROM ${table_prefix}threads WHERE forum='$j' ORDER BY lastreptime DESC"); $newmsgtime = mysql_result($newmsgcheck, 0, "lastreptime"); if (($lastvisit < $newmsgtime) && isset($logincookie[user])) { $forumlocked = "\"$txt_newposts\"/"; } else { $forumlocked = "\"$txt_nonewposts\"/"; } } elseif ($forumlocked == 1) { $newmsgcheck = mysql_query("SELECT * FROM threads WHERE forum='$j' ORDER BY lastreptime DESC"); $newmsgtime = mysql_result($newmsgcheck, 0, "lastreptime"); if (($lastvisit < $newmsgtime) && isset($logincookie[user])) { $forumlocked = "\"$txt_newposts"; } else { $forumlocked = "\"$txt_nonewposts"; } } if($restricted == 0 || ($restricted == 1 && $allowed == 1)) { if ($tot == 0) { echo ""; } else { $lasttime = date($timeform, $lasttime + (3600 * $zone)); echo ""; } } } echo "
 $txt_forumname$txt_lastpost$txt_topics
$forumlocked$forumname
$forumdesc
$txt_notopics
$forumlocked$forumname
$forumdesc
$lastsubj $txt_by $lastuser
$txt_at $lasttime
$tot
"; } } echo "
"; $usersonlinecheck = mysql_query("SELECT * FROM ${table_prefix}access"); $usersonline = mysql_num_rows($usersonlinecheck); $regonlinecheck = mysql_query("SELECT * FROM ${table_prefix}access WHERE userid != 'Guest' ORDER BY userid"); $regonline = mysql_num_rows($regonlinecheck); $guestsonline = $usersonline - $regonline; $totuserscheck = mysql_query("SELECT * FROM ${table_prefix}users WHERE registerdate != '0000-00-00' ORDER BY registerdate DESC"); $totusers = mysql_num_rows($totuserscheck); $lastuser = mysql_result($totuserscheck, 0, "userid"); $topicscheck = mysql_query("SELECT * FROM ${table_prefix}threads"); $tottopics = mysql_num_rows($topicscheck); $postscheck = mysql_query("SELECT * FROM ${table_prefix}public"); $totposts = mysql_num_rows($postscheck); echo "$txt_userson
"; if ($usersonline != 1) { echo "$txt_thereare $usersonline $txt_usersonline"; } else { echo "$txt_thereis 1 $txt_useronline"; } echo " - $regonline $txt_registered $txt_and $guestsonline "; if ($guestsonline != 1) { echo "$txt_guests"; } else { echo "$txt_guest"; } echo ".
"; if ($regonline != 0) { echo "$txt_regusers "; for ($i = 0; $i < $regonline; $i++) { $thisuser = mysql_result($regonlinecheck, $i, "userid"); echo "$thisuser"; if ($i != $regonline - 1) { echo ", "; } } echo ".
"; } echo "$txt_wehave $totusers "; if ($totusers != 1) { echo "$txt_members"; } else { echo "$txt_member"; } echo " $txt_with $totposts "; if ($totposts != 1) { echo "$txt_posts"; } else { echo "$txt_post"; } echo " $txt_in $tottopics "; if ($tottopics != 1) { echo "$txt_topicslc"; } else { echo "$txt_topic"; } echo ".
$txt_lastreg $lastuser."; $thetime = time() + (3600 * $zone); $today = date("-m-d", $thetime); $birthdays = mysql_query("SELECT * FROM ${table_prefix}users WHERE userdob LIKE '%$today'"); if(mysql_num_rows($birthdays) > 0) { echo "
$txt_birthday "; } for ($i = 0; $i < mysql_num_rows($birthdays); $i++) { $userbd = mysql_result($birthdays, $i, "userid"); if ($i == (mysql_num_rows($birthdays) - 1) && $i != 0) { echo "and $userbd."; } elseif ($i == (mysql_num_rows($birthdays) - 1)) { echo "$userbd."; } else { echo "$userbd, "; } } echo "
"; if(isset($logincookie[user])) { echo "
$txt_welcomeback $sitename, $logincookie[user]."; if ($pmno > 0) { echo " $txt_youhave $pmno "; if ($pmno != 1) echo "$txt_newpms."; else echo "$txt_newpm."; echo " $txt_inbox"; } echo "
$txt_lastvisit "; if(!isset($lastvisitunix)) { $lastvisitunix = $logincookie[lastv]; } $lastvisitunix = date($timeform, $lastvisitunix + (3600 * $zone)); echo "$lastvisitunix."; $access = mysql_query("SELECT * FROM ${table_prefix}userrights WHERE userid='$logincookie[user]'"); $theaccess = mysql_result($access, 0, "mod"); if(strstr($theaccess, ",")) { $mod = 1; } else { $mod = 0; } if ($admincheck == 1 || $mod == 1) { $reported = mysql_query("SELECT * FROM ${table_prefix}reported"); if (mysql_num_rows($reported) > 0) { echo "
$txt_reporteddeal $txt_reportedview"; } } echo "
$txt_markallread
"; } else $notlogged = 1; echo "
"; if($notlogged == 1) echo "
$txt_login $txt_or $txt_registerlc
$txt_username:
$txt_password:
$txt_rememberme:
"; echo "$txt_key
\"$txt_newposts\"/ $txt_newposts\"$txt_nonewposts\"/ $txt_nonewposts
\"$txt_newposts $txt_newposts $txt_lockedt\"$txt_nonewposts $txt_nonewposts $txt_lockedt
"; if($notlogged == 1) echo "
"; echo "
"; include "footer.php"; } ?>