
import php
Zdravím, jak mám do tohoto:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<title>Server status</title>
</head>
<body>
<iframe src='cs1.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='cs2.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='cs3.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='cs4.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='cs5.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='cs6.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='cs7.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='cs8.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='cs9.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='mc1.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
<iframe src='ts1.php' frameborder='0' scrolling='no' width='100%' height='20'></iframe>
</body>
</html>
Importovat toto:<?php
require_once("lgsl_query.php");
$ips = array("cs.mystiq.org:27015","46.105.144.170:27130","46.105.144.170:27131","46.105.144.170:27134","46.105.144.170:27163","46.105.144.170:27172","46.105.144.170:27173","94.23.168.176:27180","94.23.168.176:27181","94.23.168.176:27182");
$online = 0;
$online_max = count($ips);
$onlineP = 0;
$onlineP_max = 0;
$free = 0;
for($i=0;$i<count($ips);$i++)
{
$ex = explode(":", $ips[$i]);
$ip = $ex[0];
$port = $ex[1];
$query = lgsl_query($ip, $port, "halflife", "info");
if($query['hostname'] != "")
{
$online = $online + 1;
$onlineP = $onlineP + $query['players'];
$onlineP_max = $onlineP_max + $query['maxplayers'];
$free = $onlineP_max - $onlineP;
}
}
openside('Statistika Serverů');
echo "<font color='green'>Volné sloty:</font> ".$free." / ".$onlineP_max;
echo "<br />";
echo "<font color='green'>Online servery:</font> ".$online." / ".$online_max;
echo "<br />";
echo "<font color='green'>Počet hráčů:</font> ".$onlineP." / ".$onlineP_max;
closeside();
?>
Díky za všechny rady.