query("SELECT name FROM $table_forums WHERE fid='$gid' AND type='group'"); $cat = $db->fetch_array($query); $navigation ="» $cat[name]"; $lang_stats4 = ""; } eval("\$header = \"".template("header")."\";"); echo $header; if(!$gid) { if($xmbuser) { eval("\$welcome = \"".template("index_welcome_member")."\";"); } else { eval("\$welcome = \"".template("index_welcome_guest")."\";"); } // Start Whos Online and Stats $query = $db->query("SELECT username FROM $table_members ORDER BY regdate DESC"); $lastmem = $db->fetch_array($query); $lastmember = $lastmem[username]; $members = $db->num_rows($query); $query = $db->query("SELECT COUNT(*) FROM $table_threads"); $threads = $db->result($query, 0); $query = $db->query("SELECT COUNT(*) FROM $table_posts"); $posts = $db->result($query, 0); $memhtml = "$lastmember."; eval($lang_evalindexstats); if($members == "0") { $memhtml = "$lang_textnoone"; } if($whosonlinestatus == "on") { $time = time(); $newtime = $time - 600; $membercount = 0; $query = $db->query("SELECT w.*, m.status, m.username FROM $table_whosonline w LEFT JOIN $table_members m ON m.username=w.username ORDER BY w.username"); while($online = $db->fetch_array($query)) { switch($online[username]) { case xguest123: $guestcount++; break; default: $member[$membercount] = $online; $membercount++; break; } } if(!$guestcount) { $guestcount = "0"; } if(!$membercount) { $membercount = "0"; } $onlinenum = $guestcount + $membercount; if($membercount==0){ $membern = "no Members"; }elseif($membercount==1){ $membern = "1 Member"; $ia = "are"; }else{ $membern = "$membercount Members"; } if($guestcount==0){ $guestn = "No Guests"; }elseif($guestcount==1){ $guestn = "1 Guest"; }else{ $guestn = "$guestcount Guests"; } eval($lang_whosoneval); $memonmsg = "$lang_whosonmsg"; $memtally = ""; $num = 1; $comma = ""; for($mnum=0; $mnum<$membercount; $mnum++) { $online = $member[$mnum]; if($online[status] == "Administrator") { $pre = ""; $suf = ""; } elseif($online[status] == "Super Moderator") { $pre = ""; $suf = ""; } elseif($online[status] == "Moderator") { $pre = ""; $suf = ""; } else { $pre = ""; $suf = ""; } $memtally .= "$comma $pre$online[username]$suf"; $comma = ", "; $num++; } if($memtally == "") { $memtally = " "; } eval("\$whosonline = \"".template("index_whosonline")."\";"); } // End Whosonline and Stats // Start Getting Forums and Groups $queryg = $db->query("SELECT * FROM $table_forums WHERE status='on' AND fup='' OR fup='0' ORDER BY displayorder"); } else { $queryg = $db->query("SELECT * FROM $table_forums WHERE type='group' AND fid='$gid' AND status='on' ORDER BY displayorder"); } while($group = $db->fetch_array($queryg)) { if($group[type] == "group") { eval("\$forumlist .= \"".template("index_category")."\";"); if($catsonly != "on" || $gid) { $query = $db->query("SELECT * FROM $table_forums WHERE type='forum' AND status='on' AND fup='$group[fid]' ORDER BY displayorder"); while($forum = $db->fetch_array($query)) { $forumlist .= forum($forum, "index_forum"); } } } else { $forumlist .= forum($group, "index_forum"); } } eval("\$index = \"".template("index")."\";"); echo $index; $mtime2 = explode(" ", microtime()); $endtime = $mtime2[1] + $mtime2[0]; $totaltime = ($endtime - $starttime); $totaltime = number_format($totaltime, 7); eval("\$footer = \"".template("footer")."\";"); echo $footer; ?>