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 50 of 100 FirstFirst ... 40484950515260 ... LastLast
Results 736 to 750 of 1498
  1. #736
    Join Date
    September 2013
    Posts
    20
    Ahh, good catch. Didnt notice that. I'll switch over the license later today. Let me know if you find issues (i'm sure you will, refactors like that hardly ever work 100%)

  2. #737
    Join Date
    February 2013
    Posts
    47
    hi! I state saying I'm not very experienced, so do not assume anything. I wanted to create a channel using php framework ts3. as it should be the code?

  3. #738
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    Quote Originally Posted by Death_Balgor View Post
    hi! I state saying I'm not very experienced, so do not assume anything. I wanted to create a channel using php framework ts3. as it should be the code?
    http://docs.planetteamspeak.com/ts3/...work/#example8

    Check this.

    It shows channel and sub-channel so you only need the example up to where it creates the top channel.

  4. #739
    Join Date
    February 2013
    Posts
    47
    thk, i have 2 more question!

    if you wanted to compare if the id of the user corresponds to its ip as I should do, and create a token for the group channel group and then display it? after having let's assume 10 kinds of server group, and I wish I could pick any 3 via checkbox as it should be set in the page?

  5. #740
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by Death_Balgor View Post
    if you wanted to compare if the id of the user corresponds to its ip as I should do, and create a token for the group channel group and then display it?
    Comparing the IP address of a connected user to the IP of a user surfing a website is a bad idea. What if multiple users from the same network are connected to your server? Anyway... I've written some privilege key examples before. Check out this posting a few pages earlier:

    http://forum.teamspeak.com/showthrea...826#post362826

    To get a list of groups on a virtual server, simply use these two methods:

    http://docs.planetteamspeak.com/ts3/...2164d60ddd4e28
    http://docs.planetteamspeak.com/ts3/...e368af71443b1a


    I assume what you're trying to do is creating a privilege key to assign a registered user on your website to a TS3 group... is that correct?

  6. #741
    Join Date
    February 2013
    Posts
    47
    yes, but I want to assign to a specific channel group for fist question. for the second one I have yet to start creating all

    i try to add token for channel admin (id5) but it doesn't generate any token
    maybe you can set up automatic that the token is set to the main channel to be created? Thk
    index.php file
    Code:
    $nome_canale         = $_POST['ncanale'];
    $desc_canale         = $_POST['dcanale'];
    $pass_canale         = $_POST['pcanale'];
    $nome_subcanalep     = $_POST['subcanalep'];
    $nome_subcanales     = $_POST['subcanales'];
    
    
    // create a top-level channel and get its ID
    $top_cid = $ts3_VirtualServer->channelCreate(array(
      "channel_name"           => "$nome_canale",
      "channel_topic"          => "$desc_canale",
      "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
      "channel_codec_quality"  => 0x08,
      "channel_flag_permanent" => TRUE,
      "channel_password" => "$pass_canale",
    ));
    // create a sub-level channel and get its ID
    $sub_cid = $ts3_VirtualServer->channelCreate(array(
      "channel_name"           => "$nome_subcanalep",
      "channel_topic"          => "First Sub-channel $nome_canale",
      "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
      "channel_flag_permanent" => TRUE,
      "cpid"                   => $top_cid,
    ));
    // create a sub-level channel and get its ID
    $sub_cid = $ts3_VirtualServer->channelCreate(array(
      "channel_name"           => "$nome_subcanales",
      "channel_topic"          => "Second Sub-channel $nome_canale",
      "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
      "channel_flag_permanent" => TRUE,
      "cpid"                   => $top_cid,
    ));
    // two ways to create a key if you have the ID of a server group
    $key = $ts3_VirtualServer->privilegeKeyCreate(TeamSpeak3::TOKEN_CHANNELGROUP, 5 , 0, "test key");
    $key = $ts3_VirtualServer->serverGroupGetById($group_id)->privilegeKeyCreate("test key");
    
    // $key is a TeamSpeak3_Helper_String object, let's print it
    echo $key;
    
    // if you really need a string
    $key = $key->toString();
    
    // query and print a list of all privilege keys
    foreach($ts3_VirtualServer->privilegeKeyList() as $key_array)
    {
      echo $key_array["token"];  // token is a TeamSpeak3_Helper_String object
    }
    Last edited by Death_Balgor; October 17th, 2013 at 02:53 PM.

  7. #742
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    Have you tried
    PHP Code:
    $token $ts3_VirtualServer->channelGroupGetByName('Channel Admin')->privilegeKeyCreate($top_cid'Token for channel group'); 
    instead of channelGroupGetByName you can also use channelGroupGetById but instead of Channel Admin you use the ID of the group.

  8. #743
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    Quote Originally Posted by juggor View Post
    so - ya... i use ubuntu 13.* and it has neither require or include -- and im pretty nub anyway... any possible complete retards / dummies guide plz?

    after searchin google for 5 hours i have not been able to turn up anything except this -

    thanks in advance
    what do you mean? you need to do it with PHP.

  9. #744
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Note that when creating a privilege key for a channel group, you need to specifiy a channel ID. I see in your example that you're setting the $id2 parameter to 0. This will not work as there's no channel with that ID.

  10. #745
    Join Date
    January 2010
    Location
    Germany
    Posts
    252
    Hey ScP,

    How can i get the ip address from a server object

    PHP Code:
    $server $host->serverGetSelected();
    var_dump($server->virtualserver_ip); 
    VIRTUALSERVER_IP always returns NULL.

  11. #746
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by faralsimbor View Post
    How can i get the ip address from a server object

    VIRTUALSERVER_IP always returns NULL.
    I think virtualserver_ip is only set if virtual servers are listening on a specific IP of the machine (set with the voice_ip option in the config file). So when virtualserver_ip is empty, I think it's safe to assume that you can use the same IP as you use for the ServerQuery connection...

    The server-side implemetation of IP bindings is very weird to be honest so I'm not sure what's working and whats simply f****d up there. For example, the bindinglist command returns the contents of the bindings table in the database, but you cannot modify the data in that table with any command-line parameter, option or command. Anyway... here's what I'd do:

    PHP Code:
    $ip $node->getAdapter()->getTransportHost(); 

  12. #747
    Join Date
    January 2010
    Location
    Germany
    Posts
    252
    Quote Originally Posted by aequasi View Post
    I spent a day or two converting what you had to something running on 5.3 with namespaces. I also got it working with composer, which is another big benefit in the PHP community.
    nice work, but for me the original framework works fine with the following changes in composer.json:

    Code:
    "autoload": {
       "classmap": ["library/TeamSpeak3/"]
    }

  13. #748
    Join Date
    September 2013
    Posts
    20
    Quote Originally Posted by faralsimbor View Post
    nice work, but for me the original framework works fine with the following changes in composer.json:

    Code:
    "autoload": {
       "classmap": ["library/TeamSpeak3/"]
    }
    My intent to rewrite all of it was to get namespaces, i wasnt saying that the original didnt work fine.

  14. #749
    Join Date
    February 2013
    Posts
    47
    I think I have a problem with the hosting service, and I can not understand why this error.

    Code:
    Fatal error: Uncaught exception 'TeamSpeak3_Transport_Exception' with message 'Connection timed out' in /test/libraries/TeamSpeak3/Transport/TCP.php:54 Stack trace: #0 /test/libraries/TeamSpeak3/Transport/TCP.php(108): TeamSpeak3_Transport_TCP->connect() #1 /test/libraries/TeamSpeak3/Adapter/ServerQuery.php(76): TeamSpeak3_Transport_TCP->readLine() #2 /test/libraries/TeamSpeak3/Adapter/Abstract.php(60): TeamSpeak3_Adapter_ServerQuery->syn() #3 /test/libraries/TeamSpeak3/TeamSpeak3.php(320): TeamSpeak3_Adapter_Abstract->__construct(Array) #4 /test/create.php(17): TeamSpeak3::factory('serverquery://s...') #5 {main} thrown in /test/libraries/TeamSpeak3/Transport/TCP.php on line 54

  15. #750
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by Death_Balgor View Post
    I think I have a problem with the hosting service, and I can not understand why this error.
    All this error message says is "Connection timed out" so there's not much I can do to help you.

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, 11:28 AM
  2. PHP Framework
    By phil998 in forum Server Support
    Replies: 0
    Last Post: February 25th, 2015, 06:27 PM
  3. TS3 PHP Framework Visualizations
    By Ronin Design in forum Tools / Web Based
    Replies: 2
    Last Post: February 22nd, 2015, 05:04 AM
  4. Extraction using the Framework
    By HarryMW in forum Tools / Web Based
    Replies: 1
    Last Post: August 3rd, 2012, 07:04 PM
  5. Teamspeak, PHP Framework?
    By mario2027 in forum General Questions
    Replies: 1
    Last Post: December 21st, 2010, 09: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
  •