Aktuelle Version: 1.5.5.4
Willkommen auf DZCP.deUser online: 0
Forum
deV!L`z Clanportal Forum: PHP, MySQL und Java Script Thread: TS Viewer anzeige auf genutze Channel begrenzen
TS Viewer anzeige auf genutze Channel begrenzen Seite: «  1 2 3 »
#1 am 09.01.2010 um 13:37 Uhr Diesen Beitrag zitieren
bre2ake
User
Posts: 202

moin,moin,

 

wie der Titel schon sagt, würde ich gern im TS Viewer die Anzeige auf die Channel begrenzen in denen auch leute drin sind.

Es geht mir dabei NICHT um ../teamspeak/!!!

 

ich weiss es gab genau dazu schonmal einen Thread, doch auf diesen kann man nicht mehr zugreifen!

 

wäre über jede Hilfe dankbar...

 

beste Grüße

 


IP gespeichert
#22 am 22.01.2011 um 09:58 Uhr Diesen Beitrag zitieren
dawaldi
User
Posts: 65

nee, makke hat beschrieben, wie man subchannels - wo keiner drin ist - ausblendet, was ja auch funzt.

 

Es geht mir im Prinzip aber auch darum, nur die User anzuzeigen die da sind, mehr nicht.



zuletzt editiert von dawaldi am 22.01.2011 09:58 Uhr 
IP gespeichert
#23 am 27.01.2011 um 17:48 Uhr Diesen Beitrag zitieren
DrAntiDot
User
Posts: 46

ok, dann habe ich das missverstanden. genau das suche ich auch! will nur die User anzeigen, wie in dem großen Viewer über dem eigentlichen TS-Viewer!

 

 

Nachtrag von DrAntiDot:

 

hat keiner eine lösung?

 
IP gespeichert
#24 am 13.02.2011 um 23:16 Uhr Diesen Beitrag zitieren
dawaldi
User
Posts: 65

so sieht meine teamspeak_query jetzt aus, und im TS-Viewer sind nur noch die Namen zu sehen, keine Channel, keine Icons

   Code:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.


/*
  TS2 Class © by iklas Håkansson <niklas.hk@telia.com>
  TS3 Class © by Sebastien Gerard <sebeuu@gmail.com>
  
  modified by CodeKing for DZCP 08-01-2010 (mm-dd-yyyy)
*/

function teamspeakViewer($s) {
  return (
$s['ts_version'] == 3) ? teamspeak3($s) : teamspeak2($s);
}

######################################
### TS 2 Viewer###
######################################



function removeChar($str)
{
    
$str str_replace('"'''$str);
    return 
$str;
}
function 
uptime($sec) {
 
$sec abs($sec); 
 
 return 
sprintf("%d:%02d:%02d",$sec/60/60/24,($sec/60/60)%24,($sec/60)%60);
 } 
function 
time_convert($time$ms false)

  if(
$ms$time $time 1000;

    
$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;




######################################
### TS 3 Viewer###
######################################

function teamspeak3($settings) {
  
$tsstatus = new TSStatus($settings['ts_ip'], $settings['ts_port'], $settings['ts_sport']);

  return  
show("menu/teamspeak", array("hostname" => '',
                                       
"channels" => $tsstatus->render()
                                     ));
}

class 
TSStatus
{
    var 
$_host;
    var 
$_qport;
    var 
$_port;
    var 
$_sid;
    var 
$_socket;
    var 
$_updated;
    var 
$_serverDatas;
    var 
$_channelDatas;
    var 
$_userDatas;
    var 
$_serverGroupFlags;
    var 
$_channelGroupFlags;
    
    var 
$error;
    var 
$decodeUTF8;
    
    function 
TSStatus($host$port$queryPort)
    {
        
$this->_host $host;
        
$this->_port $port;
        
$this->_qport $queryPort;
        
$this->_sid 1;
        
        
$this->_socket null;    
        
$this->_updated false;
        
$this->_serverDatas = array();
        
$this->_channelDatas = array();
        
$this->_userDatas = array();
        
$this->_serverGroupFlags = array();
        
$this->_channelGroupFlags = array();
        
        
$this->error '';
    
$this->serverError '';
        
$this->decodeUTF8 true;
        
        
$this->setServerGroupFlag(6'servergroup_300.png');
        
$this->setServerGroupFlag(10'wappen.png');
        
$this->setChannelGroupFlag(5'changroup_100.png');
        
$this->setChannelGroupFlag(6'changroup_200.png');
    }
    
    function 
clearServerGroupFlags()
    {
        
$this->_serverGroupFlags = array();
    }
    
    function 
setServerGroupFlag($serverGroupId$image)
    {
        
$this->_serverGroupFlags[$serverGroupId] = $image;
    }
    
    function 
clearChannelGroupFlags()
    {
        
$this->_channelGroupFlags = array();
    }
    
    function 
setChannelGroupFlag($channelGroupId$image)
    {
        
$this->_channelGroupFlags[$channelGroupId] = $image;
    }
    
    function 
update()
    {
        
$response $this->queryServer();
        if(
$response !== false && empty($this->error))
        {
            
$lines explode("nrerror id=0 msg=oknr"$response);
            if(
count($lines) == 4)
            {
                
$this->_serverDatas $this->parseLine($lines[0]);
                
$this->_serverDatas $this->_serverDatas[0];
                 
                
$this->_channelDatas $this->parseLine($lines[1]);
                
$this->_userDatas $this->parseLine($lines[2]);
                
usort($this->_userDatas, array($this"sortUsers"));
                
                
$this->_updated true;
            }    else 
$this->error rep2($response);
        }
    }
    
    function 
sendCommand($fp$cmd)
    {
    if(empty(
$this->error)) {
          @
fputs($fp"$cmdn");
          
$response "";
          while(
strpos($response'msg=') === false) {
              
$response .= @fread($fp8096);    
      }
    }
    if(!empty(
$response) && !strstr($response'error id=0')) {
      
$this->error strtr(rep2($response), array(' msg=' => '
msg='
' extra_msg=' => '
extra_msg='
));
    }
    
        return 
$response;
    }
  
    function 
tsvars($str)
        {
        
$str=explode("n",$str);
        
$vars=array();
        for(
$i=0;$i<sizeof($str);$i++) $vars[trim(array_shift(explode('=',$str[$i],2)))]=trim(array_pop(explode('=',$str[$i],2)));
        return 
$vars;
        }

    function 
queryServer()
{
@
set_time_limit(10);
$fp = @fsockopen($this->_host$this->_qport$errno$errstr2);
@
stream_set_timeout($fp20); @stream_set_blocking($fptrue);
if(
$fp)
{

$response $this->sendCommand($fp"use port=" $this->_port);

if(
strstr($response'error id=0 msg=ok')) {
$response ="error id=0 msg=ok" ;
$response .= $this->sendCommand($fp"serverinfo");

$response .= $this->sendCommand($fp"channellist");
$response .= $this->sendCommand($fp"clientlist");
}

if(
$this->decodeUTF8$response utf8_decode($response);

return 
$response;
} else {
$this->error '
<center>'
._error_no_teamspeak.'</center>
'
;
}
return 
false;   
}
    
    function 
unescape($str)
    {
        
$find = array('\',     "/",         "s",         "p",         "a",     "b",     "f",         "n",         "r",     "t",     "v");
        
$rplc = array(chr(92),    chr(47),    chr(32),    chr(124),    chr(7),    chr(8),    chr(12),    chr(10),    chr(3),    chr(9),    chr(11));
        
        return 
str_replace($find$rplc$str);
    }
    
    function 
parseLine($rawLine)
    {
        
$datas = array();
        
$rawItems explode("|"$rawLine);
        foreach (
$rawItems as $rawItem)
        {
            
$rawDatas explode(" "$rawItem);
            
$tempDatas = array();
            foreach(
$rawDatas as $rawData)
            {
                
$ar explode("="$rawData2);
                
$tempDatas[$ar[0]] = isset($ar[1]) ? $this->unescape($ar[1]) : "";
            }
            
$datas[] = $tempDatas;
        }
        return 
$datas;
    }
    
    function 
sortUsers($a$b)
    {
        return 
strcasecmp($a["client_nickname"], $b["client_nickname"]);
    }
    
    function 
renderFlags($flags)
    {
        
$out "";
        foreach (
$flags as $flag$out .= '';
        return 
$out;
    }
    
    function 
renderUsers($parentId$sub 0)
    {
        
$out "";
        foreach(
$this->_userDatas as $user)
        {
            if(
$user["client_type"] == && $user["cid"] == $parentId)
            {
                                                              
$icon "16x16_player_off.png";
                if(
$user["client_away"] == 1)                 $icon "16x16_away.png";
                else if(
$user["client_flag_talking"] == 1)    $icon "16x16_player_on.png";
                else if(
$user["client_output_hardware"] == 0$icon "16x16_hardware_output_muted.png";
                else if(
$user["client_output_muted"] == 1)    $icon "16x16_output_muted.png";
                else if(
$user["client_input_hardware"] == 0)  $icon "16x16_hardware_input_muted.png";
                else if(
$user["client_input_muted"] == 1)     $icon "16x16_input_muted.png";
                
                
$flags = array();
                if(isset(
$this->_channelGroupFlags[$user["client_channel_group_id"]])) $flags[] = $this->_channelGroupFlags[$user["client_channel_group_id"]];
                
$serverGroups explode(","$user["client_servergroups"]);
                foreach (
$serverGroups as $serverGroup) if(isset($this->_serverGroupFlags[$serverGroup])) $flags[] = $this->_serverGroupFlags[$serverGroup];
        
        
$out .= ($sub '    ' '').'    '.rep2($user["client_nickname"]).
'
;

            }
        }
        return 
$out;
    }
    
    function 
renderChannels($parentId$sub 0$tpl false)
    {
        
$out "";
        foreach (
$this->_channelDatas as $channel)
        {
            if(
$channel["pid"] == $parentId && !empty($channel['channel_name']))
            {
                
$icon "16x16_channel_green.png";
                if( 
$channel["channel_maxclients"] > -&& ($channel["total_clients"] >= $channel["channel_maxclients"])) $icon "16x16_channel_red.png";
                else if( 
$channel["channel_maxfamilyclients"] > -&& ($channel["total_clients_family"] >= $channel["channel_maxfamilyclients"])) $icon "16x16_channel_red.png";
                else if(
$channel["channel_flag_password"] == 1$icon "16x16_channel_yellow.png";

                
$flags = array();
                if(
$channel["channel_flag_default"] == 1$flags[] = '16x16_default.png';
                if(
$channel["channel_needed_talk_power"] > 0$flags[] = '16x16_moderated.png';
                if(
$channel["channel_flag_password"] == 1$flags[] = '16x16_register.png';

        
$subchannels = ($sub '' '').'';

        
$out .= show(($tpl $tpl "menu/teamspeak_subchan"), array("subchannels" => $subchannels));
        
$out .= (count($this->_userDatas) > $this->renderUsers($channel["cid"], $sub) : '') . $this->renderChannels($channel['cid'], 1$tpl);
            }
        }
        return 
$out;
    }
  
  function 
getChannelInfos($cid$full false) {
        foreach(
$this->_channelDatas as $channel) {
      if(
$channel['cid'] == $cid) return ($full) ? $channel $channel['channel_name'];
    }
  }
    
    function 
render($tpl false)
    {
        if(!
$this->_updated$this->update();
        if(
$this->error == '')
    {
      if(!
$tpl) {
            
$out '';
        }
            if(
count($this->_channelDatas) > 0$out .= '<tr><td>'.$this->renderChannels(00$tpl).'</td></tr>';
          return 
$out;
        }    else return 
$this->error;
    }    
    
  function 
welcome($s$cid)
    {
        if(!
$this->_updated$this->update();
    
        if(
$this->error == "")
        {
      if(empty(
$cid)) {
            
$out "<tr><td id="contentMainFirst"><span class="fontBold">Server:</span></td></tr>n";
            
$out .= "<tr><td id="contentMainFirst">".$this->_serverDatas['virtualserver_name']."

</td></tr>n"
;
            
$out .= "<tr><td id="contentMainFirst"><span class="fontBold">Server IP:</span></td></tr>n";
            
$out .= "<tr><td id="contentMainFirst">".$s['ts_ip'].":".$s['ts_port']."

</td></tr>n"
;
            
$out .= "<tr><td id="contentMainFirst"><span class="fontBold">Version:</span></td></tr>n";
            
$out .= "<tr><td id="contentMainFirst">".$this->_serverDatas['virtualserver_version']."

</td></tr>n"
;
            
$out .= "<tr><td id="contentMainFirst"><span class="fontBold">Welcome Message:</span></td></tr>n";
            
$out .= "<tr><td id="contentMainFirst">".rep2($this->_serverDatas['virtualserver_welcomemessage'])."

</td></tr>"
;
      } else {
        
$channel $this->getChannelInfos($cidtrue);
            
$out "<tr><td><span class="fontBold">Channel:</span></td></tr>n";
            
$out .= "<tr><td>".rep2($channel['channel_name'])."

</td></tr>n"
;
            
$out .= "<tr><td><span class="fontBold">Topic:</span></td></tr>n";
            
$out .= "<tr><td>".(empty($channel['channel_topic']) ? '-' rep2($channel['channel_topic']))."

</td></tr>n"
;
            
$out .= "<tr><td><span class="fontBold">User in channel:</span></td></tr>n";
            
$out .= "<tr><td>".$channel['total_clients'].($channel['channel_maxclients'] == -'' '/'.$channel['channel_maxclients'])."

</td></tr>n"
;
            
$out .= "<tr><td>
<input type="button" id="submit" onclick="DZCP.popup('login.php?ts3&cName="
.rep2($channel['channel_name'])."', '420', '150');" value="Join Channel" class="submit" /></td></tr>n";
      }
        } else return 
$this->error;
        
        return 
$out;
    }
}

 function 
rep2($var) {
    return 
strtr($var, array(
      
chr(194) => '',
      
'/' => '/',
      
's' => ' ',
      
'p' => '|',
      
'ö' => '&ouml;',
      
'<' => '<',
      
'>' => '>',
      
'[URL]' => '',
      
'[/URL]' => ''
    
));
}

 

 
IP gespeichert
#25 am 07.03.2012 um 10:26 Uhr Diesen Beitrag zitieren
DrAntiDot
User
Posts: 46

Also bei uns läuft das nach wie vor nicht! Hat mitlerwiele jemand eine Idee wie ich all Channel ausblenden kann!

 
IP gespeichert
#26 am 07.03.2012 um 11:54 Uhr Diesen Beitrag zitieren
HellBz
User
Posts: 136

Also hier gibt es dazu ein Tutorial, aber dies bezieht sich aufdie selbe vorgehensweise,

wie auch al das, was hier im Thread steht.

 

http://www.dzcp-addons.eu/tutorials/?action=tutorial&id=6

 

habe es mal probiert gehabt und bei mir funktionier es tadellos.

 

Kann es sein, das dein Teamspeak3 vorher NICHT angezeigt wurde ?

 

 


DZCP-Addons.de DZCP-Addons.com DZCP-Addons.euDZCP Addons Free - Wir haben alles rund ums DZCP

Shop von HellBz

IP gespeichert
#27 am 06.05.2012 um 14:26 Uhr Diesen Beitrag zitieren
Nyandoggy
User
Posts: 1

Hallo !

Ich wollte euch etwas fragen...

Meine Website braucht ein TSviewer, und ich habe schon den Code, ABER... wir nutzen TS3 und das Problem ist, dass wir zu viel Channels haben. Also, wir wollen nur sehen, die Channels, wo Users sind.

Hier ist unserer Code:

 

===============================

<div id="ts3viewer_******" style="width:; background-color:;"> </div>

 

<script type="text/javascript" src="http://static.tsviewer.com/short_expire/js/ts3viewer_loader.js"></script>

 

<script type="text/javascript">

<!--

var ts3v_url_1 = "http://www.tsviewer.com/ts3viewer.php?ID=******&text=000000&text_size=10&text_family=1&js=1&text_s_weight=bold&text_s_style=normal&text_s_variant=normal&text_s_decoration=none&text_s_color_h=F893D8&text_s_weight_h=bold&text_s_style_h=normal&text_s_variant_h=normal&text_s_decoration_h=underline&text_i_weight=normal&text_i_style=normal&text_i_variant=normal&text_i_decoration=none&text_i_color_h=F893D8&text_i_weight_h=normal&text_i_style_h=normal&text_i_variant_h=normal&text_i_decoration_h=underline&text_c_weight=normal&text_c_style=normal&text_c_variant=normal&text_c_decoration=none&text_c_color_h=F893D8&text_c_weight_h=normal&text_c_style_h=normal&text_c_variant_h=normal&text_c_decoration_h=underline&text_u_weight=bold&text_u_style=normal&text_u_variant=normal&text_u_decoration=none&text_u_color_h=F893D8&text_u_weight_h=bold&text_u_style_h=normal&text_u_variant_h=normal&text_u_decoration_h=none";

ts3v_display.init(ts3v_url_1, *******, 100);

-->

 

============================================

 

Ich weiß, ist alles durcheinander Das ist auch ein von den Problemen... :´(

 

Kann jemand mir helfen? :3

Danke

 

 
IP gespeichert
Seite: «  1 2 3 »

Templatebar.de - Die Plattform für Templates, Designs, Modifikationen und mehr!

 

Als Kunde findest du hier günstige Templates, Designs und Modifkationen und als Verkäufer eine einzigartige Verkaufsplattform für deine Produkte.

 

Schau am besten noch heute vorbei!

 

www.templatebar.de