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 amisport_users 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 amisport_users m ON m.username=w.username WHERE w.username = m.username ORDER BY w.username"); while($online = $db->fetch_array($query)) { $member[$membercount] = $online; $membercount++; } $onlinenum = $db->result($db->query("SELECT count(username) FROM $table_whosonline"), 0); $guestcount = $onlinenum - $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] == "Webmaster") { $pre = ""; $suf = ""; } elseif($online[status] == "Moderator") { $pre = ""; $suf = ""; } else { $pre = ""; $suf = ""; } if($online[status]) { $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"); } } // MOST EVER ONLINE and COUNTER HACK //********************************************************************************************************************************** $onlinequery = $db->query("SELECT * FROM $table_settings"); $settings = $db->fetch_array($onlinequery); $mostonline = $settings[mostonline]; $mostdate = date("$dateformat", $mostonlinetime + ($timeoffset * 1)); $mosttime = date("$timecode", $mostonlinetime + ($timeoffset * 1)); $mostonlinetime = "$mostdate um $mosttime"; if($onlinenum > $mostonline) { $thetime = time(); $db->query("UPDATE $table_settings SET mostonline='$onlinenum', mostonlinetime='$thetime'"); } $mostonlinetext = " $mostonline User waren am $mostonlinetime online. $lang_count $CurrentCount "; //********************************************************************************************************************************** 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; ?>