/*
* Copyright (c) 2002, Tomas Stucinskas a.k.a Baboon
* All rights reserved.
*
* Redistribution and use with or without modification, are
* permitted provided that the following conditions are met:
*
* Redistributions must retain the above copyright notice.
* File readme.htm must not be removed from the package.
*
* Module name : index.php
* Author : Tomas Stucinskas a.k.a Baboon
* E-mail : baboon@ai-hq.com
*/
// HTTP compression
@ob_start("ob_gzhandler");
require "getvars.php";
require "config.php";
require "functions.php";
include "phemplate.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$tables = array("games", "imported", "maps", "medals", "modules", "ranks", "scores", "servers", "squads", "stats", "monthly");
foreach($tables as $name) {
${$name."_table"} = $tablepre."_".$name;
}
mysql_pconnect($dbhost, $dbusername, $dbuserpw) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
if(!isset($action) || $action == "") $action = "start";
$module_query = mysql_query("SELECT * FROM $modules_table WHERE action='$action'") or die(mysql_error());
if(mysql_num_rows($module_query) > 0) {
$module = mysql_fetch_array($module_query);
eval($module[code]);
} else {
$navigation = "Error";
$content = "The module does not exist";
}
// for monthly stats
$msbs = "";
if ($bms == 1) {
$msbs = 1;
$qs = str_replace("&bms=1", "", $QUERY_STRING);
$mobs = 'Overall Stats';
}else {
$qs = str_replace("&bms=", "", $QUERY_STRING);
$mobs = 'Monthly Stats';
}
header("Content-Type: text/html; charset=" . $charset);
$tpl = new phemplate();
$tpl->set_file("template", "templates/main.htm");
$tpl->set_var("msbs", $msbs);
$tpl->set_var("mobs", $mobs);
$tpl->set_var("charset", $charset);
$tpl->set_var("navigation", $navigation);
$tpl->set_var("website_title", $website_title);
$tpl->set_var("squad_name", $squad_name);
$tpl->set_var("squad_website", $squad_website);
$tpl->set_var("content", $content);
echo $tpl->process("", "template", 1);
?>