04-02-2008, 12:46 PM
config.php
PHP код:
<?php
header("Expires: ". gmdate("D, d M Y H:i:s")." GMT");
$mssql["server"] = "127.0.0.1";
$mssql["user"] = "user(default SA)";
$mssql["password"] = "password";
$mssql["database"] = "lin2db";
?>
index.php
PHP код:
<?php
header("Expires: ". gmdate("D, d M Y H:i:s")." GMT");
$online["cache"] = @file("./temp/online.ini");
@list($online["last"]["check"], $online["last"]["online"]) = explode(";", $online["cache"][0]);
if($online["last"]["check"] == "" || $online["last"]["check"] < (time() - 60)) { include("config.php");
mssql_select_db("lin2db");
$mssql["entry"] = mssql_fetch_array(mssql_query("SELECT TOP 1 world_user as pocet FROM user_count WHERE server_id < 2 ORDER BY record_time DESC;"));
$online["online"] = $mssql["entry"]["pocet"];
;
echo "<font face=\"verdana\" size=\"2\" color=\"#00FF00\"><b>Online: ".$online["online"]."<br><font size=-2></b></center></font></body>";
fputs($f, time().";".$online["online"]);
fclose($f);
} else {
echo "<b>Online: ".$online["last"]["online"]."<br><font size=-2></b></center></font></body>";
}
error_reporting(0);
$IP = array("Login Server: " => "127.0.0.1:2108",
"Game Server: " => "127.0.0.1:7777",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
echo($ServerName);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)){
echo'ON<br>';
fclose($fp);
}
else {
echo'OFF<br>';
}
}
?>