Add this script to you functions file or somewhere where it includes.
If you want to print the status use this code:
If you want to print the status use this code:
PHP Code:
echo server_status($ip, $port);
PHP Code:
//Server status script by: SniuurksT
$ip = '127.0.0.1'; //Server ip adress
$port = '15779'; //Server port
function server_status($ip, $port)
{
$status = array("<strong>Server is:</strong><span style='color:#F00;'>Offline</span>", "<strong>Server is:</strong><span style='color:#0F0;'>Online </span>
");
$fp = @fsockopen($ip, $port, $errno, $errstr, 2);
if (!$fp) {
return $status[0];
}
else
{
return $status[1];
}
}