i mam takie pytanie przerobilem to i wyglada to tak
a po wygenerowaniu wyglada tak
a chiałbym żeby w tym drugim było normalne tło i kod do wygenerowanego statusu
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Napisano 01.07.2010 09:13
Napisano 01.07.2010 09:37
Napisano 01.07.2010 16:35
Użytkownik JLB.Kotek edytował ten post 01.07.2010 09:42
Napisano 01.07.2010 16:46
<textarea name=\"\" ROWS=\"4\" cols=\"30\" readonly=\"readonly\" >
<img src=\"http://domena/banner/obrazek.php?ip=".$ip.":".$port.">
</textarea>$ip=$_GET['ip'];
$port=$_GET['port'];
Użytkownik G[o]Q edytował ten post 01.07.2010 16:47
Napisano 01.07.2010 16:54
<textarea name=\"\" ROWS=\"4\" cols=\"30\" readonly=\"readonly\" >
<img src=\"http://domena/banner/obrazek.php?ip=".$ip.":".$port.">
</textarea>
Gdzie to dopisać
Napisano 01.07.2010 16:57
Napisano 01.07.2010 17:03
Napisano 01.07.2010 17:17
Napisano 01.07.2010 17:22
Napisano 01.07.2010 20:29
Napisano 01.07.2010 20:45
Parse error: syntax error, unexpected '<' in /home/wanted/public_html/server/index.php on line 186
Napisano 01.07.2010 22:02
echo "tu to co ci dalem ";
Napisano 01.07.2010 22:09
Napisano 01.07.2010 22:18
Napisano 01.07.2010 22:40
<?php
$ext = '.png'; //rozszerzenie
$base = 'base'; //tlo podstawowe
$fonts = array('./lucon.ttf', './ocr.ttf', './impact.ttf', './cs.ttf', './digit.ttf');
$quality = '100'; //jakosc
$cachefile = "./cache/server_".$_SERVER['QUERY_STRING'].$ext;
$cachefile = str_replace(':', '-', $cachefile);
$cachetime = 30; //czas cache'owania
if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile)))
{
send_headers();
echo file_get_contents($cachefile);
exit;
}
ob_start();
define("CLASS_PQ_PHP", 1);
include_once("./SNS/class_PQ.php");
include_once("./SNS/PQ/PQ_PARENT.php");
include_once("./SNS/PQ/halflife.php");
if (strpos($_GET['ip'], ':'))
{
$ipp = explode(":", $_GET['ip']);
if (count($ipp)==2)
{
$conf_ip = $ipp[0];
$conf_port = $ipp[1];
}
} else {
$conf_ip = ($_GET['ip'])?$_GET['ip']:'localhost';
$conf_port = ($_GET['port'])?$_GET['port']:'27015';
}
if (strlen($conf_port)>5)
$conf_port = substr($conf_port, 0, 5);
$conf = array(
'ip' => $conf_ip,
'port' => $conf_port,
'querytype' => 'halflife',
'master' => 0,
'timeout' => 3,
'retries' => 1,
);
$pq = PQ::create($conf);
$info = $pq->query_info($conf['ip'].':'.$conf['port']);
$w = 330; //szerokosc
$h = 30; //wysokosc
if (true)
{
if($ext == '.jpg') {
$input = imagecreatefromjpeg($base . $ext);
} else if($ext == '.png') {
$input = imagecreatefrompng($base . $ext);
imageAlphaBlending($input, true);
imageSaveAlpha($input, true);
}
} else {
$input = imagecreatetruecolor($w, $h);
imagefilledrectangle($input, 1, 1, $w-2, $h-2, imagecolorallocate($input, 255, 105, 180));
}
//rozne kolory
$white = imagecolorallocate($input, 255, 255, 255);
$grey = imagecolorallocate($input, 128, 128, 128);
$black = imagecolorallocate($input, 0, 0, 0);
$blue = imagecolorallocate($input, 0, 0, 255);
$green = imagecolorallocate($input, 0, 255, 0);
$red = imagecolorallocate($input, 255, 0, 0);
$pink = imagecolorallocate($input, 255, 105, 180);
$yellow = imagecolorallocate($input, 255, 255, 0);
$icon = imagecreatefrompng('cs.png'); //ikonka CS'a
imagecopymerge($input, $icon, 2, 2, 0, 0, 16, 16, 75);
imagedestroy($icon);
imagerectangle($input, 24, 1, 29, 10, $black);
if ($info==NULL)
{
imagefilledrectangle($input, 25, 2, 28, 9, $red);
imagettftext($input,
13, //size
0, //angle
55, //x
16, //y
$white,
$fonts[4],
'Server '. htmlspecialchars(strtoupper($conf['ip'].':'.$conf['port'])). ' offline');
}
else
{
imagefilledrectangle($input, 25, 2, 28, 9, $green);
imagettftext($input,
7, //size
0, //angle
35, //x
8, //y
$white,
$fonts[0],
htmlspecialchars($info['name'])); //nazwa serwera
$ipport = htmlspecialchars(strtoupper($info['ip'].':'.$info['port']));
imagettftext($input,
9, //size
0, //angle
35, //x
18, //y
$pink,
$fonts[0],
$ipport); //IP:PORT
$size = imagettfbbox(9, 0, $fonts[0], $ipport);
$width = 45 + abs($size[2] - $size[0]);
$pltn = htmlspecialchars(strtoupper($info['totalplayers'].'/'.$info['maxplayers']));
imagettftext($input,
9, //size
0, //angle
$width, //x
18, //y
$black,
$fonts[0],
$pltn); //ilosc graczy / max ilosc
$size2 = imagettfbbox(9, 0, $fonts[0], $pltn);
$width2 = $width + 10 + abs($size2[2] - $size2[0]);
imagettftext($input,
9, //size
0, //angle
$width2, //x
18, //y
$black,
$fonts[0],
htmlspecialchars($info['map'])); //mapka
if ($info['protocol']==48) //serwer STEAM
{
$steam = imagecreatefrompng('steam.png');
imagecopymerge($input, $steam, $w-23, 2, 0, 0, 21, 16, 75);
imagedestroy($steam);
}
if ($info['serverlocked']) // serwer na haslo
{
$key = imagecreatefrompng('key.png');
imagecopymerge($input, $key, $w-32, 2, 0, 0, 7, 16, 75);
imagedestroy($key);
}
}
if($ext == '.jpg') {
imagejpeg($input, NULL, $quality);
} else if($ext == '.png') {
imagepng($input, NULL, ($quality / 10) - 1);
}
function send_headers() {
global $config;
if($ext == '.png') {
header ('Content-type: image/png');
} else {
header ('Content-type: image/jpeg');
}
}
$fp = fopen($cachefile, 'wb');
fwrite($fp, ob_get_contents());
fclose($fp);
send_headers();
ob_end_flush();
?>masz dopisz tamto bo może ja coś źle robię
Napisano 01.07.2010 22:56
echo "to co ci podalem"i ewentualnie wczesniej zwykle
echo "<img src=\"sciezka taka jak jest teraz w adresie czyli z index.php\">";
Napisano 01.07.2010 23:28
0 użytkowników, 0 gości, 0 anonimowych