$currentconfignumber = 1;
    // Was a config set in the url?
    if (isset($_GET['config'])) {
        $currentconfignumber = escape_string($_GET['config']);
        $currentconfig = "config/statsconfig" . $currentconfignumber . ".php";
        $_SESSION['currentconfignumber'] = $currentconfignumber;
    }
    if (isset($_SESSION['currentconfignumber'])) {
        $currentconfignumber = $_SESSION['currentconfignumber'];
        $currentconfig = "config/statsconfig" . $currentconfignumber . ".php";
    }
    // double check config number found point to an existing config file or fallback to config 1
    if (!file_exists($currentconfig)) {
        $currentconfig = "config/statsconfig1.php";
        $currentconfignumber = 1;
    }
}
include $currentconfig;
//------------------------------------------------------------------------------
$coddb = new sql_db($db_host, $db_user, $db_pass, $db_db, false);
if (!$coddb->db_connect_id) {
    die($text["cantconnectdb"]);
}
//------------------------------------------------------------------------------
// fetch the func variable, which tells us what we need to do
$func = escape_string($_GET['func']);
if ($func == "") {
    $func = "skill";
}
topplayersblock($sortby = $func);
Exemple #2
0
        $currentconfignumber = escape_string($_GET['config']);
        $currentconfig = "config/statsconfig" . $currentconfignumber . ".php";
        $_SESSION['currentconfignumber'] = $currentconfignumber;
    }
    if (isset($_SESSION['currentconfignumber'])) {
        $currentconfignumber = $_SESSION['currentconfignumber'];
        $currentconfig = "config/statsconfig" . $currentconfignumber . ".php";
    }
    // double check config number found point to an existing config file or fallback to config 1
    if (!file_exists($currentconfig)) {
        $currentconfig = "config/statsconfig1.php";
        $currentconfignumber = 1;
    }
}
include $currentconfig;
//------------------------------------------------------------------------------
$coddb = new sql_db($db_host, $db_user, $db_pass, $db_db, false);
if (!$coddb->db_connect_id) {
    die($text["cantconnectdb"]);
}
//------------------------------------------------------------------------------
// fetch the func variable, which tells us what we need to do
$func = escape_string($_GET['func']);
$func = $_GET['func'];
if ($func == "") {
    $func = "skill";
}
// Show the block
if ($func == "skill") {
    topplayersblock();
}