<?
//Database
//////////
$dbhost="127.0.0.1"; //Host/IP from the MySQL Database
$dbname="l2jdb"; //Name of Database (in many times it is 'l2jdb')
$dbuser="root"; //Username to the MySQL Database
$dbpass="****"; //Passwort to the MySQL Database
$config['config_script_name']="Statistik Script"; //Here you can wrote you name from the Homepage / Clan or something.
//It will be displayed on the Top
$config['config_map_quality']="middle"; //Quality of the Map and size
//"low" = Low quality and size (this can reduce the traffic of the server)
//"middle" = Middle quality and size (this looks good on 1280x1024 resolution)
//"high" = High quality and size (this is a detailed map but more traffic)
//
//Notice: Whole-Map is always "low" quality
$config['server_path']="C:/Server/l2j/data/announcements.txt"; //Full path to the announcements.txt.
//example:
//Windows = C:/server/l2j-server/data/announcements.txt
//Linux = /usr/server/l2j-server/data/announcements.txt
///////////////////////////////////////////////////////////////////////////////////////////////////
//Dont edit behind this line///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
$verbindung=MYSQL_CONNECT($dbhost,$dbuser,$dbpass) or die ("Datenbankserver nicht erreichbar");
MYSQL_SELECT_DB($dbname) or die ("Datenbank nicht vorhanden");
$get_config_data="SELECT online FROM characters WHERE online>0";
$config_data=MYSQL_QUERY($get_config_data);
$config['num_online']=mysql_num_rows($config_data);
$handle = fopen("http://www.whatismyip.com/", "r");
$contents = '';
while (!feof($handle)){$contents .= fread($handle, 8192);}
fclose($handle);
preg_match( "/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/", $contents, $matches );
$config['server_ip']=$matches[0];
error_reporting(0);
$IP = array(
"game_server" => "igunzi.dyndns.org:7777", change the dynamic dns to your internet ip
);
while(list($ServerName,$Host)=each($IP))
{
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5))
{
$config[$ServerName]="<font color=\"#00ff00\">Online</font>";
fclose($fp);
}else{
$config[$ServerName]="<font color=\"#ff0000\">Offline</font>";
}
}
mysql_close($verbindung);
?>