Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Page 75 of 100 FirstFirst ... 2565737475767785 ... LastLast
Results 1,111 to 1,125 of 1498
  1. #1111
    Join Date
    July 2015
    Posts
    4

    Userfield UID Register

    Hello everybody,

    I'm trying for days a user field to build that allows my users to register profile about her and entering the UID you in the added in the respective group are somehow get I do not really go anywhere I'll probably a little mistake.

    It may of course be that my plan also does not work like I want it for my TeamSpeak runs on standard SQLite and the transmitted query to be given is mysql.

    Now the answers come then make your TeamSpeak but on MariaDB no I would not.

    We come just once to the code you'll see that perhaps more than I:

    Config:
    Code:
    require_once('ts3framework/libraries/TeamSpeak3/TeamSpeak3.php');
    include LOCALE.LOCALESET."English/user_fields/user_ts3register.php";
    // teamspeak3 connection stuff
    $server = array( 
            "tsip" => "xxx.xxx.xxx.xxx",
            "tsport" => "xxx",
            "ts_query_admin" => "xxx",
            "ts_query_password" => "xxx",
            "ts_query_port" => "xxx",
            "ts_query_user_nick" => "Register Bot"
        );
        try {
            TeamSpeak3::init();
            $ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$server["ts_query_admin"].":".$server["ts_query_password"]."@".$server["tsip"].":".$server["ts_query_port"]."/?server_port=".$server["tsport"]."&nickname=".$server["ts_query_user_nick"]."");
            
            foreach($ts3_VirtualServer->clientListDb() as $ts3_Client)
            {
                if($ts3_Client["client_unique_identifier"] == "".$data['user_ts3register']."")
                {
                    try {
                        $ts3_VirtualServer->serverGroupClientAdd(162, $ts3_Client["cldbid"]);
                        echo "".$userdata['user_name']." ".$locale['uf_ts3register003']."";
                    }
                    catch( Exception $e)
                    {
                        echo "".$locale['uf_ts3register004']." ".$userdata['user_name']." ".$locale['uf_ts3register005']."<br/>".$locale['uf_ts3register006']." <b>". $e->getCode() ."</b>; ".$locale['uf_ts3register007']." <b>". $e->getMessage() ."</b>;";
                    }
                }
            } 
        } catch(Exception $e) {
            echo "".$locale['uf_ts3register008']."<br/>".$locale['uf_ts3register006']." <b>". $e->getCode() ."</b>; ".$locale['uf_ts3register007']." <b>". $e->getMessage() ."</b>;";
        }
    Profilfield:
    Code:
    if (!defined("IN_FUSION")) { die("Access Denied"); }
    require_once BASEDIR."ts3framework/ts3_register_config.php";
    
    if ($profile_method == "input") {
    
    // Create the input field for registration and edit profile
    echo "<tr>\n";
    echo "<td class='tbl'>".$locale['uf_ts3register']."</td>\n";
    echo "<td class='tbl'><input type='text' name='user_ts3register' value='".(isset($user_data['user_ts3register']) ? $user_data['user_ts3register'] : "")."' maxlength='250' class='textbox' placeholder='deiKAkJedikOhEpPN1/bdtYBrM4=' style='width:200px;' /></td>\n";
    echo "</tr>\n";
    } elseif ($profile_method == "display") {
    
    // Create the display for the user profile
    if ($user_data['user_ts3register']) {
    echo "<tr>\n";
    echo "<td class='tbl1' colspan='2'>".$locale['uf_ts3register001']."</td>\n";
    		} else {
    echo "<td class='tbl1' colspan='2'>".$locale['uf_ts3register002']."</td>\n";
    		}
    
    // Insert and update
    } elseif ($profile_method == "validate_insert"  || $profile_method == "validate_update") {
    	// Get input data
    	if (isset($_POST['user_ts3register']) && ($_POST['user_ts3register'] != "" || $this->_isNotRequired("user_ts3register"))) {
    		// Set update or insert user data
    		$this->_setDBValue("user_ts3register", stripinput($_POST['user_ts3register']));
    		} else {
    			$this->_setError("user_ts3register", $locale['uf_ts3register_error2']);	
    		}
    	} else {
    		$this->_setError("user_ts3register", $locale['uf_ts3register_error'], true);
    	}
    Greeting Pairin

  2. #1112
    Join Date
    July 2015
    Posts
    1
    Quote Originally Posted by FredC View Post
    When im trying to set icon id to clients I get an error sometimes:

    Example:
    Icon ID = 2580864732
    When doing:
    $ts3->clientGetById(154)->permAssign("i_icon_id", "2580864732");
    PHP shows:
    'convert error' in /Reply.php:319

    After I edited the client manually, i tried to get the icon id using permList(); and got a different icon id (-1714102564)
    So I tried replacing the id by the new one and it worked
    $ts3->clientGetById(154)->permAssign("i_icon_id", "-1714102564");

    I tested a couple more icons, and some of them worked.. Anyone know how can I get the exact id of the icons?

    When using this code the upload is made, but the icon id doesnt always work
    $data = img raw data
    $iconId = $ts3->iconUpload($data);
    I know this is very late, but I struggled with this as well and realized that there is an issue that the developers may want to address.

    When TeamSpeak3_Node_Server>iconUpload() is called, it generates an icon image id by calling crc32() on the data. The issue with this is that crc32() can create integer values beyond the maximum int32 value, 2,147,483,647. The icon image id generated from your upload is 2580864732, which is above the maximum int32 value, so it creates errors when permAssign() attempts to query your server.

    I solved this by going into the TeamSpeak3_Node_Server php file and creating a new function called iconUploadSmall(). iconUploadSmall() is identical to iconUpload(), except the icon image id is limited to 8 digits as opposed to 10. I do this by modifying $crc, the generated icon image id, and cutting off the first two digits, limiting it to 8 and guaranteeing that it will not exceed the int max.

    I am a bit of a php beginner, so if I am wrong with anything I have done, somebody please correct me. Since implementing this, I have not run into any issues with assigning generated i_icon_id's to server groups.

  3. #1113
    Join Date
    July 2015
    Posts
    1
    Hello guys,
    I'm trying to make "Welcome" bot with php framework.
    i cant find any example
    I would like every everyone who is connecting on server to receive Welcome message.

  4. #1114
    Join Date
    July 2015
    Posts
    3

    Probleme Script php TeamSpeak 3 Framework

    Hi all, it's my first post.

    I have a little probleme i need script php for Date / Hour on channel by minute teamspeak.

    This is my code:

    HTML Code:
    <?php
    
    $date = date("D d F Y");
    $heure = date("H:i:s");
    
    
    require_once('libraries/TeamSpeak3/TeamSpeak3.php');
        $server = array(
            "tsip" => "localhost",
            "tsport" => "9987",
            "ts_query_admin" => "serveradmin",
            "ts_query_password" => "password",
            "ts_query_port" => "10011",
            "ts_channel_id" => "254", 
        );
    try
    {
      TeamSpeak3::init();
      /* connect to server, login and get TeamSpeak3_Node_Server object by URI */
      $ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$server["ts_query_admin"].":".$server["ts_query_password"]."@".$server["tsip"].":".$server["ts_query_port"]."/?server_port=".$server["tsport"]."&channel_id=".$server["ts_channel_id"]."");
    
      /* Edit channel and get new ID */
      echo "Edit channel with date on virtual server " . $ts3_VirtualServer . " ... ";
      $channel_id = $ts3_VirtualServer->channeledit("254");
    if( $channel_id->edit(TeamSpeak3::CHANNEL_modify, "$date $heure") );
    echo "dudududu";
    
    }
    catch(Exception $e)
    {
      echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
    }
    
    ?>
    
    ?>
    and my result is "Error (ID 0) node method 'channeledit()' does not exist ?>"

    and i need refresh by minute so i include
    HTML Code:
    $page = $_SERVER['PHP_SELF'];
     $sec = "60";
     header("Refresh: $sec; url=$page");
    i don't understand really and sorry for my english and please help me <3

  5. #1115
    Join Date
    September 2012
    Posts
    6,079
    Quote Originally Posted by Feujerie View Post
    Code:
      /* Edit channel and get new ID */
      $channel_id = $ts3_VirtualServer->channeledit("254");
    Needs to be
    PHP Code:
    $channel $ts3_VirtualServer->channelGetById($server["ts_channel_id"]); 
    then you'll need to call modify on that channel object with the properties you'd like to change, which probably is the channel name, in which case you'd do something along the lines of
    PHP Code:
    $change = array( 'channel_name' => date("D d F Y H:i:s"));
    $channel->modify($change); 
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  6. #1116
    Join Date
    July 2015
    Posts
    3

    Nice and now with [cspacer0]

    Nice it's ok now really thank you dude, and with [cspacer0] ?? Where do I add it ?

    HTML Code:
    $change = array( 'channel_name' => date("D d F Y H:i:s"));

  7. #1117
    Join Date
    July 2015
    Posts
    3

    it's ok i found it

    ok for cspacer it's:

    HTML Code:
      $change = array( 'channel_name' => "[cspacer0] $date");

  8. #1118
    Join Date
    August 2015
    Posts
    1
    Ik ben op zoek naar alle velden die beschikbaar zijn voor de clients bij het opvragen van de verschillende clients op een server.
    Voorbeeld:
    PHP Code:
    $clients $ts3->clientList();
    foreach(
    $clients as $client)
    {
     echo 
    $client["client_platform"] . "<br />\n";

    Ik heb een aantal velden maar ben op zoek naar alle beschikbare velden.

    Met het PHP Framework kan je een TreeView afdrukken van de server met ->getViewer().
    Maar waar kan ik de broncode terugvinden om zelf delen van de gegenereerde html/php code aan te passen?
    Ik zou namelijk graag de TreeView in panels/tabellen steken met bootstrap.

  9. #1119
    Join Date
    September 2014
    Posts
    23

    Get id by ip [ Teamspeak API ]

    i have this and i was hoping that you can tell me is it correct or not




    PHP Code:
    $ip=getenv('REMOTE_ADDR');

    foreach(
    $ts3_VirtualServer->clientList() as $forc)
        {
            if(
    $forc["client_type"]) continue;
            
    $forcinfo $forc->getInfo();
        if(
    $forcinfo['connection_client_ip'] == $ip$clientid $forc['clid']; 
        
        } 
    My qustion here is how would i be able to get "cldid" by ip adress

    and if the user joins from 2 identities or more he get the massage echo'you join from'.$nicknams
    and if the ip dosent match the identity he recives the massge 'You are not in the server'

    Thanks in advance for any help given.
    Last edited by a3DaM; August 14th, 2015 at 03:45 PM.

  10. #1120
    Join Date
    August 2015
    Posts
    1

    Check if user is online/offline based on Uid

    Hi! I'm making a webservice and is trying to check if a user is online or offline based on Unique Identifier.
    The code I have now is returning "false" still when the user is logged on TS. Help please....

    PHP Code:
            $uid $_POST['uid'];
            
    $username $ts3_VirtualServer->clientGetNameByUid($uid);
            
    $clientList $ts3_VirtualServer->clientList();   
                   
            echo 
    $username;
            if(
    in_array($username$clientList)) {
                echo 
    "true";
            } else {
                echo 
    "false";
            } 
    Thanks in advance for any help given.
    - Mats[/QUOTE]

  11. #1121
    Join Date
    December 2006
    Location
    Denmark
    Posts
    25

    Stats

    How do I create stats like this with TS3 PHP Framework ?

    http://2.t.imgbox.com/GAne72ai.jpg

  12. #1122
    Join Date
    September 2014
    Posts
    23
    Hello how i can use if to check body by cldbid in servergroup [sgid]

  13. #1123
    Join Date
    March 2015
    Location
    South coast, England, UK
    Posts
    26

    Add someone to a group

    Hello,
    I'm looking for a way to add a user to a group in teamspeak.
    I am using a simple html form for the frontend but how would I do this in the php?

    Thanks
    James

  14. #1124
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by MatsA View Post
    Hi! I'm making a webservice and is trying to check if a user is online or offline based on Unique Identifier.
    The code I have now is returning "false" still when the user is logged on TS. Help please....
    As clientGetByUid() throws an exception if no matching client was found, this can be done with a simple try-catch block:

    PHP Code:
    try
    {
       
    $client $server->clientGetByUid($uid);

      echo 
    "Client is online.";
    }
    catch()
    {
      echo 
    "Client is offline."

    $client is a TeamSpeak3_Node_Client object you can use for further interaction.




    Quote Originally Posted by JonathanNet View Post
    How do I create stats like this with TS3 PHP Framework ?

    http://2.t.imgbox.com/GAne72ai.jpg
    Here's a jsFiddle:

    https://jsfiddle.net/3gn1ak87/




    Quote Originally Posted by a3DaM View Post
    Hello how i can use if to check body by cldbid in servergroup [sgid]
    Simple...

    PHP Code:
    $sgroups $server->clientGetServerGroupsByDbid($cldbid);

    if(
    array_key_exists($sgid$sgroups))
    {
      echo 
    "Client is member of group.";


  15. #1125
    Join Date
    September 2014
    Posts
    23
    thx put example one i mean if he join with 2 user echo 'Cant join your only with 2 username';
    and if he not join with 2 user echo ' Yourname';

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PHP Framework
    By Multivit4min in forum Permission System
    Replies: 1
    Last Post: June 29th, 2015, 12:28 PM
  2. PHP Framework
    By phil998 in forum Server Support
    Replies: 0
    Last Post: February 25th, 2015, 07:27 PM
  3. TS3 PHP Framework Visualizations
    By Ronin Design in forum Tools / Web Based
    Replies: 2
    Last Post: February 22nd, 2015, 06:04 AM
  4. Extraction using the Framework
    By HarryMW in forum Tools / Web Based
    Replies: 1
    Last Post: August 3rd, 2012, 08:04 PM
  5. Teamspeak, PHP Framework?
    By mario2027 in forum General Questions
    Replies: 1
    Last Post: December 21st, 2010, 10:30 AM

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
  •