Ejemplo n.º 1
0
<?php

echo "<table border='0' cellpadding='0' cellspacing='10' width='100%'>" . "<tr><td width='30%'>" . _SERVERNAME . "</td><td width='40%'>" . GetArrVal($data[$GSgame]['hostname']) . "</td>" . "<td rowspan='18' valign='top' width='230'>" . "<table><tr><td colspan=4>" . MapPic($data[$GSgame]['custom']['id'], $data[$GSgame]['mapname'], 0, "") . "</td></tr><tr><td>";
if (GetArrVal($data[$GSgame]['numplayers']) != 0) {
    $cols[0] = array(_PLAYERNAME, _PING, _FRAGS, _TEAM);
    for ($p = 0; $p <= $data[$GSgame]['numplayers']; $p++) {
        if (GetArrVal($data[$GSgame]['players'][$p]['player'] != '')) {
            $cols[$p + 1][0] = GetArrVal($data[$GSgame]['players'][$p]['player']);
            $cols[$p + 1][1] = GetArrVal($data[$GSgame]['players'][$p]['ping']);
            $cols[$p + 1][2] = GetArrVal($data[$GSgame]['players'][$p]['frags']);
            $cols[$p + 1][3] = GetArrVal($data[$GSgame]['players'][$p]['team']);
        }
    }
    echo PlayerList($cols);
}
echo "</td></tr></table></td></tr>" . "<tr><td>" . _SVERSION . "</td><td>" . GetArrVal($data[$GSgame]['gamever']) . "</td></tr>" . "<tr><td>" . _PING . "</td><td>" . $ping . "</td></tr>" . "<tr><td>" . _HOSTADDRESS . "</td><td>" . $data[$GSgame]['custom']['address'] . ":" . GetArrVal($data[$GSgame]['hostport']) . "</td></tr>" . "<tr><td>" . _MAPNAME . "</td><td>";
if (GetArrVal($data[$GSgame]['maptitle']) != "Untitled") {
    echo GetArrVal($data[$GSgame]['maptitle']);
} else {
    echo GetArrVal($data[$GSgame]['mapname']);
}
echo "</td></tr>" . "<tr><td>" . _GAMETYPE . "</td><td>" . GetArrVal($data[$GSgame]['gametype']) . "</td></tr>" . "<tr><td>" . _PLAYERS . "</td><td>" . GetArrVal($data[$GSgame]['numplayers']) . "/" . GetArrVal($data[$GSgame]['maxplayers']) . "</td></tr>" . "<tr><td>" . _PASSWORD . "</td><td>";
if (GetArrVal($data[$GSgame]['password']) == 'False') {
    echo _PASSREQN;
} else {
    echo _PASSREQY;
}
echo "</td></tr>" . "<tr><td>" . _TIMELIMIT . "</td><td>";
if (GetArrVal($data[$GSgame]['TimeToWin']) == '0') {
    echo _NONE;
} else {
Ejemplo n.º 2
0
<?php

//this should filter out the odd characters out of playernames
//they are probably for color codes like quake3 but i couldn't find any documentation on them
$junk = array("", "", "", "", "", "", "", "", "�", "", "", "", "", "", "", "", "");
$host = str_replace($junk, "", $data[$GSgame]['hostname']);
echo "<LINK REL=\"StyleSheet\" HREF=\"modules/" . $module_name . "/q3col.css\" TYPE=\"text/css\">" . "<table border='0' cellpadding='0' cellspacing='10' width='100%'>" . "<tr><td width='20%'>" . _SERVERNAME . "</td><td width='40%'>" . $host . "</td><td width='40%' valign='top' rowspan='20'>" . "<table><tr><td colspan=3>" . MapPic($data[$GSgame]['custom']['id'], $data[$GSgame]['mapname'], 0, "") . "</td></tr><tr><td>";
if (GetArrVal($data[$GSgame]['num_players']) != 0) {
    $cols[0] = array(_PLAYERNAME, _SCORE, _PING);
    for ($p = 0; $p <= GetArrVal($data[$GSgame]['num_players']) - 1; $p++) {
        $cols[$p + 1][0] = str_replace($junk, "", $data[$GSgame]['players'][$p]['name']);
        $cols[$p + 1][1] = GetArrVal($data[$GSgame]['players'][$p]['score']);
        $cols[$p + 1][2] = GetArrVal($data[$GSgame]['players'][$p]['ping']);
    }
    echo PlayerList($cols);
}
echo "</td></tr></table></td></tr>" . "<tr><td>" . _HOSTADDRESS . "</td><td>" . $data[$GSgame]['custom']['address'] . ":" . $data[$GSgame]['custom']['query_port'] . "&nbsp;" . ASElink($data[$GSgame]['custom'], "SOF") . "</td></tr>" . "<tr><td>" . _MAPNAME . "</td><td>" . $data[$GSgame]['mapname'] . "</td></tr>";
if (isset($data[$GSgame]['gameversion'])) {
    echo "<tr><td>" . _SVERSION . "</td><td>" . $data[$GSgame]['gameversion'] . "</td></tr>";
}
echo "<tr><td>" . _PING . "</td><td>" . $ping . "</td></tr>";
echo "<tr><td>" . _PLAYERS . "</td><td>" . $data[$GSgame]['num_players'] . "/" . $data[$GSgame]['maxclients'] . "</td></tr>";
if (isset($data[$GSgame]['timelimit'])) {
    echo "<tr><td>" . _TIMELIMIT . "</td><td>" . $data[$GSgame]['timelimit'] . "</td></tr>";
}
if (isset($data[$GSgame]['fraglimit'])) {
    echo "<tr><td>" . _FRAGLIMIT . "</td><td>" . $data[$GSgame]['fraglimit'] . "</td></tr>";
}
if (isset($data[$GSgame]['mp_pointlimit'])) {
    echo "<tr><td>" . _POINTLIMIT . "</td><td>" . $data[$GSgame]['mp_pointlimit'] . "</td></tr>";
}
Ejemplo n.º 3
0
<?php

echo "<table border='0' cellpadding='0' cellspacing='10' width='100%'>" . "<tr><td width='30%'>" . _GAMENAME . "</td><td width='70%'>" . $data[$GSgame]['custom']['name'] . "</td>" . "<td rowspan='18' valign='top' width='230'><table><tr><td colspan=5>" . MapPic($data[$GSgame]['custom']['id'], GetArrVal($data[$GSgame]['mapname']), 0, "") . "</td></tr><tr><td>\n";
$vp = 1;
$p = 0;
do {
    if ($data[$GSgame]['players']) {
        $cols[0] = array(_PLAYERNAME, _PING, _DEATHS, _SCORE, _TEAM);
        if (array_search_r(GetArrVal($data[$GSgame]['players'][$p]['playername']), $cols) == false and GetArrVal($data[$GSgame]['players'][$p]['playername']) != '') {
            $cols[$vp][0] = "<a href=\"http://www.bfstats.com/player.php?exactname=" . urlencode(GetArrVal($data[$GSgame]['players'][$p]['playername'])) . "\" target=\"_blank\">" . GetArrVal($data[$GSgame]['players'][$p]['playername']) . "</a>";
            $cols[$vp][1] = GetArrVal($data[$GSgame]['players'][$p]['ping']);
            $cols[$vp][2] = GetArrVal($data[$GSgame]['players'][$p]['deaths']);
            $cols[$vp][3] = GetArrVal($data[$GSgame]['players'][$p]['score']);
            $cols[$vp][4] = GetArrVal($data[$GSgame]['players'][$p]['team']);
            $vp++;
        }
    }
    $p++;
} while ($p <= 64);
if (isset($cols[1][1])) {
    echo PlayerList($cols);
    $vp--;
} else {
    $vp = 0;
}
echo "</td></tr></table></td></tr>" . "<tr><td>" . _SERVERNAME . "</td><td>" . GetArrVal($data[$GSgame]['hostname']) . "</td></tr>" . "<tr><td>" . _SERVERTYPE . "</td><td>";
if (GetArrVal($data[$GSgame]['dedicated']) == 0) {
    echo _NDEDICATED;
} else {
    echo _DEDICATED;
}
Ejemplo n.º 4
0
<?php

echo "<table border='0' cellpadding='0' cellspacing='10' width='100%'>" . "<tr><td width='20%' valign='top'>" . _GAMENAME . "</td><td width='40%' valign='top'>" . GetArrVal($data[$GSgame]['custom']['name']) . "</td><td width='40%' valign='top' rowspan='20'>" . "<table border=0 cellpadding=0 cellspacing=7><tr><td colspan=4>" . MapPic($data[$GSgame]['custom']['id'], $data[$GSgame]['mapname'], 0, "") . "</td></tr><tr><td>";
if (GetArrVal($data[$GSgame]['numplayers']) != 0) {
    $cols[0] = array(_PLAYERNAME, _TEAM, _PING);
    for ($p = 0; $p <= GetArrVal($data[$GSgame]['numplayers']) - 1; $p++) {
        $cols[$p + 1][0] = GetArrVal($data[$GSgame]['players'][$p]['player']);
        $cols[$p + 1][1] = GetArrVal($data[$GSgame]['players'][$p]['team']);
        $cols[$p + 1][2] = GetArrVal($data[$GSgame]['players'][$p]['ping']);
    }
    echo PlayerList($cols);
}
echo "</td></tr></table></td></tr>" . "<tr><td>" . _SERVERNAME . "</td><td>" . GetArrVal($data[$GSgame]['hostname']) . "</td></tr>" . "<tr><td>" . _HOSTADDRESS . "</td><td>" . $data[$GSgame]['custom']['address'] . ":" . $data[$GSgame]['custom']['query_port'] . "&nbsp;" . ASElink($data[$GSgame]['custom'], "RS") . "</td></tr>";
if (isset($data[$GSgame]['gamever'])) {
    echo "<tr><td>" . _SVERSION . "</td><td>" . GetArrVal($data[$GSgame]['gamever']) . "</td></tr>";
}
echo "<tr><td>" . _PING . "</td><td>" . $ping . "</td></tr>";
echo "<tr><td>" . _MAPNAME . "</td><td>" . GetArrVal($data[$GSgame]['mapname']) . "</td></tr>";
echo "<tr><td>" . _GAMETYPE . "</td><td>" . GetArrVal($data[$GSgame]['gametype']) . "</td></tr>" . "<tr><td>" . _PLAYERS . "</td><td>" . GetArrVal($data[$GSgame]['numplayers']) . "/" . GetArrVal($data[$GSgame]['maxplayers']) . "</td></tr>";
if (isset($data[$GSgame]['password'])) {
    echo "<tr><td>" . _PASSWORD . "</td><td>";
    if (GetArrVal($data[$GSgame]['password']) != 1) {
        echo _PASSREQN;
    } else {
        echo _PASSREQY;
    }
}
if (isset($data[$GSgame]['timelimit'])) {
    echo "<tr><td>" . _TIMELIMIT . "</td><td>" . GetArrVal($data[$GSgame]['timelimit']) . "</td></tr>";
}
if (isset($data[$GSgame]['teamplay'])) {
Ejemplo n.º 5
0
<?php

echo "<table border='0' cellpadding='0' cellspacing='10' width='100%'>" . "<tr><td width='30%'>" . _SERVERNAME . "</td><td width='40%'>" . Q3colors($data[$GSgame]['sv_hostname'], $GSTags) . "</td><td width='40%' valign='top' rowspan='15'>" . "<table><tr><td colspan=3>" . MapPic($data[$GSgame]['custom']['id'], $data[$GSgame]['mapname'], 0, "") . "</td></tr><tr><td>";
if (GetArrVal($data[$GSgame]['num_players']) != 0) {
    $cols[0] = array(_PLAYERNAME, _SCORE, _PING);
    for ($p = 0; $p <= GetArrVal($data[$GSgame]['num_players']) - 1; $p++) {
        $cols[$p + 1][0] = Q3colors($data[$GSgame]['players'][$p]['name'], $GSTags);
        $cols[$p + 1][1] = GetArrVal($data[$GSgame]['players'][$p]['score']);
        $cols[$p + 1][2] = GetArrVal($data[$GSgame]['players'][$p]['ping']);
    }
    echo PlayerList($cols);
}
echo "</td></tr></table>";
echo "</td></tr>" . "<tr><td>" . _HOSTADDRESS . "</td><td>" . $data[$GSgame]['custom']['address'] . ":" . $data[$GSgame]['custom']['query_port'] . "&nbsp;" . ASElink($data[$GSgame]['custom'], "Q3") . "</td></tr>" . "<tr><td>" . _SERVERTYPE . "</td><td>";
echo " ";
if (strstr(GetArrVal($data[$GSgame]['version']), 'win')) {
    echo _WINDOWS;
} elseif (strstr(GetArrVal($data[$GSgame]['version']), 'lin')) {
    echo _LINUX;
} else {
    echo _UNKNOWN;
}
echo "<tr><td>" . _MAPNAME . "</td><td>" . GetArrVal($data[$GSgame]['mapname']) . "</td></tr>";
if (isset($data[$GSgame]['gameversion'])) {
    echo "<tr><td>" . _SVERSION . "</td><td>" . GetArrVal($data[$GSgame]['gameversion']) . "</td></tr>";
}
echo "<tr><td>" . _PING . "</td><td>" . $ping . "</td></tr>";
echo "<tr><td>" . _GAMETYPE . "</td><td>" . GetArrVal($data[$GSgame]['g_gametype']) . "</td></tr>" . "<tr><td>" . _PLAYERS . "</td><td>" . GetArrVal($data[$GSgame]['num_players']) . "/" . GetArrVal($data[$GSgame]['sv_maxclients']) . "</td></tr>";
if (isset($data[$GSgame]['g_needpass'])) {
    echo "<tr><td>" . _PASSWORD . "</td><td>";
    if (GetArrVal($data[$GSgame]['g_needpass'])) {
Ejemplo n.º 6
0
<?php

echo "<LINK REL=\"StyleSheet\" HREF=\"modules/" . $module_name . "/Ucol.css\" TYPE=\"text/css\">" . "<table border='0' cellpadding='0' cellspacing='10' width='100%'>" . "<tr><td width='30%'>" . _SERVERNAME . "</td><td width='40%'>" . GetArrVal($data[$GSgame]['hostname']) . "</td>" . "<td rowspan='18' valign='top' width='230'><td width='30%' valign='top' rowspan='18'><table><tr><td colspan=4>";
MapPic($data[$GSgame]['custom']['id'], $data[$GSgame]['map'], 0, "");
echo "</td></tr><tr><td>";
if (GetArrVal($data[$GSgame]['num_players']) != 0) {
    $cols[0] = array(_PLAYERNAME, _TEAM, _SCORE, _CLASS, _PING, _ARTIFACT);
    for ($p = 0; $p <= $data[$GSgame]['num_players']; $p++) {
        if (GetArrVal($data[$GSgame]['players'][$p]['name'] != '')) {
            $cols[$p + 1][0] = GetArrVal($data[$GSgame]['players'][$p]['name']);
            $cols[$p + 1][1] = GetArrVal($data[$GSgame]['players'][$p]['team']);
            $cols[$p + 1][2] = GetArrVal($data[$GSgame]['players'][$p]['score']);
            $cols[$p + 1][3] = GetArrVal($data[$GSgame]['players'][$p]['class']);
            $cols[$p + 1][4] = GetArrVal($data[$GSgame]['players'][$p]['ping']);
            if (GetArrVal($data[$GSgame]['players'][$p]['artifact']) != 'false') {
                $cols[$p + 1][5] = _YES;
            }
        }
    }
    echo PlayerList($cols);
}
echo "</td></tr></table></td></tr>" . "<tr><td>" . _SERVERTYPE . "</td><td>";
if (GetArrVal($data[$GSgame]['servermode']) == 'dedicated') {
    echo _DEDICATED;
} else {
    echo _NDEDICATED;
}
echo "<tr><td>" . _SVERSION . "</td><td>" . GetArrVal($data[$GSgame]['ServerVersion']) . "</td></tr>" . "<tr><td>" . _PING . "</td><td>" . $ping . "</td></tr>" . "<tr><td>" . _HOSTADDRESS . "</td><td>" . $data[$GSgame]['custom']['address'] . ":" . GetArrVal($data[$GSgame]['port']) . "</td></tr>";
echo "<tr><td>" . _STATS . "</td><td>" . Abled($data[$GSgame]['gamestats'] == 'true') . "</td></tr>";
echo "<tr><td>" . _MAPNAME . "</td><td>" . GetArrVal($data[$GSgame]['map']) . "</td></tr>" . "<tr><td>" . _GAMETYPE . "</td><td>" . GetArrVal($data[$GSgame]['game_type']) . "</td></tr>" . "<tr><td>" . _PLAYERS . "</td><td>" . GetArrVal($data[$GSgame]['num_players']) . "/" . GetArrVal($data[$GSgame]['max_players']) . "</td></tr>";
if (isset($data[$GSgame]['autobalance'])) {
Ejemplo n.º 7
0
<?php

echo "<table border='0' cellpadding='0' cellspacing='10' width='100%'>" . "<tr><td width='30%'>" . _HOSTADDRESS . "</td><td width='40%'>" . $data[$GSgame]['custom']['address'] . ":" . $data[$GSgame]['custom']['query_port'] . "</td><td width='40%' valign='top' rowspan='15'>" . MapPic($data[$GSgame]['custom']['id'], $data[$GSgame]['mapname'], 0, "") . "</td></tr>" . "<tr><td>" . _PING . "</td><td>" . $ping . "</td></tr>" . "<tr><td>" . _MAPNAME . "</td><td>" . GetArrVal($data[$GSgame]['mapname']) . "</td></tr>";
if (isset($data[$GSgame]['DED'])) {
    echo "<tr><td>" . _FF . "</td><td>" . Abled($data[$GSgame]['dm_friendly_fire']) . "</td></tr>";
}
if (isset($data[$GSgame]['dm_teamplay'])) {
    echo "<tr><td>" . _TEAMPLAY . "</td><td>" . Abled($data[$GSgame]['dm_teamplay']) . "</td></tr>";
}
if (isset($data[$GSgame]['dm_instagib'])) {
    echo "<tr><td>" . _INSTAGIB . "</td><td>" . Abled($data[$GSgame]['dm_instagib']) . "</td></tr>";
}
echo "<tr><td>" . _PLAYERS . "</td><td>" . GetArrVal($data[$GSgame]['num_players']) . "/?</td></tr>";
if (isset($data[$GSgame]['dm_infinite_ammo'])) {
    echo "<tr><td>" . _INFAMMO . "</td><td>" . Abled($data[$GSgame]['dm_infinite_ammo']) . "</td></tr>";
}
if (isset($data[$GSgame]['dm_allow_powerups'])) {
    echo "<tr><td>" . _POWERUPS . "</td><td>" . Abled($data[$GSgame]['dm_allow_powerups']) . "</td></tr>";
}
if (isset($data[$GSgame]['dm_allow_health'])) {
    echo "<tr><td>" . _HEALTH . "</td><td>" . Abled($data[$GSgame]['dm_allow_health']) . "</td></tr>";
}
echo "<tr><td align=\"center\" colspan=\"2\"><a href=\"http://www.planetdaikatana.com/\" target=\"_blank\"><img border=\"0\" src=\"modules/" . $module_name . "/output_templates/" . $data[$GSgame]['custom']['id'] . "/logo.jpg\"></a></td></tr></table>";
Ejemplo n.º 8
0
<?php

echo "<table border='0' cellpadding='0' cellspacing='10' width='100%'>" . "<tr><td width='20%' valign='top'>" . _SERVERNAME . "</td><td width='40%' valign='top'>" . GetArrVal($data[$GSgame]['hostname']) . "</td><td width='40%' valign='top' rowspan='12'>" . "<table><tr><td colspan=3>" . MapPic($data[$GSgame]['custom']['id'], GetArrVal($data[$GSgame]['mapname']), 0, "") . "</td></tr><tr><td>" . _HOSTEDBY . " " . GetArrVal($data[$GSgame]['hostnick']) . "</td></tr></table></td></tr>" . "<tr><td>" . _HOSTADDRESS . "</td><td>" . GetArrVal($data[$GSgame]['custom']['address']) . ":" . GetArrVal($data[$GSgame]['hostport']) . "</td></tr>" . "<tr><td>" . _PING . "</td><td>" . $ping . "</td></tr>" . "<tr><td>" . _SVERSION . "</td><td>" . GetArrVal($data[$GSgame]['gamever']) . "</td></tr>" . "<tr><td>" . _MAPNAME . "</td><td>" . GetArrVal($data[$GSgame]['mapname']) . "</td></tr>" . "<tr><td>" . _GAMETYPE . "</td><td>" . GetArrVal($data[$GSgame]['gametype']) . "</td></tr>" . "<tr><td>" . _TEAMSTYLE . "</td><td>" . GetArrVal($data[$GSgame]['team_style']) . "</td></tr>" . "<tr><td>" . _MAPSTYLE . "</td><td>" . GetArrVal($data[$GSgame]['map_style']) . "</td></tr>" . "<tr><td>" . _MAPSIZE . "</td><td>" . GetArrVal($data[$GSgame]['map_size']) . "</td></tr>" . "<tr><td>" . _CANNONTIME . "</td><td>" . GetArrVal($data[$GSgame]['cannon_times']) . "</td></tr>" . "<tr><td>" . _TOURNAMENT . "</td><td>" . GetArrVal($data[$GSgame]['tournament_play']) . "</td></tr>" . "<tr><td>" . _BALTEAMS . "</td><td>" . GetArrVal($data[$GSgame]['require_random_teams']) . "</td></tr>" . "<tr><td>" . _GAMESPEED . "</td><td>" . GetArrVal($data[$GSgame]['game_speed']) . "</td></tr>" . "<tr><td>" . _MAPSIZE . "</td><td>" . GetArrVal($data[$GSgame]['hostnick']) . "</td></tr>" . "<tr><td>" . _PLAYERS . "</td><td>" . GetArrVal($data[$GSgame]['numplayers']) . "/" . GetArrVal($data[$GSgame]['maxplayers']) . "</td></tr>" . "<tr><td colspan='2' align='center'><a href=\"http://www.microsoft.com/games/riseofnations/\" target=\"_blank\"><img border='0' src='modules/" . $module_name . "/output_templates/" . GetArrVal($data[$GSgame]['custom']['id']) . "/logo.jpg' alt='" . GetArrVal($data[$GSgame]['custom']['id']) . "'></a></td></tr></table>";
Ejemplo n.º 9
0
    case "Bridge Crossing SE":
        $map = "map_bridgese";
        break;
    case "Mountain Pass":
        $map = "map_mountain";
        break;
    case "Mountain Pass SE":
        $map = "map_mountainse";
        break;
    case "McKenna MOUT":
        $map = "map_mckenna";
        break;
    default:
        $map = "missions";
}
echo MapPic($data[$GSgame]['custom']['id'], $data[$GSgame]['mapname'], "http://www.americasarmy.com/intel/" . $map . ".php", "");
echo "</td></tr><tr><td>";
if (GetArrVal($data[$GSgame]['numplayers']) != 0) {
    $cols[0][0] = _PLAYERNAME;
    if (isset($data[$GSgame]['players'][0]['enemy'])) {
        $cols[0][1] = _ENEMY;
    }
    if (isset($data[$GSgame]['players'][0]['kia'])) {
        $cols[0][2] = _KIA;
    }
    if (isset($data[$GSgame]['players'][0]['roe'])) {
        $cols[0][3] = _ROE;
    }
    if (isset($data[$GSgame]['players'][0]['honor'])) {
        $cols[0][4] = _HONOR;
    }
Ejemplo n.º 10
0
function DisplayServers()
{
    global $prefix, $db, $module_name, $querydone, $GSdownloads, $GScachetime, $GSbcachetime, $GSdebug, $GSremotepath, $GSremote, $GScode, $GSlistname, $GSblistname, $GSTags, $GSfailtime, $GSfailcount, $GSemail, $GSblisttype, $GSlistchg;
    if ($_GET['do'] == "block") {
        //reset in block parameters
        $GSlistname = $GSblistname;
        $GScachetime = $GSbcachetime;
        $_GET['GSlisttype'] = $GSblisttype;
    } else {
        require_once "header.php";
        if ($GSlistchg != 0) {
            echo "<br />";
            OpenTable();
            echo "<center>";
            echo "|&nbsp;" . _BLOCKS . " ";
            echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=block2") . "\">2</a>/";
            echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=block3") . "\">3</a>/";
            echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=block4") . "\">4</a>";
            if ($GSlistchg == 2) {
                echo " | " . _BLOCKSW . " ";
                echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=block2M") . "\">2</a>/";
                echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=block3M") . "\">3</a>/";
                echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=block4M") . "\">4</a> | ";
                if ($_GET['GSlisttype'] == 'alist' or $_GET['GSlisttype'] == 'list') {
                    echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=ailist") . "\">" . _GSALIST . "</a>";
                } else {
                    echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=alist") . "\">" . _GSALIST . "</a>";
                }
            }
            echo " | ";
            if ($_GET['GSlisttype'] == 'alist' or $_GET['GSlisttype'] == 'list') {
                echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=ilist") . "\">" . _GSILIST . "</a> | ";
            } else {
                echo "<a href=\"" . getlink("GameServers&amp;GSlisttype=list") . "\">" . _GSSLIST . "</a> | ";
            }
            CloseTable();
            echo "<br /></center>";
        }
        OpenTable();
    }
    $time = time();
    $oldtime = $time - gmmktime(0, $GScachetime, 0, 1, 1, 1970, 0);
    //get servers info from db
    $sql = "SELECT longname, server_id, game, engine, ip, port FROM " . $prefix . "_gameservers WHERE active='1' ORDER BY `weight` ASC";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
        $GSid = $row[server_id];
        $server_id[$GSid] = $GSid;
        $GSlongname[$GSid] = $row[longname];
        $GSgame[$GSid] = $row[game];
        $GSengine[$GSid] = $row[engine];
        $GSip[$GSid] = $row[ip];
        $GSport[$GSid] = $row[port];
        $servers[$GSid] = array($GSengine[$GSid], $GSip[$GSid], $GSport[$GSid]);
        $sql2 = "SELECT server_id, sname, numplayers, maxplayers, map, ping, stamp FROM " . $prefix . "_gameservers_statcache WHERE server_id='" . $GSid . "' ORDER BY `stamp` ASC LIMIT 1";
        $result2 = $db->sql_query($sql2);
        $stats[$GSid] = $db->sql_fetchrow($result2);
        $eng[$GSid] = $servers[$GSid][0];
        if ($stats[$GSid][stamp] > 0 and $oldtime < $stats[$GSid][stamp]) {
            unset($servers[$GSid]);
        }
    }
    if ($GSid) {
        $serverpath .= $_SERVER['SERVER_NAME'];
        $serverpath .= substr($_SERVER['SCRIPT_NAME'], 0, strlen($_SERVER['SCRIPT_NAME']) - 11);
        if ($_GET['GSlisttype'] != "list" and $_GET['GSlisttype'] != "ilist") {
            $data = QueryServers($servers, $data, $serverstring);
        }
        // make vars
        do {
            $GSid = current($server_id);
            // make serverlink
            $serverlink[$GSid] = "<a href=\"" . getlink("&do=query&server_id=" . $GSid . "") . "\">";
            // find and assign icon if needed
            if ($_GET['GSlisttype'] == 'ilist' or $_GET['GSlisttype'] == 'ailist' or $_GET['GSlisttype'] == 'block2' or $_GET['GSlisttype'] == 'block3' or $_GET['GSlisttype'] == 'block4') {
                if (file_exists('modules/' . $module_name . '/images/' . $GSgame[$GSid] . '.gif')) {
                    $icon[$GSid] = $serverlink[$GSid] . "<img src='http://" . $serverpath . "modules/'.{$module_name}.'/images/" . $GSgame[$GSid] . ".gif' width='32' height='32' border='0'></a>";
                } elseif (file_exists('modules/' . $module_name . '/images/' . $GSengine[$GSid] . '.gif')) {
                    $icon[$GSid] = $serverlink[$GSid] . "<img src='http://" . $serverpath . "modules/'.{$module_name}.'/images/" . $GSengine[$GSid] . ".gif' width='32' height='32' border='0'></a>";
                } else {
                    $icon[$GSid] = $serverlink[$GSid] . "<img src='http://" . $serverpath . "modules/'.{$module_name}.'/images/noicon.gif' width='32' height='32' border='0'></a>";
                }
            }
            // generate servername
            if ($_GET['GSlisttype'] != "list" and $_GET['GSlisttype'] != "ilist") {
                if ($GSlistname == 1) {
                    if ($stats[$GSid]['sname']) {
                        $servername[$GSid] = $stats[$GSid]['sname'];
                    } else {
                        $servername[$GSid] = ServerName($servers, $GSid, $data);
                    }
                }
                if (!$servername[$GSid]) {
                    $servername[$GSid] = $GSlongname[$GSid];
                }
                if (isset($stats[$GSid]['numplayers']) and isset($stats[$GSid]['maxplayers'])) {
                    $players[$GSid] = $stats[$GSid]['numplayers'] . "/" . $stats[$GSid]['maxplayers'];
                } else {
                    $players[$GSid] = PlayerCount($servers, $GSid, $data);
                }
                if ($stats[$GSid]['map']) {
                    $map[$GSid] = $stats[$GSid]['map'];
                } else {
                    $map[$GSid] = CurrentMap($servers, $GSid, $data);
                }
                if (!$stats[$GSid]['map'] and $data[$GSid]['custom']['ping'] != 200) {
                    $ping[$GSid] = $data[$GSid]['custom']['ping'];
                } else {
                    $ping[$GSid] = $stats[$GSid]['ping'];
                }
            } else {
                $servername[$GSid] = $GSlongname[$GSid];
            }
            $mappic[$GSid] = MapPic($eng[$GSid], $map[$GSid], 0, " width=200 height=150");
        } while (next($server_id));
        // output data
        if (file_exists('modules/' . $module_name . '/list_templates/' . $_GET['GSlisttype'] . '.php')) {
            include 'modules/' . $module_name . '/list_templates/' . $_GET['GSlisttype'] . '.php';
        } else {
            include 'modules/' . $module_name . '/list_templates/ilist.php';
        }
        reset($server_id);
        GSheader();
        do {
            $GSid = current($server_id);
            GSserveritem($icon, $serverlink, $servername, $players, $ping, $map, $mappic, $GSid);
        } while (next($server_id));
        GSfooter();
    } else {
        echo _NOSERVERS;
    }
    if ($_GET['do'] != "block") {
        CloseTable();
        if (is_admin($admin)) {
            echo '<br>';
            OpenTable();
            echo '<center><a href="' . adminlink() . '">' . _GSADMIN . '</a>&nbsp;|&nbsp;<a href="' . adminlink("&mode=GSConfig") . '">' . _GSADMINC . '</a>&nbsp;|&nbsp;' . _GSSNUM . ' ' . count($servers);
            if ($GSremote and $GSdebug and $GSlistchg == "2" and $_GET['GSlisttype'] != "list" and $_GET['GSlisttype'] != "ilist") {
                echo '&nbsp;|&nbsp;<a href="' . $GSremotepath . '/remote.php?serverstring=' . $serverstring . '&code=' . $GScode . '" target="_blank">Sourcelink(for debug)</a>';
            }
            echo '</center>';
            CloseTable();
        }
        include 'footer.php';
    } else {
        //block cache debug
        //echo _GSSNUM.' '.count($servers).'-'.$GScachetime;
        //die to keep nuke from giving file doesn't exist errors in block mode
        die;
    }
}