Ergebnis 1 bis 5 von 5

Thema: Problem mit Teamspeak Viewer

  1. #1
    Interessierte/r
    Registriert seit
    11.03.2008
    Beiträge
    127
    Danke
    0
    Bekam 0 mal "Danke" in 0 Postings

    Standard Problem mit Teamspeak Viewer

    Hallo,

    ich habe mal wieder ein kleines Problem mit einer meiner Seiten.
    Auf der Seite meines Temaspeak Viewers wird oben mehrmals die folgende Zeile angezeigt:

    Warning: strftime() expects parameter 2 to be long, string given in /var/kunden/webs/sk0020web1/dateien/teamspeak/config.php on line 322

    Weiß vll jemand an was das liegt und wie ich da was ändern muss, damit die Meldung verschwindet?

    Hier noch der Quelltext der entsprechenden Datei:

    Code:
    <?php
    class tss2info &#123;
    
    // START OF CONFIG -------------------------------
    
    var $serverAddress = "82.220.2.23"; // Server IP
    var $serverQueryPort = "51234"; // TCP Port
    var $serverUDPPort = "8000"; // UDP Port
    var $serverPasswort = ""; // Serverpasswort
    
    // END OF CONFIG ---------------------------------
    
    var $refreshtime = 30;
    var $tabellenbreite = 300;
    var $sitetitle = "Teamspeak Viewer";
    
    //internal
    var $socket;
    var $userdata;
    
    // external
    var $serverStatus = "offline";
    var $playerList = array&#40;&#41;;
    var $channelList = array&#40;&#41;;
    
    
    // strips the quotes around a string
    function stripQuotes&#40;$evalString&#41; &#123;
      if&#40;strpos&#40;$evalString, '"'&#41; == 0&#41; $evalString = substr&#40;$evalString, 1, strlen&#40;$evalString&#41; - 1&#41;;
      if&#40;strrpos&#40;$evalString, '"'&#41; == strlen&#40;$evalString&#41; - 1&#41; $evalString = substr&#40;$evalString, 0, strlen&#40;$evalString&#41; - 1&#41;;
    
      return $evalString;
    &#125;// end function stripQuotes&#40;$evalString&#41;
    
    // returns the codec name
    function getVerboseCodec&#40;$codec&#41; &#123;
      if&#40;$codec == 0&#41; &#123;
        $codec = "CELP 5.1 Kbit";
      &#125; elseif&#40;$codec == 1&#41; &#123;
        $codec = "CELP 6.3 Kbit";
      &#125; elseif&#40;$codec == 2&#41; &#123;
        $codec = "GSM 14.8 Kbit";
      &#125; elseif&#40;$codec == 3&#41; &#123;
        $codec = "GSM 16.4 Kbit";
      &#125; elseif&#40;$codec == 4&#41; &#123;
        $codec = "CELP Windows 5.2 Kbit";
      &#125; elseif&#40;$codec == 5&#41; &#123;
        $codec = "Speex 3.4 Kbit";
      &#125; elseif&#40;$codec == 6&#41; &#123;
        $codec = "Speex 5.2 Kbit";
      &#125; elseif&#40;$codec == 7&#41; &#123;
        $codec = "Speex 7.2 Kbit";
      &#125; elseif&#40;$codec == 8&#41; &#123;
        $codec = "Speex 9.3 Kbit";
      &#125; elseif&#40;$codec == 9&#41; &#123;
        $codec = "Speex 12.3 Kbit";
      &#125; elseif&#40;$codec == 10&#41; &#123;
        $codec = "Speex 16.3 Kbit";
      &#125; elseif&#40;$codec == 11&#41; &#123;
        $codec = "Speex 19.5 Kbit";
      &#125; elseif&#40;$codec == 12&#41; &#123;
        $codec = "Speex 25.9 Kbit";
      &#125; else &#123;
        $codec = "unknown &#40;".$codec."&#41;";
      &#125;// end if
      return $codec;
    &#125;// end function getVerboseCodec&#40;$codec&#41;;
    
      function getInfo&#40;&#41; &#123;
    	$this->playerList = $this->getUserInfo&#40;$this->serverAddress, $this->serverQueryPort, $this->serverUDPPort&#41;;
    	$this->channelList = $this->getChannelInfo&#40;$this->serverAddress, $this->serverQueryPort, $this->serverUDPPort&#41;;
      &#125; // end getInfo&#40;&#41;
    
      function getChannelInfo&#40;$server_ip, $server_query, $server_port&#41; &#123;
    	$channelList = array&#40;&#41;;
        $cmd = "cl $server_port\nquit\n";
    
        $connection = fsockopen &#40;"$server_ip", $server_query, &$errno, &$errstr, 1&#41;;
        if &#40;!$connection&#41; &#123;
          echo "Cannot connect&#58; &#40;$errno&#41;-$errstr
    ";
        &#125; else &#123;
    	  $error = fputs&#40;$connection,$cmd, strlen&#40;$cmd&#41;&#41;;
    	  if &#40;!$error&#41; &#123;
    	  	echo "Cannot read Data!
    ";
    	  &#125; else &#123;
    	  
    		  while&#40;$channeldata = fgets&#40;$connection, 4096&#41;&#41; &#123;
    			$channeldata = explode&#40;"	", $channeldata&#41;;
    			$channeldata0 = trim&#40;$channeldata&#91;0&#93;&#41;;  // number
    			$channeldata1 = trim&#40;$channeldata&#91;1&#93;&#41;;  // codec
    			$channeldata2 = trim&#40;$channeldata&#91;2&#93;&#41;;  // parent
    			$channeldata3 = trim&#40;$channeldata&#91;3&#93;&#41;;  // order
    			$channeldata4 = trim&#40;$channeldata&#91;4&#93;&#41;;  // maxuser
    	
    			$channeldata5 = trim&#40;"$channeldata&#91;5&#93;"&#41;;
    			$channeldata5 = substr&#40;"$channeldata5", 1&#41;;
    			$channeldata5 = substr&#40;"$channeldata5", 0, -1&#41;;
    			$channeldata5 = addslashes&#40;"$channeldata5"&#41;; // name
    			$channeldata5 = htmlentities&#40;"$channeldata5"&#41;;
    			 // $channeldata5 = addslashes&#40;trim&#40;$channeldata&#91;5&#93;&#41;&#41;;  // name
    	
    			$channeldata6 = trim&#40;$channeldata&#91;6&#93;&#41;;  // channel flags
    			$channeldata7 = trim&#40;$channeldata&#91;7&#93;&#41;;  // priv/pub
    			
    			$channeldata8 = trim&#40;"$channeldata&#91;8&#93;"&#41;;
    			$channeldata8 = substr&#40;"$channeldata8", 1&#41;;
    			$channeldata8 = substr&#40;"$channeldata8", 0, -1&#41;;
    			$channeldata8 = addslashes&#40;htmlspecialchars&#40;"$channeldata8"&#41;&#41;; // topic
    			 // $channeldata8 = addslashes&#40;htmlspecialchars&#40;trim&#40;$channeldata&#91;8&#93;&#41;&#41;&#41;;  // topic
    			
    			$channelid = $channeldata0;
    			if &#40;$channelid > 0&#41; &#123;
    				$channelList&#91;$channelid&#93; = array&#40;
    				  "channelid" => $channelid,
    				  "codec" => $channeldata1,
    				  "parent" => $channeldata2,
    				  "order" => $channeldata3,
    				  "maxplayers" => $channeldata4,
    				  "channelname" => $channeldata5,
    				  "attribute" => $this->get_channel_flags&#40;$channeldata6&#41;,
    				  "isdefault" => 0,
    				  "topic" => $channeldata8&#41;;
    			&#125;
    		  &#125;
    	  &#125;
          fclose&#40;$connection&#41;;
        &#125;
    	
    	
    	function cmp &#40;$a, $b&#41; &#123;
    	  if &#40;$a&#91;"order"&#93; == $b&#91;"order"&#93;&#41; &#123;
    	  	return &#40;$a&#91;"channelid"&#93; < $b&#91;"channelid"&#93;&#41; ? -1 &#58; 1;
    	  &#125;//return 0;
          return &#40;$a&#91;"order"&#93; < $b&#91;"order"&#93;&#41; ? -1 &#58; 1;
    	&#125;
    	usort&#40;$channelList, "cmp"&#41;;
    	
    	
    	return $channelList;
      &#125;
    
      function getUserInfo&#40;$server_ip, $server_query, $server_port&#41; &#123;
    	$playerList = array&#40;&#41;;
        $cmd = "pl $server_port\nquit\n";
    
        $connection = fsockopen &#40;"$server_ip", $server_query, &$errno, &$errstr, 1&#41;;
        if &#40;!$connection&#41; &#123;
          echo "Cannot connect&#58; &#40;$errno&#41;-$errstr
    ";
        &#125; else &#123;
          fputs&#40;$connection,$cmd, strlen&#40;$cmd&#41;&#41;;
          while&#40;$userdata = fgets&#40;$connection, 4096&#41;&#41; &#123;
            $userdata = explode&#40;"	", $userdata&#41;;
            $userdata0 = trim&#40;$userdata&#91;0&#93;&#41;;  // pl_id
            $userdata1 = trim&#40;$userdata&#91;1&#93;&#41;;  // pl_channelid
            $userdata2 = trim&#40;$userdata&#91;2&#93;&#41;;  // pl_pktssend
            $userdata3 = trim&#40;$userdata&#91;3&#93;&#41;;  // pl_bytessend
            $userdata4 = trim&#40;$userdata&#91;4&#93;&#41;;  // pl_pktsrecv
            $userdata5 = trim&#40;$userdata&#91;5&#93;&#41;;  // pl_bytesrecv
            $userdata6 = trim&#40;$userdata&#91;6&#93;&#41;;  // pl_pktloss
            $userdata7 = trim&#40;$userdata&#91;7&#93;&#41;;  // pl_ping
            $userdata8 = trim&#40;$userdata&#91;8&#93;&#41;;  // pl_logintime
            $userdata9 = trim&#40;$userdata&#91;9&#93;&#41;;  // pl_idletime
            $userdata10 = trim&#40;$userdata&#91;10&#93;&#41;;  // pl_channelprivileges
            $userdata11 = trim&#40;$userdata&#91;11&#93;&#41;;  // pl_playerprivileges
            $userdata12 = trim&#40;$userdata&#91;12&#93;&#41;;  // pl_playerflags
            $userdata13 = trim&#40;$userdata&#91;13&#93;&#41;;  // pl_ipaddress
    
            $userdata14 = trim&#40;"$userdata&#91;14&#93;"&#41;;
            $userdata14 = substr&#40;"$userdata14", 1&#41;;
            $userdata14 = substr&#40;"$userdata14", 0, -1&#41;;
            $userdata14 = addslashes&#40;"$userdata14"&#41;;
    		$userdata14 = htmlentities&#40;"$userdata14"&#41;; // pl_nickname
    		  // $userdata14 = addslashes&#40;trim&#40;$userdata&#91;14&#93;&#41;&#41;;  // pl_nickname
    
            $userdata15 = trim&#40;"$userdata&#91;15&#93;"&#41;;
            $userdata15 = substr&#40;"$userdata15", 1&#41;;
            $userdata15 = substr&#40;"$userdata15", 0, -1&#41;;
            $userdata15 = addslashes&#40;"$userdata15"&#41;; // pl_loginname
              // $userdata15 = addslashes&#40;trim&#40;$userdata&#91;15&#93;&#41;&#41;;  // pl_loginname
    
    		$playerid = $userdata0;
    		
    		$playerList&#91;$playerid&#93; = array&#40;
    		  "playerid" => $playerid,
    		  "channelid" => $userdata1,
    		  "receivedpackets" => $userdata4,
    		  "receivedbytes" => $userdata5,
    		  "sentpackets" => $userdata2,
    		  "sentbytes" => $userdata3,
    		  "paketlost" => $userdata6 / 100,
    		  "pingtime" => $userdata7,
    		  "totaltime" => $this->setTimeString&#40;$userdata8&#41;,
    		  "idletime" => $this->setTimeString&#40;$userdata9&#41;,
    		  "privileg" => $userdata10,
    		  "userstatus" => $userdata11,
    		  "attribute" => $this->getUserStatusBild&#40;$userdata12&#41;,
    		  "flags" => $this->get_player_flags&#40;$userdata11,$userdata10&#41;,
    		  "s" => $userdata13,
    		  "playername" => $userdata14&#41;;
          &#125;
          fclose&#40;$connection&#41;;
        &#125;
    	return $playerList;
      &#125;
      
      function get_player_flags&#40;$num1,$num2&#41; &#123;
          if &#40;$num1 == '13'&#41; &#123;
            $plpriv = "&#40;R SA";
          &#125; else if &#40;$num1 == '5'&#41; &#123;
            $plpriv = "&#40;R SA";
          &#125; else if &#40;$num1 == '4'&#41; &#123;
            $plpriv = "&#40;R";
          &#125; else if &#40;$num1 < '4'&#41; &#123;
            $plpriv = "&#40;U";
          &#125;
          if &#40;$num2 == '1'&#41; &#123;
            $clpriv = " CA&#41;";
          &#125; else &#123;
            $clpriv = "&#41;";
          &#125;
    	  return $plpriv.$clpriv;
      &#125;
      
      function get_channel_flags&#40;$num&#41; &#123;
    	 // &#40;RMPSD&#41; &#40;0 2 4 6 8 16&#41;
          if &#40;$num == '30'&#41; &#123;
            $clflag = "&#40;RMPSD&#41;";
          &#125; else if &#40;$num == '28'&#41; &#123;
            $clflag = "&#40;RPSD&#41;";
          &#125; else if &#40;$num == '26'&#41; &#123;
            $clflag = "&#40;RMSD&#41;";
          &#125; else if &#40;$num == '24'&#41; &#123;
            $clflag = "&#40;RSD&#41;";
          &#125; else if &#40;$num == '22'&#41; &#123;
            $clflag = "&#40;RMPD&#41;";
          &#125; else if &#40;$num == '20'&#41; &#123;
            $clflag = "&#40;RPD&#41;";
          &#125; else if &#40;$num == '18'&#41; &#123;
            $clflag = "&#40;RMD&#41;";
          &#125; else if &#40;$num == '16'&#41; &#123;
            $clflag = "&#40;RD&#41;";
          &#125; else if &#40;$num == '15'&#41; &#123;
            $clflag = "&#40;UMPS&#41;";
          &#125; else if &#40;$num == '14'&#41; &#123;
            $clflag = "&#40;RMPS&#41;";
          &#125; else if &#40;$num == '13'&#41; &#123;
            $clflag = "&#40;UPS&#41;";
          &#125; else if &#40;$num == '12'&#41; &#123;
            $clflag = "&#40;RPS&#41;";
          &#125; else if &#40;$cldata&#91;9&#93; == '11'&#41; &#123;
            $clflag = "&#40;UMS&#41;";
          &#125; else if &#40;$num == '10'&#41; &#123;
            $clflag = "&#40;RMS&#41;";
          &#125; else if &#40;$num == '9'&#41; &#123;
            $clflag = "&#40;US&#41;";
          &#125; else if &#40;$num == '8'&#41; &#123;
            $clflag = "&#40;RS&#41;";
          &#125; else if &#40;$num == '7'&#41; &#123;
            $clflag = "&#40;UMP&#41;";
          &#125; else if &#40;$num == '6'&#41; &#123;
            $clflag = "&#40;RMP&#41;";
          &#125; else if &#40;$num == '5'&#41; &#123;
            $clflag = "&#40;UP&#41;";
          &#125; else if &#40;$num == '4'&#41; &#123;
            $clflag = "&#40;RP&#41;";
          &#125; else if &#40;$num == '3'&#41; &#123;
            $clflag = "&#40;UM&#41;";
          &#125; else if &#40;$num == '2'&#41; &#123;
            $clflag = "&#40;RM&#41;";
          &#125; else if &#40;$num == '1'&#41; &#123;
            $clflag = "&#40;U&#41;";
          &#125; else if &#40;$num == '0'&#41; &#123;
            $clflag = "&#40;R&#41;";
          &#125; else &#123;
            $clflag = "";
          &#125;
    	return $clflag;
      &#125;
      
    function getUserStatusBild&#40;$attribut&#41; &#123;
    	  //-------------------------------------------------------------------------------------------------
    	//--- UserStatusBild --\\
    	$playergif = "player.gif";
    	if &#40;$attribut == "0"&#41; $playergif = "player.gif";
    	if &#40;&#40;$attribut == "8"&#41; or
    		&#40;$attribut == "9"&#41; or
    		&#40;$attribut == "12"&#41; or
    		&#40;$attribut == "13"&#41; or
    		&#40;$attribut == "24"&#41; or
    		&#40;$attribut == "25"&#41; or
    		&#40;$attribut == "28"&#41; or
    		&#40;$attribut == "29"&#41; or
    		&#40;$attribut == "40"&#41; or
    		&#40;$attribut == "41"&#41; or
    		&#40;$attribut == "44"&#41; or
    		&#40;$attribut == "45"&#41; or
    		&#40;$attribut == "56"&#41; or
    		&#40;$attribut == "57"&#41;&#41; $playergif = "away.gif";
    	if &#40;&#40;$attribut == "16"&#41; or
    		&#40;$attribut == "17"&#41; or
    		&#40;$attribut == "20"&#41; or
    		&#40;$attribut == "21"&#41;&#41; $playergif = "mutemicro.gif";
    	if &#40;&#40;$attribut == "32"&#41; or
    		&#40;$attribut == "33"&#41; or
    		&#40;$attribut == "36"&#41; or
    		&#40;$attribut == "37"&#41; or
    		&#40;$attribut == "48"&#41; or
    		&#40;$attribut == "49"&#41; or
    		&#40;$attribut == "52"&#41; or
    		&#40;$attribut == "53"&#41;&#41; $playergif = "mutespeakers.gif";
    	if &#40;$attribut == "4"&#41; $playergif = "player.gif";
    	if &#40;&#40;$attribut == "1"&#41; or
    		&#40;$attribut == "5"&#41;&#41; $playergif = "channelcommander.gif";
    	if  &#40;$attribut >= "64"&#41; $playergif = "record.gif";
    	//--- UserStatusBild --\\
    	//-------------------------------------------------------------------------------------------------
    	return $playergif;
    &#125;
    function setTimeString&#40;$time&#41; &#123;
    	$timestring = "0 Sekunden";
    	if &#40;$time < 60 &#41; &#123;
    	 $timestring = strftime&#40;"%S Sekunden", $time&#41;;
    	&#125; else &#123;
    	   if &#40;$time >= 3600 &#41; &#123;
    	    $timestring = strftime&#40;"%H&#58;%M&#58;%S Stunden", $time - 3600&#41;;
    	   &#125; else &#123;
    	     $timestring = strftime&#40;"%M&#58;%S Minuten", $time&#41;;
    	   &#125;
    	&#125;
    	return htmlentities&#40;"$timestring"&#41;;
    &#125;
    
    &#125;
    $tss2info = new tss2info;
    ?>
    Schonmal vielen Dank für eure Hilfe!
    Achtung: Dies ist ein alter Thread im HTML und Webmaster Forum
    Diese Diskussion ist älter als 90 Tage. Die darin enthaltenen Informationen sind möglicherweise nicht mehr aktuell. Erstelle bitte zu deiner Frage ein neues Thema im Forum !!!!!
    Wer kämpft kann verlieren, wer nicht kämpft hat schon verloren!

  2. #2
    Großmeister(in) Avatar von R3WARD
    Registriert seit
    08.02.2008
    Ort
    localhost
    Beiträge
    597
    Danke
    0
    Bekam 0 mal "Danke" in 0 Postings

    Standard

    Funktioniert der TSViewer?
    und du möchtest jetzt nur die Fehlermeldung weghaben?

  3. #3
    Interessierte/r
    Themenstarter

    Registriert seit
    11.03.2008
    Beiträge
    127
    Danke
    0
    Bekam 0 mal "Danke" in 0 Postings

    Standard

    Genau, der TS V funktioniert ohne Probleme, nur steht darüber 5 mal diese Fehlermeldung!
    Wer kämpft kann verlieren, wer nicht kämpft hat schon verloren!

  4. #4
    König(in) Avatar von sudeki05
    Registriert seit
    04.05.2006
    Ort
    Hamburg
    Alter
    28
    Beiträge
    1.435
    Danke
    0
    Bekam 0 mal "Danke" in 0 Postings

    Standard

    Dann unterdrücke ggf die Fehlermeldung mit einem @ vor strftime()

    mach aus strftime() im QT immer: @strftime()

    dh:
    Code:
    function setTimeString&#40;$time&#41; &#123;
       $timestring = "0 Sekunden";
       if &#40;$time < 60 &#41; &#123;
        $timestring = strftime&#40;"%S Sekunden", $time&#41;;
       &#125; else &#123;
          if &#40;$time >= 3600 &#41; &#123;
           $timestring = strftime&#40;"%H&#58;%M&#58;%S Stunden", $time - 3600&#41;;
          &#125; else &#123;
            $timestring = strftime&#40;"%M&#58;%S Minuten", $time&#41;;
          &#125;
       &#125;
       return htmlentities&#40;"$timestring"&#41;;
    &#125;
    ändern in:
    Code:
    function setTimeString&#40;$time&#41; &#123;
       $timestring = "0 Sekunden";
       if &#40;$time < 60 &#41; &#123;
        $timestring = @strftime&#40;"%S Sekunden", $time&#41;;
       &#125; else &#123;
          if &#40;$time >= 3600 &#41; &#123;
           $timestring = @strftime&#40;"%H&#58;%M&#58;%S Stunden", $time - 3600&#41;;
          &#125; else &#123;
            $timestring = @strftime&#40;"%M&#58;%S Minuten", $time&#41;;
          &#125;
       &#125;
       return htmlentities&#40;"$timestring"&#41;;
    &#125;

    Problems with Windows? - Reboot
    Problems with UNIX? - Be Root

  5. #5
    Interessierte/r
    Themenstarter

    Registriert seit
    11.03.2008
    Beiträge
    127
    Danke
    0
    Bekam 0 mal "Danke" in 0 Postings

    Standard

    Vielen Dank sudeki05, hat wunderbar funktioniert!
    Wer kämpft kann verlieren, wer nicht kämpft hat schon verloren!

Ähnliche Themen

  1. Teamspeak Viewer PHP Problem
    Von Ole im Forum PHP Forum - Apache - CGI - Perl - JavaScript und Co.
    Antworten: 7
    Letzter Beitrag: 10.03.2009, 17:34
  2. Teamspeak Sever problem
    Von Kralle im Forum Off Topic und Quasselbox
    Antworten: 17
    Letzter Beitrag: 12.06.2008, 16:27
  3. Teamspeak Viwer - Problem
    Von firefigther im Forum HTML & CSS Forum
    Antworten: 0
    Letzter Beitrag: 21.01.2008, 16:24
  4. Teamspeak - Viewer
    Von chris90night im Forum Computer - Internet Forum
    Antworten: 1
    Letzter Beitrag: 13.12.2006, 16:05
  5. Teamspeak php Problem
    Von eraserx im Forum PHP Forum - Apache - CGI - Perl - JavaScript und Co.
    Antworten: 4
    Letzter Beitrag: 07.10.2004, 05:56

Stichworte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •