edit vergessen... ne scheiße... nimm den code hier das is ne box und ändre die ausgabe:
<?php
defined('main') or die('no direct access');
$abf = 'SELECT * FROM prefix_teamspeakviewer12';
$erg = db_query($abf);
$row = db_fetch_object($erg);
$basic = true;
function indexOf1($str,$strChar)
{
if(strlen(strchr($str,$strChar))>0) {
$position_num = strpos($str,$strChar) + strlen($strChar);
return $position_num;
} else {
return -1;
}
}
function time_convert($time)
{
$hours = floor($time/3600);
$minutes = floor(($time%3600)/60);
$seconds = floor(($time%3600)%60);
if($hours>0) $time = $hours."h ".$minutes."m ".$seconds."s";
else if($minutes>0) $time = $minutes."m ".$seconds."s";
else $time = $seconds."s";
return $time;
}
/*****************************************************
* Capital letter
*****************************************************/
function strCapToUpper($str)
{
$str = trim($str);
$fstr = strtoupper(substr($str,0,1));
$lstr = substr($str,1,strlen($str));
return $fstr.$lstr;
}
/*****************************************************
* Remove character
*****************************************************/
function removeChar($str)
{
$str = str_replace('"', '', $str);
return $str;
}
/*****************************************************
* Replace character
*****************************************************/
function replaceChar($str)
{
$str = str_replace("'", "'", $str);
return $str;
}
function Name($ip,$port,$tPort,$basic,$bgcolor)
{
global $nameh;
$out = "";
$fp = @fsockopen($ip, $tPort, $errno, $errstr, 5);
if(!$fp) die("");
if($fp) {
fputs($fp, "sel ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out .= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("OK", "", $out);
$out = trim($out);
$nameh=substr($out,indexOf1($out,"server_name="),strlen($out));
$nameh=substr($nameh,0,indexOf1($nameh,"server_platform=")-strlen("server_platform="));
if($basic) {
$nameh=substr($out,indexOf1($out,"server_name="),strlen($out));
$nameh=substr($nameh,0,indexOf1($nameh,"server_platform=")-strlen("server_platform="));
/* Hier kann die TEXT-Ausgabe geändert werden */
echo $nameh;
}
fclose($fp);
}
}
function User($ip,$port,$tPort,$basic,$bgcolor)
{
global $name;
$out = "";
$fp = @fsockopen($ip, $tPort, $errno, $errstr, 5);
if(!$fp) die("<b>Offline</b>");
if($fp) {
fputs($fp, "sel ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out .= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("OK", "", $out);
$out = trim($out);
$name=substr($out,indexOf1($out,"server_name="),strlen($out));
$name=substr($name,0,indexOf1($name,"server_platform=")-strlen("server_platform="));
if($basic) {
$user=substr($out,indexOf1($out,"server_currentusers="),strlen($out));
$user=substr($user,0,indexOf1($user,"server_currentchannels=")-strlen("server_currentchannels="));
$max=substr($out,indexOf1($out,"server_maxusers="),strlen($out));
$max=substr($max,0,indexOf1($max,"server_allow_codec_celp51=")-strlen("server_allow_codec_celp51="));
/* Hier kann die TEXT-Ausgabe geändert werden */
echo $user.'/'.$max;
}
fclose($fp);
}
}
function OS($ip,$port,$tPort,$basic,$bgcolor)
{
global $name;
$out = "";
$fp = @fsockopen($ip, $tPort, $errno, $errstr, 5);
if(!$fp) die("<b>Offline</b>");
if($fp) {
fputs($fp, "sel ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out .= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("OK", "", $out);
$out = trim($out);
$name=substr($out,indexOf1($out,"server_name="),strlen($out));
$name=substr($name,0,indexOf1($name,"server_platform=")-strlen("server_platform="));
if($basic) {
$os=substr($out,indexOf1($out,"server_platform="),strlen($out));
$os=substr($os,0,indexOf1($os,"server_welcomemessage=")-strlen("server_welcomemessage="));
/* Hier kann die TEXT-Ausgabe geändert werden */
echo $os;
}
fclose($fp);
}
}
////////////
function channel($ip,$port,$tPort,$basic,$bgcolor)
{
global $name;
$out = "";
$fp = @fsockopen($ip, $tPort, $errno, $errstr, 5);
if(!$fp) die("<b>Offline</b>");
if($fp) {
fputs($fp, "sel ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out .= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("OK", "", $out);
$out = trim($out);
$name=substr($out,indexOf1($out,"server_name="),strlen($out));
$name=substr($name,0,indexOf1($name,"server_platform=")-strlen("server_platform="));
if($basic) {
$cAmount=substr($out,indexOf1($out,"server_currentchannels="),strlen($out));
$cAmount=substr($cAmount,0,indexOf1($cAmount,"server_bwinlastsec=")-strlen("server_bwinlastsec="));
/* Hier kann die TEXT-Ausgabe geändert werden */
echo $cAmount;
}
fclose($fp);
}
}
/////////////
function type($ip,$port,$tPort,$basic,$bgcolor)
{
global $name;
$out = "";
$fp = @fsockopen($ip, $tPort, $errno, $errstr, 5);
if(!$fp) die("<b>Offline</b>");
if($fp) {
fputs($fp, "sel ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out .= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("OK", "", $out);
$out = trim($out);
$name=substr($out,indexOf1($out,"server_name="),strlen($out));
$name=substr($name,0,indexOf1($name,"server_platform=")-strlen("server_platform="));
if($basic) {
$tsType=substr($out,indexOf1($out,"server_clan_server="),strlen($out));
$tsType=substr($tsType,0,indexOf1($tsType,"server_udpport=")-strlen("server_udpport="));
/* Hier kann die TEXT-Ausgabe geändert werden */
echo $tsType;
}
fclose($fp);
}
}
///////////////////
function welcomeMsg($ip,$port,$tPort,$basic,$bgcolor)
{
global $name;
$out = "";
$fp = @fsockopen($ip, $tPort, $errno, $errstr, 5);
if(!$fp) die("<b>Offline</b>");
if($fp) {
fputs($fp, "sel ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out .= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("OK", "", $out);
$out = trim($out);
$name=substr($out,indexOf1($out,"server_name="),strlen($out));
$name=substr($name,0,indexOf1($name,"server_platform=")-strlen("server_platform="));
if($basic) {
$welcomeMsg=substr($out,indexOf1($out,"server_welcomemessage="),strlen($out));
$welcomeMsg=substr($welcomeMsg,0,indexOf1($welcomeMsg,"server_webpost_linkurl=")-strlen("server_webpost_linkurl="));
/* Hier kann die TEXT-Ausgabe geändert werden */
echo $welcomeMsg;
}
fclose($fp);
}
}
///////////////////
function uptime($ip,$port,$tPort,$basic,$bgcolor)
{
global $name;
$out = "";
$fp = @fsockopen($ip, $tPort, $errno, $errstr, 5);
if(!$fp) die("<b>Offline</b>");
if($fp) {
fputs($fp, "sel ".$port."\n");
fputs($fp, "si\n");
fputs($fp, "quit\n");
while(!feof($fp)) {
$out .= fgets($fp, 1024);
}
$out = str_replace("[TS]", "", $out);
$out = str_replace("OK", "", $out);
$out = trim($out);
$name=substr($out,indexOf1($out,"server_name="),strlen($out));
$name=substr($name,0,indexOf1($name,"server_platform=")-strlen("server_platform="));
if($basic) {
$uptime=substr($out,indexOf1($out,"server_uptime="),strlen($out));
$uptime=substr($uptime,0,indexOf1($uptime,"server_currrentusers=")-strlen("server_currrentusers="));
/* Hier kann die TEXT-Ausgabe geändert werden */
echo time_convert($uptime);
}
fclose($fp);
}
}
?>
<script language="JavaScript">
<!--
// The "refresh" function implementations are identical
// to our regular "JavaScript-Refresh" example. The only
// difference from our JavaScript Refresh example is
// we do not have a doLoad function that starts our
// refresh timer (since we use a refresh button).
var sURL = unescape(window.location.pathname);
function refresh()
{
window.location.href = sURL;
}
//-->
</script>
<script language="JavaScript1.1">
<!--
function refresh()
{
window.location.replace( sURL );
}
//-->
</script>
<script language="JavaScript1.2">
<!--
function refresh()
{
window.location.reload( false );
}
//-->
</script>
</head>
<body>
<?php
echo '<b>ServerName:</b> ';
echo Name($row->ip,$row->port,$row->qport,true,'#ffffff');
echo '<br />
<b>Online:</b> ';
echo User($row->ip,$row->port,$row->qport,true,'#ffffff');
echo '<br />
<b>Channel:</b> ';
echo channel($row->ip,$row->port,$row->qport,true,'#ffffff');
echo '<br />
<b>Online seit:</b> ';
echo uptime($row->ip,$row->port,$row->qport,true,'#ffffff');
echo '<br />
<b>System:</b> ';
echo OS($row->ip,$row->port,$row->qport,true,'#ffffff');
echo '<br /><center><b>IP: '.$row->ip.':'.$row->port.'</b><br /><a href="teamspeak.html">Mehr</a></center>';
?>