1) { $onlineusers.=", "; } $onlineusers.="".$row['name'].""; } } //Old mark forums read code. Needs to be updated. /* if ($logpassword) { $headlinks.=" | Mark all forums read"; $header=makeheader($header1,$headlinks,$header2); } if ($action=="markforumread" and $logpassword!="" and $users['$loguserid']['3']==$logpassword) { $postread['$loguserid']['$forumid']=time(); $postread=writepostread($postread); } if ($action=="markallforumsread" and $logpassword!="" and $users['$loguserid']['3']==$logpassword) { $f=0; while ($forums['$f']['0']!="") { $postread['$loguserid']['$f']=time(); $f++; } $postread=writepostread($postread); } */ print "$header"; $logmsg=""; if ($loguserid) { $logmsg="$smallfont"."You are logged as ".$loguser['name']."."; } $lasthour = time() - 3600; $lastday = time() - 86400; $totalthreads=mysqli_num_rows(mysqli_query($con,"SELECT * FROM threads")); $totalposts=mysqli_num_rows(mysqli_query($con,"SELECT * FROM posts")); $postslastday=mysqli_num_rows(mysqli_query($con,"SELECT * FROM posts WHERE date >= $lastday")); $postslasthour=mysqli_num_rows(mysqli_query($con,"SELECT * FROM posts WHERE date >= $lasthour")); $i=0; print "
$smallfont
$logmsg$smallfont$usercount registered users
Latest registered user: $lastusername
$smallfont"."$totalthreads threads and $totalposts posts in the board | $postslastday posts during the last day, $postslasthour posts during the last hour.
$smallfont"."$numonline users currently online: $onlineusers
"; $i=0; $forumlist="
$tccellh"."  $tccellh"."Forum $tccellh"."Threads $tccellh"."Posts $tccellh"."Last post"; while ($category=mysqli_fetch_assoc($categories)) { $forumcount=0; //$i=0; if ($category['id']>0) { $forumlist.=""; } $nesticle=mysqli_query($con,"SELECT * FROM forums WHERE catid = $category[id] ORDER BY 'order' DESC"); $forumlist.=""; while($row = mysqli_fetch_array($nesticle)) { if ($row['catid']==$category['id']) { $new=""; /* if ($forumlastpost1['$i']>$postread['$loguserid']['$i'] and $forumpostcount['$i']>0 and $logpassword!="") { $new=""; } */ $numthreads=mysqli_num_rows(mysqli_query($con,"SELECT forum FROM threads WHERE forum = $row[id]")); $numposts=mysqli_num_rows(mysqli_query($con,"SELECT threads.forum,threads.id,posts.thread FROM threads INNER JOIN posts ON threads.id=posts.thread WHERE forum=$row[id]")); $luser=mysqli_fetch_array(mysqli_query($con,"SELECT threads.forum,posts.id,posts.date,users.id,users.name FROM threads INNER JOIN posts ON threads.id=posts.thread AND threads.forum=$row[id] INNER JOIN users ON posts.user=users.id ORDER BY date DESC")); $forumlist.="$tccell1$new"; $forumlist.="$tccell2"."$row[title]
"; $forumlist.="$smallfont$row[description]"; $forumlist.="$tccell1$numthreads$tccell1$numposts"; if ($luser['id']) { $forumlist.="$tccell2w".date("m-d-y h:i A",$luser['date']+$tzoff)."
$smallfont by $luser[name]"; } else { $forumlist.="$tccell2w"."-------- --:-- --"; } } } } print "$forumlist
$fonttag"."$category[name]
"; print "$footer
"; rendertime(); ?>