IP: 79.43543534.118:435345
Mapa: de_dust2_b
Gracze: 7/29
W takiej kolejności i żeby tam tylko wpisać ip serwera i od razu tak wyświetlało .
Użytkownik WiWaldi:* edytował ten post 17.02.2012 10:07
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 17.02.2012 10:07
IP: 79.43543534.118:435345
Mapa: de_dust2_b
Gracze: 7/29
W takiej kolejności i żeby tam tylko wpisać ip serwera i od razu tak wyświetlało .
Użytkownik WiWaldi:* edytował ten post 17.02.2012 10:07
Napisano 17.02.2012 10:13
Napisano 17.02.2012 14:10
<?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']:'79.133.192.45';
$conf_port = ($_GET['port'])?$_GET['port']:'27018';
}
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 = 350; //szerokosc
$h = 20; //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, 128, 128, 128));
}
//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,
7, //size
0, //angle
35, //x
18, //y
$white,
$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,
7, //size
0, //angle
$width, //x
18, //y
$white,
$fonts[0],
$pltn); //ilosc graczy / max ilosc
$size2 = imagettfbbox(9, 0, $fonts[0], $pltn);
$width2 = $width + 10 + abs($size2[2] - $size2[0]);
imagettftext($input,
7, //size
0, //angle
$width2, //x
18, //y
$white,
$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();
?>

Użytkownik WiWaldi:* edytował ten post 17.02.2012 14:18
Napisano 17.02.2012 16:43
imagecopymerge($input, $steam, $w-23, 2, 0, 0, 21, 16, 75);Musisz takie kody pozamieniać na echo, pousuwać zbędne funkcje.
Napisano 17.02.2012 19:28
Napisano 19.02.2012 18:50
Napisano 19.02.2012 19:08
<?php
$output = "";
if (isset($_GET['s']))
{
if (is_numeric($_GET['s']))
{
require "lgsl_files/lgsl_details.php";
}
elseif ($_GET['s'] == "add")
{
require "lgsl_files/lgsl_add.php";
}
}
else
{
require "lgsl_files/lgsl_list.php";
}
echo $output
?>
Użytkownik master522 edytował ten post 19.02.2012 19:25
Napisano 19.02.2012 20:12
Napisano 20.02.2012 13:09
<!-- IF SERVER_LIST -->
<br />
<div id="serv" style="display: ''; position: relative;">
<table width="100%" class="forumline" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th colspan="6" class="thCornerL" height="25" nowrap="nowrap" onclick="javascript:ShowHide('serv','s2','s3');" style="cursor: pointer" title="{L_VHIDE}"> {L_SERVER_LIST} </th>
</tr>
<!-- BEGIN sl -->
<tr style="text-align: center;">
<td class="row1" {ONMOUSE_COLORS} width="10%">{sl.S_STATUS} {sl.S_GAME} {sl.S_PASSWORD}</td>
<td class="row1" {ONMOUSE_COLORS} width="45%"><a href="servers.php#{sl.S_ID}" class="genmed">{sl.S_NAME}</a></td>
<td class="row1 genmed" {ONMOUSE_COLORS} width="25%"><a href="{sl.S_JOIN_LINK}" class="genmed">{sl.S_IP}</a></td>
<td class="row1 genmed" {ONMOUSE_COLORS}>{sl.S_MAP_CUR}</td>
<td class="row1 genmed" {ONMOUSE_COLORS}>{sl.S_PLAYERS_ON_S} / {sl.S_PLAYERS_MAX}</td>
<td class="row1 genmed" {ONMOUSE_COLORS}><a href="{sl.S_DETAILS_LINK}"><img src="./includes/lgsl/other/icon_details.gif" alt="more.." style="border: none;" /></td>
</tr>
<!-- END sl -->
</table>
</div>
<div id="s2" style="display: none; position: relative;">
<table width="100%" class="forumline" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th colspan="6" class="thCornerL" height="25" nowrap="nowrap" onclick="javascript:ShowHide('serv','s2','s3');" style="cursor: pointer"> {L_SERVER_LIST} </th>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript">
<!--
if(GetCookie('s3') == '2') ShowHide('serv', 's2', 's3');
//-->
</script>
<br />
<!-- ENDIF -->
Napisano 20.02.2012 21:31
<!-- IF SERVER_LIST -->
<br />
<div id="serv" style="display: ''; position: relative;">
<table width="100%" class="forumline" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th colspan="6" class="thCornerL" height="25" nowrap="nowrap" onclick="javascript:ShowHide('serv','s2','s3');" style="cursor: pointer" title="{L_VHIDE}"> {L_SERVER_LIST} </th>
</tr>
<!-- BEGIN sl -->
<tr style="text-align: center;">
<td class="row1" {ONMOUSE_COLORS} width="10%">{sl.S_STATUS} {sl.S_GAME} {sl.S_PASSWORD}</td>
<td class="row1" {ONMOUSE_COLORS} width="45%"><a href="servers.php#{sl.S_ID}" class="genmed">{sl.S_NAME}</a></td>
<td class="row1 genmed" {ONMOUSE_COLORS} width="25%"><a href="{sl.S_JOIN_LINK}" class="genmed">{sl.S_IP}</a></td>
<td class="row1 genmed" {ONMOUSE_COLORS}>{sl.S_MAP_CUR}</td>
<td class="row1 genmed" {ONMOUSE_COLORS}>{sl.S_PLAYERS_ON_S} / {sl.S_PLAYERS_MAX}</td>
<td class="row1 genmed" {ONMOUSE_COLORS}><a href="{sl.S_DETAILS_LINK}"><img src="./includes/lgsl/other/icon_details.gif" alt="more.." style="border: none;" /></td>
</tr>
<!-- END sl -->
</table>
</div>
<div id="s2" style="display: none; position: relative;">
<table width="100%" class="forumline" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th colspan="6" class="thCornerL" height="25" nowrap="nowrap" onclick="javascript:ShowHide('serv','s2','s3');" style="cursor: pointer"> {L_SERVER_LIST} </th>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript">
<!--
if(GetCookie('s3') == '2') ShowHide('serv', 's2', 's3');
//-->
</script>
<br />
<!-- ENDIF -->
Napisano 20.02.2012 21:41
<!-- IF SERVER_LIST -->
<table width="100%" class="forumline" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_SERVER_LIST} </th>
</tr>
<!-- BEGIN sl -->
<tr style="text-align: center;">
<td colspan="2" style="text-align:center"><a href="servers.php#{sl.S_ID}" class="genmed">{sl.S_NAME}</a></td>
</tr>
<tr>
<td>IP</td><td><a href="{sl.S_JOIN_LINK}" class="genmed">{sl.S_IP}</a></td>
</tr>
<tr>
<td>Mapa:</td><td>{sl.S_MAP_CUR}</td>
</tr>
<tr>
<td>Gracze:</td><td>{sl.S_PLAYERS_ON_S} / {sl.S_PLAYERS_MAX}</td>
</tr>
<!-- END sl -->
</table>
<!-- ENDIF -->
Użytkownik master522 edytował ten post 20.02.2012 21:42
Napisano 20.02.2012 22:32
<li>
<a onclick="_gaq.push(['_trackEvent', 'Outgoing', '', '']);" rel="nofollow" class="tytul" href="http://" title="Nazwa srwera">Nazwa serwera</a>
<div>
<p class="left">IP: <strong>85.82:270</strong></p>
<p class="left">Mapa: <strong>de_aztec</strong></p>
<p class="left">Gracze: <strong>1/18</strong></p>
<div>
<img src="http://serwery.c*******.**/grafika/on.png" title="Serwer dostępny">
<a onclick="_gaq.push(['_trackEvent', 'Outgoing', 'www.statydiablo.c*******.**', '/']);" rel="nofollow" href="http://www.statydiablo.c*******.**/" title="Statystyki serwera"><img src="http://serwery.c*******.**/grafika/staty.png" title="Statystyki serwera"></a>
<a onclick="_gaq.push(['_trackEvent', 'Outgoing', 'bany16.c*******.**', '']);" rel="nofollow" href="http://bany16.c*******.**" title="Lista zbanowanych osób"><img src="http://serwery.c*******.**/grafika/bany.png" title="Lista zbanowanych osób"></a>
<img class="img_gracze" id="20" src="http://serwery.c*******.**/grafika/gracze.png" title="Lista graczy na serwerze"> </div>
<a onclick="_gaq.push(['_trackEvent', 'Outgoing', 'connect', '/85.232.244.82:27015']);" rel="nofollow" class="zagraj" href="steam://connect/85.232.244.82:27015" title="Dołącz do gry"> </a>
</div>
<div class="pos_rel">
<div class="gracze" id="gracze_20" style="display: none; ">
<div class="top"> </div>
<table cellpadding="0" cellspacing="0">
<tbody><tr style="background: transparent;"><th>Nick</th><th style="width: 60px">Czas online</th><th style="width: 50px">Punkty</th></tr>
<tr><td>HLTV @ c*******.** [DiabloMod]</td><td style="text-align: center;">1872min</td><td style="text-align: center;">0</td></tr>
</tbody></table>
<div class="bottom"> </div>
</div>
</div>
</li>
Napisano 21.02.2012 15:37
Dobra działa a wiesz może jak zrobić na ID serwer tak żebym wpisał ID i żeby wyświetlało tylko ten serwer który chce?
Napisano 21.02.2012 15:58
To jest kod z cscenter mam go od Anonymous . dał byś rade dodać to do tego kodu??
Napisano 21.02.2012 16:56
<!-- IF SERVER_LIST -->
<table width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
<tbody><tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_SERVER_LIST} </th>
</tr>
<!-- BEGIN sl -->
<tr>
<td colspan="2" style="text-align:center"><a href="servers.php#{sl.S_ID}">{sl.S_NAME}</a></td>
</tr>
<tr>
<td>IP</td><td><a href="{sl.S_JOIN_LINK}"><strong>{sl.S_IP}</strong></a></td>
</tr>
<tr>
<td>Mapa:</td><td><strong>{sl.S_MAP_CUR}</strong></td>
</tr>
<tr>
<td>Gracze:</td><td><strong>{sl.S_PLAYERS_ON_S} / {sl.S_PLAYERS_MAX}</strong></td>
</tr>
<!-- END sl -->
</tbody></table>
<!-- ENDIF -->
Użytkownik master522 edytował ten post 21.02.2012 16:58
Napisano 21.02.2012 22:15
A w jakim celu? Chciałbyś uzyskać podobny wygląd?
phpBB
forum moderowaneNapisany przez mars, 23.02.2019 |
|
|
|||
phpBB
[szukam] Zamykanie tematuNapisany przez RaS_, 04.03.2016 |
|
|
|||
phpBB
Wiadomosc wygenerowana automatycznieNapisany przez RaS_, 11.02.2016 |
|
|
|||
phpBB
SubforaNapisany przez Forek, 29.12.2015 |
|
|
|||
phpBB
Probelm php by przemoProbelm php by przemo Napisany przez Dermi97, 14.12.2015 |
|
|
0 użytkowników, 1 gości, 0 anonimowych