Forum

Page 77 of 100 FirstFirst ... 2767757677787987 ... LastLast
Results 1,141 to 1,155 of 1496
  1. #1141
    Join Date
    June 2015
    Posts
    4
    Good morning. I am am beginner and want help with my code.

    my problems

    *Bot not give admin channel
    *I wanted to add that the Bot moves me to the channel
    *You need to be on the server to be able to create the channel

    ""Need who is helping me write the complete code because I do not know much, I'm learning now""

    ty very much bro's

    index.php

    PHP Code:
    <?php error_reporting(0); $op $_GET['op'];

    echo
    "<form action='create.php' method='POST'>
    Nome do Canal: <BR><input name='canal' id='canal' type='text' size='20'><BR><BR>
    Senha: <BR><input name='senha' id='senha' type='text' size='20'><BR><BR>
    <input type='submit' value='Criar sala'>
    </form>"
    ;

    if (
    $op==1){ echo "<hr width='100'><p align='center'><font color='#0000FF'>Seu Canal foi Criado!</font></p><hr width='100'>";}

    if (
    $op==2){ echo "<hr width='100'><p align='center'><font color='#FF0000'>Desculpe! Você ja possui um Canal!</font></p><hr width='100'>";}

    ?>
    create.php
    PHP Code:
    <?php
    $nickdoboot 
    rand(099);
    $espaco rand(099999);
    //error_reporting(E_ALL);
    //ini_set('display_errors', 1);
    require_once("libraries/TeamSpeak3/TeamSpeak3.php");
    if(
    $_COOKIE["config90909982930461"]==""){
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://xxxxx:[email protected]:xxxxx/?server_port=xxxxx&nickname=xxxxx_Canal$nickdoboot");
    $grupo_do_ca 89;

    $nome_canal        $_POST['canal'];
    $pass_canal        $_POST['senha'];



    $top_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name"          => "[cspacer]$nome_canal",
        
    "channel_topic"             => "ESSE CANAL SERÁ APAGADO SE FICAR INATIVO POR MAIS DE 10 DIAS",
        
    "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
        
    "channel_codec_quality"  => 0x08,
        
    "channel_flag_permanent" => TRUE,
        
    "channel_password" => "$pass_canal",
        
    "channel_flag_maxclients_unlimited" => 0,
        
    "channel_order"          => 2461,
    ));

    $sub_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name" => "Sala 1",
        
    "channel_topic" => "ESSE CANAL SERÁ APAGADO SE FICAR INATIVO POR MAIS DE 10 DIAS",
        
    "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
        
    "channel_flag_permanent" => TRUE,
        
    "channel_password" => "$pass_canal",
        
    "cpid"                  => $top_cid,
    ));

    $sub_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name" => "Sala 2",
        
    "channel_topic" => "ESSE CANAL SERÁ APAGADO SE FICAR INATIVO POR MAIS DE 10 DIAS",
        
    "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
        
    "channel_flag_permanent" => TRUE,
        
    "channel_password" => "$pass_canal",
        
    "cpid"                  => $top_cid,
    ));

    $sub_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name" => "Sala 3",
        
    "channel_topic" => "ESSE CANAL SERÁ APAGADO SE FICAR INATIVO POR MAIS DE 10 DIAS",
        
    "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
        
    "channel_flag_permanent" => TRUE,
        
    "channel_password" => "$pass_canal",
        
    "cpid"                  => $top_cid,
    ));

    $sub_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name" => "Sala 4",
        
    "channel_topic" => "ESSE CANAL SERÁ APAGADO SE FICAR INATIVO POR MAIS DE 10 DIAS",
        
    "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
        
    "channel_flag_permanent" => TRUE,
        
    "channel_password"        => "$pass_canal",
        
    "cpid"                  => $top_cid,
    ));

    $sub_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name" => "AFK",
        
    "channel_topic" => "ESSE CANAL SERÁ APAGADO SE FICAR INATIVO POR MAIS DE 10 DIAS",
        
    "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
        
    "channel_flag_permanent" => TRUE,
        
    "cpid"                  => $top_cid,
    ));

    setcookie('config90909982930461''1', (time() + (24 3600)));

    foreach(
    $ts3_VirtualServer->clientList() as $client) {
        if(
    $_SERVER['REMOTE_ADDR'] == $client['connection_client_ip']) {
            
    $ts3_VirtualServer->clientGetById($client['clid'])->setChannelGroup($top_cid$grupo_do_ca);
            break;
        }
    }

    $top_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name"          => "[*spacer$espaco]▂",
        
    "channel_topic"            => "DIVISAO",
        
    "channel_codec"          => TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND,
        
    "channel_codec_quality"  => 0x08,
        
    "channel_flag_permanent" => TRUE,
        
    'channel_flag_maxclients_unlimited' => 0,
        
    "channel_order"          => 2461,
    ));

    header("Location: index.php?op=1");
    }
    else

    header("Location: index.php?op=2");
    }
    ?>

  2. #1142
    Join Date
    August 2015
    Location
    Sweden
    Posts
    1
    Hey guys. I hope everything's good!

    I'm putting together a script so users can view which servers is online and view the users online. All that works great!
    As a bonus I provide a script that let's the users to view clientinformation about the users online on TS. But instead of viewing info about 1 user, it writes info about ALL users on the same page.

    Here's a screenshot: http://i.imgur.com/iag0zlo.png
    Here's the URL I use: /?page=clientinfo&server=1&clientid=9


    So what I like to do is that the script only get the info about the connected user with the correct ID (clid), and not get info about everybody...

    I can post the code if you guys like that!

    PS: Sorry is my English failed a bit, I'm thinking too much right now...

    Best Regards,
    Wabbadah
    Attached Images Attached Images  

  3. #1143
    Join Date
    September 2015
    Posts
    1

    Server Kick Help

    I am trying to kick someone from my server where the username does not match my SQL below is the code that I have written, assigning the server group works but thats it... if I have posted this in the wrong section please move accordingly
    PHP Code:
    <?php // load framework files
    require_once("ts3/libraries/TeamSpeak3/TeamSpeak3.php");
    require_once(
    "extra/common.php");

        
    error_reporting(E_ALL);
        
        try
        {
                
    $ts3_VirtualServer TeamSpeak3::factory($serverinfo);

                foreach(
    $ts3_VirtualServer->clientList()as $ts3_Client)
                {
                        if(
    $ts3_Client['client_type']) continue;
                        
    $query "
                            SELECT
                            username
                            FROM users
                            WHERE username = username
                        "
    ;
                        try
                        {
                            
    $stmt $db->prepare($query);
                            
    $result $stmt->execute();
                        }
                        catch(
    PDOException $ex)
                        {
                            die(
    "Failed to run query: " $ex->getMessage());
                        }
                        
    $rows $stmt->fetchall();
                        
                        foreach(
    $rows as $row)
                        {
                            
    $driver $ts3_Client['client_nickname'];
                            if(
    $driver == $row['username'])
                            {
                                
    $array $ts3_VirtualServer->execute("servergroupclientlist", array("sgid" => 13"-names"))->toAssocArray("cldbid");
                                if(
    in_array($driver$array) == true) continue;
                                
    $continue true;
                                foreach(
    explode(","$ts3_Client["client_servergroups"]) as $sgid)
                                {
                                    if(
    $sgid == 13$continue false;
                                }
                                if(
    $continue == false) continue;
                                
    $ts3_VirtualServer->clientListReset();
                                
    $ts3_VirtualServer->serverGroupClientAdd("13"$ts3_Client["client_database_id"]);
                                echo (
    "Set User as Verified");
                            }
                            elseif(
    $driver !== $row['username'])
                            {
                                
    $ts3_VirtualServer->clientGetByName("INSERT NAME HERE")->kick(TeamSpeak3::KICK_SERVER,  "Name must match website!");
                            }
                            else continue;
                            
                        }
                
    sleep(1);
                }
        }
        catch(
    TeamSpeak3_Exception $e)
        {
        echo 
    "Error " $e->getCode() . ": " $e->getMessage();
        }
        
    //echo ("Nice Try");
        
    echo ("Set User for Verified");
        
    //header("Location: index.php"); 
                
    exit;

  4. #1144
    Join Date
    July 2015
    Posts
    1

    TeamSpeak 3 PHP Framework

    I am still learning PHP and it's the first time I am using this library (TeamSpeak 3 PHP Framework), I am trying to return a count of online users in a specific group, I tried a few different ways and no success.

    This one, counts all users in the group (including offline users):

    PHP Code:
    $admins 0;
    foreach(
    $ts3->serverGroupGetById(12)->clientList() as $client) {
        
    $admins++;

    So I tried to compare that list with the online users list:

    PHP Code:
    $admins 0;
    foreach(
    $ts3->serverGroupGetById(12)->clientList() as $client) {
        if(
    $ts3->clientList($client)) {
            
    $admins++;
        }

    And it works sometimes, I say sometimes because I tried it on my virtual server and no issues, the count was right, but when I tried it on another virtual server (I changed the group ID and port) I get this:

    PHP Code:
    Warningpreg_match(): Unknown modifier '9' in C:\xampp\htdocs\serverstatus\libraries\TeamSpeak3\Helper\String.php on line 192 
    That warning only shows up with some server groups, I don't know the reason.



    PHP Code:
    $admins 0;
    foreach(
    $ts3->clientList($client) as $client) {
        
    $admins++;

    I guess this piece of code should show all online users but I tested it and the value is not always the online users, like I said before on my virtual server it shows the right count but when I tried it on another virtual server I got 48 but there are 61 users online.

  5. #1145
    Join Date
    September 2015
    Posts
    1

    Edit Channel Description using PHP API

    Hello nice guys,how do i edit Channel Description using PHP API? Been searching for that but i didn't find out how to do it

  6. #1146
    Join Date
    July 2014
    Posts
    24

    Teamspeak 3 PHP Framework - Give User Servergroup by IP

    Hey,

    I want a Script on my Website with Ts3 PHP Framework that gets the IP of the user browsing the site and gives
    the User on my Teamspeak with the same IP a server group.
    I got no idea how to do this, someone can write me this little script?

    Thanks!

  7. #1147
    Join Date
    April 2015
    Posts
    4

    Server Message for php?

    How can ı send server message for php?

  8. #1148
    Join Date
    September 2015
    Posts
    1

    Server Message for php?

    How send message server php?

  9. #1149
    Join Date
    July 2014
    Posts
    24
    How to find an online user by IP?

  10. #1150
    Join Date
    April 2014
    Posts
    37

    PHP TS3 Framework Client Bandwith Last Second

    I have a Question Depending the Teamspeak TS3 PHP Framework from PlanetTeamspeak / ScP

    I would like to get the bandwith of a client in the last second, mainly to check if he has muted a musicbot (musicbot is the only talker in this channel)

    So there is the Query command to get the bandwith
    clientinfo clid=
    wich returns aswell
    connection_bandwidth_received_last_second_total=

    but i haven found anything in the php framework...

    Does anyone know how i can get the bandwith wich a Client has received in the last seconds?



    thanks for a answer
    Multivitamin
    Last edited by dante696; September 28th, 2015 at 11:15 AM. Reason: merged. belongs to the tool not to server

  11. #1151
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,525
    Quote Originally Posted by Multivit4min View Post
    I have a Question Depending the Teamspeak TS3 PHP Framework from PlanetTeamspeak / ScP

    I would like to get the bandwith of a client in the last second, mainly to check if he has muted a musicbot (musicbot is the only talker in this channel)

    So there is the Query command to get the bandwith
    clientinfo clid=
    wich returns aswell
    connection_bandwidth_received_last_second_total=

    but i haven found anything in the php framework...

    Does anyone know how i can get the bandwith wich a Client has received in the last seconds?

    thanks for a answer
    Multivitamin
    All client properties can be accessed from a client object:

    PHP Code:
    $client $server->clientGetByName("Music Bot");

    echo 
    $client->connection_bandwidth_received_last_second_total
    To check if a client is transmitting audio data, you can also use the client_flag_talking property.

  12. #1152
    Join Date
    October 2011
    Posts
    7

    Possible to show all users their avatars on a webpage?

    Hey everyone.

    I'm redesigning my website at the moment a bit and I was wondering if it is possible to show the avatars of all active users on teamspeak on a webpage (in php of course).

    I've searched through the teamspeak documents and found this:
    https://docs.planetteamspeak.com/ts3...d4098b046938c7
    Though, this is for the online user itself.

    Does anyone knows if it is possible to show all users online with their name and avatar (in a php webpage)?

    Thanks in advance!

  13. #1153
    Join Date
    September 2012
    Posts
    6,078
    all online users should be pretty easy to get from just what you posted. Simply loop through the clientList result and call avatarDownload() on each of them. According to the documentation it'll get you the image as a string, presumably in base64 encoded form, in which case you can then either use directly or cache on disk and then use that file as an img src.

    If you want all clients, even those not currently online you could use clientListDb on the server object and then see what kind of info that returns, if you get client objects it's the same as for online clients.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  14. #1154
    Join Date
    October 2015
    Posts
    2
    Heya, I'm working with Xarwin.

    Not much of a php dood, rather Java but I tried this. It's supposed to grab the avatars and then show them. I grabbed the base64 decoding from Stackoverflow.

    Code:
    require_once("libraries/TeamSpeak3/TeamSpeak3.php");
    
    $ts3server = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011?server_port=9987");
    
    $clientList = $ts3server->clientList();
    $avatars = array();
    foreach($clientList as $client) {
        array_push($avatars, $client->avatarDownload());
    }
    
    foreach($avatars as $avatar) {
        $new_data = explode(";", $avatar);
        $type = $new_data[0];
        $data = explode(",",$new_data[1]);
        header("Content-type:".$type);
        echo base64_decode($data[1]);
    }
    However, what I got was this:

    http://puu.sh/kw1f5.png
    (image because cloudflare blocks the text)


    What am I doing wrong?
    Last edited by FlawedBliss; October 8th, 2015 at 04:30 PM.

  15. #1155
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,525
    Quote Originally Posted by Xarwin View Post
    Does anyone knows if it is possible to show all users online with their name and avatar (in a php webpage?
    Yes, that's possible... but I would not recommend it.



    Depending on how many clients are registered on your server, stuff like this could take a very long time. So you need to build your own caching mechanism for those avatars anyway. A problem with that is, that the TeamSpeak 3 Server does not provide any information if and when the users avatar changed.

    Anyway... if you're going to do this, I'd recommend only showing avatars from clients in a specific server group to limit the amount of results.

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
  •