Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
$ip1 ="asd"; //ипто
$port1 = "sad"; //порта
$output = @fsockopen("udp://$ip1", $port1, $errno, $errstr, 0.25);
@socket_set_timeout($output, 1);
@socket_set_blocking($output, 1);
@fwrite($output, "\xFF\xFF\xFF\xFF\x54\x53\x6F\x75\x72\x63\x65\x20\x45\x6E\x67\x69\x6E\x65\x20\x51\x75\x65\x72\x79\x00");
$buffer = @fread($output, 4096);
if (!$buffer) {
$on = "<font color=\"red\">offline</font>";
} else {
$on = "<font color=\"green\">online</font>";
}
echo $on;
?>
<?php
header("Content-type: image/png");
require_once("inc.php");
$ip_port = array(1 => "79.132.0.126:80");
$rand = rand(1, count($ip_port));
$getip_port = explode(":", $ip_port[$rand]);
$ip = $getip_port[0];
$port = $getip_port[1];
//SERVER GETTING DATA
$s = new serverinfo($ip, $port);
$s->getServerData();
$name = $s->serverData['hostname'];
$players = $s->serverData['players'];
$maxplayers = $s->serverData['maxplayers'];
$map = $s->serverData['map'];
//IMAGE CREATE:
$imgopen = "image.png";
$im = imagecreatefrompng (''.$imgopen.'');
//COLORS:
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);
$green = imagecolorallocate($im, 0, 255, 0);
$yellow = imagecolorallocate($im, 219,219,112);
$white = imagecolorallocate($im, 237,237,237);
imagettftext($im, 9,0,15,67, $white, "tacint.ttf", "" . $ip_port[1]);
imagettftext($im, 9,0,15,27, $yellow, "tacint.ttf", "" . $name);
imagettftext($im, 9,0,248,67,$white, "tacint.ttf", "" . $players ."/".$maxplayers);
imagettftext($im, 9,0,15, 107,$white, "tacint.ttf", "" . $map);
if($s->getStatus()) {
imagettftext($im, 9,0,248,107, $green, "tacint.ttf", "0nline");
}
else{
imagettftext($im, 9,0,248,107, $red, "tacint.ttf", "0ffline");
}
imagesavealpha($im, true);
imagepng ($im);
imagedestroy($im);
die();
?>
LuBaTa каза:http://prikachi.com/images/302/4196302z.png
Това е картинката, само ч преименувай, и пак нестава:
Онлайн - показва всичко само че след рефреш става на....
Офлайн - Изображението съдържа грешки