
25.05.2008, 10:54
|
|
Banned
Регистрация: 25.05.2008
Сообщений: 8
Провел на форуме: 35771
Репутация:
13
|
|
PHP код:
<?
require_once("class_PQ.php");
$height=80;
$width=300;
$path="C:/xampp/htdocs/cs/mon1/"; // путь до картинки))
$image="cs.png";
if ($handle = opendir('/path/to/files'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
echo "$file\n";
}
}
closedir($handle);
}
Header("Content-type: image/png");
$im=imagecreatefrompng($path.$image);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
imageFill($im, 0, 0, $white);
$pqinfo = array();
$pq = PQ::create(array('ip' => "10.3.145.2:27015", 'querytype' => "halflife_new_queries",));
$pqinfo = $pq->query(array('players','info', 'rules'));
ImageString($im, 70, 420, 5, $pqinfo['name'], $black);
ImageString($im, 70, 420, 75, "IP: ".$pqinfo['ip'].":".$pqinfo['int_port'], $black);
ImageString($im, 70, 430, 90, "Map: ".$pqinfo['map'], $black);
ImageString($im, 70, 450, 105, "Player: ".$pqinfo['totalplayers']."/".$pqinfo['maxplayers'], $black);
ImageRectangle($im, 0, 0, $width-1, $height-1, $black);
Imagejpeg($im);
ImageDestroy($im);
?>
|
|
|