include("includes/db.php");
define("IN_BGS", true);
include("includes/functions.php");
setcookie("Guest","Yes","0","/","");
session_cache_expire(360);
session_start();
#putenv("TZ=Europe/London");
putenv("TZ=Australia/Melbourne");
$time = time();
//dynamicly check everything!
include("includes/cookielogin.php");
if(isset($_SESSION["user"]["name"])) {
$q = mysql_fetch_array(mysql_query("SELECT * from `users` where username='".$_SESSION["user"]["name"]."'"));
if($q["username"] != $_SESSION["user"]["name"] || $q["level"] != $_SESSION["user"]["level"] || $q["password"] != $_SESSION["user"]["password"]){
header("Location: pages/logout.php");
}
}
//check for IP ban
$QB = mysql_query("SELECT * from `tools` where tool='Ban'");
$banned = false;
while($check = mysql_fetch_array($QB)){
if($check["name"] == $_SESSION["user"]["name"]){
$banned = true;
}
if($check["ip"] == Getip()){
$banned = true;
}
}
if($banned == true){
include("403.php");
exit;
}
$lobbyIP = gethostbyname("se.au.escapeirc.net");
//$lobbyIP = "80.2.46.205";
$myname = $_SESSION["user"]["name"];
$mylevel = $_SESSION["user"]["level"];
$mycommittee = $_SESSION["committee"]["name"];
if ($_COOKIE["Guest"] != "Yes") {
$count_my_page = "hits.txt";
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
$total = $hits[0];
} else {
$count_my_page = "hits.txt";
$hits = file($count_my_page);
$total = $hits[0];
}
if(strpos($_SERVER["HTTP_REFERER"],"beyondgaming.org") === false && trim($_SERVER["HTTP_REFERER"]) != ""){
$ip = Getip();
$host = gethostbyaddr(Getip());
mysql_query("INSERT INTO `refferers` value('".date("d/M/Y g:i:sA", $time)." ($ip $host) => ".$_SERVER['HTTP_REFERER']."')");
}
$GetConfig = @mysql_query("SELECT * from `site_config`");
if(@mysql_num_rows($GetConfig) > 0){
while($Row = @mysql_fetch_array($GetConfig)){
if(is_numeric($Row["site_value"])) {
$config[striplashes($Row["site_option"])] = NumToBool($Row["site_value"]);
} else {
$config[striplashes($Row["site_option"])] = striplashes($Row["site_value"]);
}
}
//nick changing
if ($mylevel >= 0){
if ($mylevel == 7){
$token = "~";
} elseif ($mylevel == 6){
$token = "%";
} elseif($mylevel == 5){
$token = "&";
}
if($mylevel > 4){
$myname = $token.$myname;
} else {
$myname = $_SESSION["committee"]["token"].$myname;
}
}
?>
|
|
|
|
|
|
|
|
|
Server Time: =date("g:i:s A");?> |
|
if($config['Announcement'] == TRUE){
$aquery = mysql_query("SELECT * from announcements ");
$msg = mysql_fetch_array($aquery);
$msg = $msg['message'];
print "";
}
?>
|
|
|
if($mylevel > 4){
print "";
}
?>
|
|
if($myname != ""){
print "
";
}?>
|
|
$news = mysql_query("SELECT * from news order by news_id DESC LIMIT 5");
$i = 1;
while($newsR = mysql_fetch_array($news)) {
if($i % 2 = 0) { //multipule of 2 i think =/
print "";
} else {
print " ";
}
print " | "
print "";
print " | "
}
?>
|
|
|
|
|
| |
$qstring = explode("&",$_SERVER["QUERY_STRING"]);
$otherqstring = $_SERVER["QUERY_STRING"];
$num = count($qstring) - 1;
if(is_array($qstring)){
for($i=0;$i<=$num;$i++){
$data = $qstring[$i];
if($i > 0){
$data1 = explode("=",$data);
$savestring .= $qstring[$i - 1]."&";
print "".ucfirst(str_replace("_", " ", str_replace("%20", " ", $data1[1])))." / ";
} else {
$savestring .= $qstring[$i - 1];
$data1 = explode("=",$data);
print "".ucfirst(str_replace("_", " ", str_replace("%20", " ", $data1[1])))." / ";
}
}
}
#print "The Beyond Gaming lobby server is down for maintainance.
";
?>
|
|
|
if($config["Site_Open"] || ($_SESSION["user"]["level"] > 4 && !$config["Site_Open"]) || $_GET["page"] == "login"){
switch($_GET["page"]){
case "admin";
include("pages/admin.php");
break;
case "applications";
include("pages/applications.php");
break;
case "contact_us";
include("pages/contact.php");
break;
case "downloads";
include("pages/downloads.php");
break;
case "links";
include("pages/links.php");
break;
case "login";
include("pages/login.php");
break;
case "register";
include("pages/register.php");
break;
case "home";
include("pages/comingsoon.php");
break;
case "games";
include("pages/games.php");
break;
case "logout";
include("pages/logout.php");
break;
case "news";
include("pages/news.php");
break;
case "user";
include("pages/user.php");
break;
case "tos";
include("pages/tos.php");
break;
case "support";
include("pages/support.php");
break;
case '';
include("pages/comingsoon.php");
break;
default;
?>
break;
}
} else {
print "The site is currently closed. Please come back another time.";
}
?>
|
|