[EF IV] Nie wyświetla panela z serwerami, przekierowuje na index.php
|
mahomet91 |
Dodany dnia 10.12.2008 19:01:16
|
Przedszkolak
Postów: 37 Ostrzeżeń: 5
Data rejestracji: 14.11.2008 13:31
Złamana licencja
|
Witam serdecznie !
Otóż mam od was pobrane oraz zainstalowany infusions o nazwie: INF-CS_Server_Monitor[6.01.13]-1.1
Otóż jak wpisuje link www.skcaln.pl/inf... to zamiast pokazywać liste serwerów przekierowywuje mnie na stronę główną. Czy wie ktoś jak zmienić ten kod php aby te serwery wyświetlało w tym panela?
Oto kod pliku css_qs_panel.php:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fu...
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| CSS_QS Coded by PyschoBirdMan
| David Andrews 2006
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."css_qs_panel/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."css_qs_panel/locale/".$settings['locale'].".php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."css_qs_panel/locale/Polish.php";
}
$map;
$players;
$servername;
$maxplayers;
$bots;
$success;
$serveroutput = create_table();
opentable("".$locale['CSS_QS_108']."");
Echo "<table width='100%' valign='top' cellpadding='1' cellspacing='1' class='tbl-border'>
<tr>
<td class = 'tbl2'></td>
<td class = 'tbl2' align='center'>".$locale['CSS_QS_107']."</td>
<td class = 'tbl2' align='center'>".$locale['CSS_QS_106']."</td>
<td class = 'tbl2' align='center'>".$locale['CSS_QS_101']."</td>
<td class = 'tbl2' align='center'>".$locale['CSS_QS_102']."</td>
<td class = 'tbl2' width='5%'>".$locale['CSS_QS_103']."</td>
<td class = 'tbl2' align='center'>".$locale['CSS_QS_104']."</td>
</tr>
$serveroutput
</table>
";
closetable();
//functions
function create_table()
{
global $players;
global $map;
global $servername;
global $maxplayers;
global $bots;
global $success;
global $db_prefix;
$list = "";
$result = dbquery("SELECT * FROM ".$db_prefix."css_qs_servers ORDER BY css_qs_server_order ASC");
$rows = dbrows($result);
if ($rows != 0)
{
while($data = dbarray($result))
{
foreach($data as $key=>$value)
{
$$key = $value;
}
$server_status = query_server($css_qs_server_type,$css_qs_server_address,$css_qs_server_port);
if ($success == 1)
{
$players = $players." / ".$maxplayers." (".$bots.")";
}
if ($css_qs_server_type != "TeamSpeak" && $success == 1)
{
$actions = "<a href='steam://connect ".$css_qs_server_address.":".$css_qs_server_port."'><img src='".INFUSIONS."css_qs_panel/images/connect.png' border='0'></a>";
}
else
{
$actions = $locale['CSS_QS_109'];
}
$list .= "<tr><td align='center' valign='middle' class='tbl1' width='10'><img src='".INFUSIONS."css_qs_panel/".$css_qs_server_image."'></td>
<td align='center' vaiign='middle' class='tbl1'>".$css_qs_server_Name."</td>
<td align='center' valign='middle' class='tbl1'>".$css_qs_server_address.":".$css_qs_server_port."</td>
<td align='center' valign='middle' class='tbl1'>".$map."</td>
<td align='center' valign='middle' class='tbl1'>".$players."</td>
<td align='center' valign='middle' class='tbl1'>$server_status</td>
<td align='center' valign='middle' class='tbl1'>$actions</td></tr>";
}
}
else
{
$list = "<tr><td align='center' valign='middle' colspan='7'>".$locale['CSS_QS_105']."</td></tr>";
}
if ($rows >= 4)
{
$list .= "<tr><td align='center' valign='middle' colspan='7'><font size='1'>".$locale['CSS_QS_027']."</font></td></tr>";
}
return $list;
}
function query_server($type,$ip,$port)
{
global $players;
global $map;
global $servername;
global $maxplayers;
global $bots;
global $success;
$success = 0;
$map = "".$locale['CSS_QS_028']."";
$players = "".$locale['CSS_QS_028']."";
$servername = "".$locale['CSS_QS_028']."";
$maxplayers = "".$locale['CSS_QS_028']."";
$bots = "".$locale['CSS_QS_028']."";
if ($type == "Counter Strike Source") //Source Query
{
$packet = "\xFF\xFF\xFF\xFFTSource Engine Query\x00";
if(!$live_server = fsockopen("udp://".$ip,$port))
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/red.gif' alt=''>";
}
else
{
fwrite($live_server, $packet);
socket_set_timeout($live_server,1,0);
$junk = fread($live_server,5);
$status = socket_get_status($live_server);
$do = 1;
$server_info= "";
while($do)
{
$str_1 = fread($live_server,1);
$server_info .= $str_1;
$status = socket_get_status($live_server);
if($status["unread_bytes"] == 0) {$do = 0;}
}
fclose($live_server);
if (strlen($server_info) > 0)
{
$success = 1;
$servername = getnextstring($server_info);
$map = getnextstring($server_info);
$junk = getnextstring($server_info);
$junk = getnextstring($server_info);
$junk = getnextbytevalue($server_info);
$junk = getnextbytevalue($server_info);
$players = getnextbytevalue($server_info);
$maxplayers = getnextbytevalue($server_info);
$bots = getnextbytevalue($server_info);
if ($players < $maxplayers)
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/green.gif' alt=''>";
}
else
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/yellow.gif' alt=''>";
}
}
else
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/red.gif' alt=''>";
}
}
}
elseif ($type == "TeamSpeak")// Teamspeak Query
{
if (!$fp = @fsockopen($ip,$port))
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/red.gif' alt=''>";
}
else
{
socket_set_timeout($fp,1,0);
$data = fread($fp,4);
fputs($fp, "quit");
fclose($fp);
if ($data == "[TS]")
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/green.gif' alt=''>" ;
}
else
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/yellow.gif' alt=''>";
}
}
}
elseif ($type == "CounterStrike 1.6")
{
$packet = "\xFF\xFF\xFF\xFFTSource Engine Query\x00";
if(!$live_server = fsockopen("udp://".$ip,$port))
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/red.gif' alt=''>";
}
else
{
fwrite($live_server, $packet);
socket_set_timeout($live_server,1,0);
$junk = fread($live_server,5);
$status = socket_get_status($live_server);
$do = 1;
$server_info= "";
while($do)
{
$str_1 = fread($live_server,1);
$server_info .= $str_1;
$status = socket_get_status($live_server);
if($status["unread_bytes"] == 0) {$do = 0;}
}
fclose($live_server);
if (strlen($server_info) > 0)
{
$success = 1;
$junk = getnextstring($server_info);
$servername = getnextstring($server_info);
$map = getnextstring($server_info);
$junk = getnextstring($server_info);
$junk = getnextstring($server_info);
$players = getnextbytevalue($server_info);
$maxplayers = getnextbytevalue($server_info);
if ($players < $maxplayers)
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/green.gif' alt=''>";
}
else
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/yellow.gif' alt=''>";
}
}
else
{
$output = "<img src='".INFUSIONS."css_qs_panel/images/red.gif' alt=''>";
}
}
}
return $output;
}
function getnextstring(&$data)
{
$temp="";
$counter=0;
while (ord($data[$counter++])!=0) $temp.=$data[$counter-1];
$data=substr($data,strlen($temp)+1);
return $temp;
}
function getnextbytevalue(&$data)
{
$temp=ord($data[0]);
$data=substr($data,1);
return $temp;
}
?> Kliknij i zaczekaj na załadowanie kodu ...
Edytowane przez Pieka dnia 10.12.2008 19:27:10
|
|
|
|
Wścibski Gość |
Dodany dnia 25.11.2024 09:03:29
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
rytek90 |
Dodany dnia 10.12.2008 19:14:34
|
Przedszkolak
Postów: 31 Pomógł: 5
Data rejestracji: 11.03.2005 16:52
|
To chyba dość normalne, żeby przy próbie otwarcia z linku kodu panelu przerzuca cie do strony głównej.
Odpowiedzialny za to kod:
GeSHi: PHP
Zinterpretowano w sekund: 0.588, wykorzystano GeSHi 1.0.8.10
Musisz w zarządzaniu panelami dodać nowy, wskazując tego infusiona (css_qs_panel)
|
|
|
|
mahomet91 |
Dodany dnia 10.12.2008 20:37:21
|
Przedszkolak
Postów: 37 Ostrzeżeń: 5
Data rejestracji: 14.11.2008 13:31
Złamana licencja
|
No tak tyle to wiem ze on jest odpowiedzialny za to, ale jak zrobić aby wyświetlało listę tych serwerów?? |
|
|