Forum

Results 1 to 3 of 3
  1. #1
    Join Date
    December 2014
    Location
    Chile
    Posts
    13

    i need script for show icon of servergroup

    Hi, I'm putting together a small script to change ranges via web, and I'm in the part where ready available ranges (based on sort_id) but not how to make it show a picture of the range and tried some codes but give error and no I know how to fix it ...
    PHP Code:
     <?php
            session_start
    ();
            
    $_SESSION['client_uid'] = $_GET['uniid'];
            
    $client_uid $_SESSION['client_uid'];
          
           
        try {
            
            
    $connect "serverquery://".$USER_QUERY.":".$PASS_QUERY."@".$HOST_QUERY.":".$PORT_QUERY."/?server_port=".$SERVER_PORT."";
            
    $ts3_VirtualServer TeamSpeak3::factory($connect);
            
    $ts3_VirtualServer->execute("clientupdate", array("client_nickname" => 'Manager Group'));
            
    //$ts3_VirtualServer->message("TEST - Vengo a tomar datos :D");
            //$client = $ts3_VirtualServer->clientGetByUid($client_uid);
            
    $client $ts3_VirtualServer->clientGetByUid($client_uid);
            
    //print_r($client);
            
    $userlist $ts3_VirtualServer->clientList();      
            
    //print_r($userlist);    
            //$iconos = $ts3_VirtualServer->iconDownload();        
            //print_r($iconos);
            
    echo "ID obtenida: ".$client_uid."<br>";
            if(
    $client["client_nickname"] ==  'Manager Group') {
                echo 
    "Ultimo nombre usado: NO DISPONIBLE<br>";
            } else {
                echo 
    "Ultimo nombre usado: ".$client["client_nickname"]."<br>";
            }
            
            echo 
    "Procesando el sistema <br>";
            
    $listagroups $ts3_VirtualServer->serverGroupList();
                    echo 
    "<form name='formulario' method='get' action='guardargrupos.php'>";
            
            foreach(
    $listagroups as $groups)
            {
                
    //$icons = $groups->getIcon();
                    
                //print_r($icons);
                
    if($groups["sortid"] == $SID_GROUP) {
                
    $miembros $ts3_VirtualServer->serverGroupClientList($groups["sgid"]);
                
    $estaengrupo False;
                foreach(
    $miembros as $m) {
                    if(
    $m["client_unique_identifier"] == $client_uid) {                    
                                            
    $estaengrupo True;
                    }
                            
                    
                }
                           
    //Show Icon for Group listed...
                            
    if (file_exists($cachefile)) {
                                
    $img file_get_contents($cachefile);
                            } else {
                                
    $query = new TSQuery($HOST_QUERY$PORT_QUERY);
                                if (
    $config['login_needed']) {
                                    
    $query->login($USER_QUERY$PASS_QUERY);
                                }

                                
    $query->use_by_port($SERVER_PORT);
                                
    $img $query->download("/icon_" $m['sid'], 0);
                                
    $query->quit();
                                
    $file fopen($cachefile"wb");
                                
    fwrite($file$img);
                                
    fclose($file);
                            }
                            
    //header("Content-Type: image/png");
                            
    echo $img;
                            
                            
                            if(
    $estaengrupo) {
                                echo 
    " <input type=checkbox value=".$m["cldbid"]." name='group[]' checked >".$groups["name"]."<br>";
                            } else {
                                echo 
    " <input type=checkbox value=".$m["cldbid"]." name='group[]' >".$groups["name"]."<br>";
                            }
                            
                           
                            
                }
                
            }
                     echo 
    "<input type=submit name=save value='Guardar'><br></FORM>";
                     
        } catch(
    Exception $e) {
            echo 
    "[DEBUG] Ha ocurrido un error inesperado <br>";
            echo 
    "[DEBUG] Mensaje de error DEBUG: ".$e->getMessage()."<br>";
            echo 
    "[DEBUG] El codigo de error fue ".$e->getCode()."<br>";
            if(
    $e->getCode() == 0) {
                echo 
    "Error desconocido. Metodo invalido";
            } else if(
    $e->getCode() == 10060) { //Codigo de error de error en la conexion
                        
    echo "No se pudo conectar con el servidor de teamspeak 3";
            } else if(
    $e->getCode() == 512) { //Codigo de error cuando la UUID no es valida
                        
    echo "La UUID ingresada no es valida o no esta actualmente conectada al ts3";
            } else if(
    $e->getCode() == 520) { //Codigo de error cuando login o pass estan mal
                        
    echo "Los datos de acceso query no son correctos";
            } else if(
    $e->getCode() == 3329) { //Codigo de error cuando la conexion fue baneada por el tsquery
                        
    echo "La conexion fue baneada por query. Intenta mas tarde";
            }
            
        }
    This is the error... http://prntscr.com/6aln4p
    Not if the method is correct ...
    Last edited by MrDoc; February 27th, 2015 at 08:38 PM. Reason: More info

  2. #2
    Join Date
    June 2011
    Location
    Germany
    Posts
    4,368
    You don't want to post your error, we don't want to post an answer.

  3. #3
    Join Date
    December 2014
    Location
    Chile
    Posts
    13
    Quote Originally Posted by numma_cway View Post
    You don't want to post your error, we don't want to post an answer.
    The error: http://prntscr.com/6aln4p
    You do not know if I'm doing the method to obtain the image is right also ...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem with icon in ServerGroup that no longer exists
    By M4LV4D0 in forum Linux / FreeBSD
    Replies: 0
    Last Post: June 17th, 2011, 01:04 AM
  2. [Lua Plugin] Enable script to add clients to servergroup/channel group
    By willy_sunny in forum Suggestions and Feedback
    Replies: 0
    Last Post: April 18th, 2011, 08:55 PM
  3. [bug]Check mark does not show in servergroup menu
    By willy_sunny in forum Bug Reports [EN/DE]
    Replies: 2
    Last Post: April 19th, 2010, 11:34 AM
  4. [Help] Token add and Show Script
    By Siggi in forum Tools / Web Based
    Replies: 5
    Last Post: January 15th, 2010, 08:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •