[Script] Create Channel with Web

Ezel

Member
Mar 19, 2017
9
1
35
I managed to fix the problem.
For those who still have problems , delete all you have in crear.php and put this:
<?php
require_once ("TeamSpeak3.php");
include ('config.php');
error_reporting(0);
$ChannelName = $_POST['name'];
$idUnica = $_POST['idts'];
if (!$ChannelName || !$idUnica) {
echo "El nombre del channel y la ID unica tienen que estar";
exit();
}
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $UserAdmin . ":" . $PWQuery . "@" . $IP_TS . ":" . $PuertoQuery . "/?server_port=" . $PuertoTS . "");
$ListaDeChannels = $ts3_VirtualServer->request("channellist")->toString();
if (strpos($ListaDeChannels, $ChannelName)) {
echo "El nombre del channel esta en uso, utiliza otro";
exit();
}
$clID = $ts3_VirtualServer->clientGetByUid($idUnica);
$top_cid = $ts3_VirtualServer->channelCreate(array(
"channel_name" => $ChannelName,
"channel_codec" => TeamSpeak3::CODEC_SPEEX_WIDEBAND,
"channel_flag_permanent" => TRUE,
));
$clID = $ts3_VirtualServer->clientGetByUid($idUnica);
$infoCliente = $ts3_VirtualServer->execute("clientgetnamefromuid", array(
"cluid" => $idUnica
))->toList();
$cldbid = strval($infoCliente['cldbid']);
$ts3_VirtualServer->execute("clientmove", array(
"clid" => $clID,
"cid" => $top_cid
));
$ts3_VirtualServer->execute("setclientchannelgroup", array(
"cldbid" => $cldbid,
"cid" => $top_cid,
"cgid" => '5'
));
echo "El channel se creo correctamente."
?>
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
I managed to fix the problem.
For those who still have problems , delete all you have in crear.php and put this:
<?php
require_once ("TeamSpeak3.php");
include ('config.php');
error_reporting(0);
$ChannelName = $_POST['name'];
$idUnica = $_POST['idts'];
if (!$ChannelName || !$idUnica) {
echo "El nombre del channel y la ID unica tienen que estar";
exit();
}
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $UserAdmin . ":" . $PWQuery . "@" . $IP_TS . ":" . $PuertoQuery . "/?server_port=" . $PuertoTS . "");
$ListaDeChannels = $ts3_VirtualServer->request("channellist")->toString();
if (strpos($ListaDeChannels, $ChannelName)) {
echo "El nombre del channel esta en uso, utiliza otro";
exit();
}
$clID = $ts3_VirtualServer->clientGetByUid($idUnica);
$top_cid = $ts3_VirtualServer->channelCreate(array(
"channel_name" => $ChannelName,
"channel_codec" => TeamSpeak3::CODEC_SPEEX_WIDEBAND,
"channel_flag_permanent" => TRUE,
));
$clID = $ts3_VirtualServer->clientGetByUid($idUnica);
$infoCliente = $ts3_VirtualServer->execute("clientgetnamefromuid", array(
"cluid" => $idUnica
))->toList();
$cldbid = strval($infoCliente['cldbid']);
$ts3_VirtualServer->execute("clientmove", array(
"clid" => $clID,
"cid" => $top_cid
));
$ts3_VirtualServer->execute("setclientchannelgroup", array(
"cldbid" => $cldbid,
"cid" => $top_cid,
"cgid" => '5'
));
echo "El channel se creo correctamente."
?>
PHP:
<?php
    require_once ("TeamSpeak3.php");
    include ('config.php');
    
    error_reporting(0);
    
    $ChannelName = $_POST['name'];
    $idUnica = $_POST['idts'];
    
    if (!$ChannelName || !$idUnica) {
        echo "El nombre del channel y la ID unica tienen que estar";
        exit();
    }
    
    $ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $UserAdmin . ":" . $PWQuery . "@" . $IP_TS . ":" . $PuertoQuery . "/?server_port=" . $PuertoTS . "");
    $ListaDeChannels = $ts3_VirtualServer->request("channellist")->toString();
    
    if (strpos($ListaDeChannels, $ChannelName)) {
        echo "El nombre del channel esta en uso, utiliza otro";
        exit();
    }
    
    $clID = $ts3_VirtualServer->clientGetByUid($idUnica);
    
    $top_cid = $ts3_VirtualServer->channelCreate(array(
    "channel_name" => $ChannelName,
    "channel_codec" => TeamSpeak3::CODEC_SPEEX_WIDEBAND,
    "channel_flag_permanent" => TRUE,
    ));
    
    $clID = $ts3_VirtualServer->clientGetByUid($idUnica);
    
    $infoCliente = $ts3_VirtualServer->execute("clientgetnamefromuid", array(
    "cluid" => $idUnica
    ))->toList();
    
    $cldbid = strval($infoCliente['cldbid']);
    
    $ts3_VirtualServer->execute("clientmove", array(
    "clid" => $clID,
    "cid" => $top_cid
    ));
    
    $ts3_VirtualServer->execute("setclientchannelgroup", array(
    "cldbid" => $cldbid,
    "cid" => $top_cid,
    "cgid" => '5'
    ));
    
    echo "El channel se creo correctamente."
?>

Showme your error_log... are u using "execute" its not good idea.
 

King123

Active Member
Aug 17, 2016
5
1
75
Who can make to me function to get auto uid , and tell me where i need to put him ? In wich file ?
 

Mr-Malone

You risk and you will win
Sep 11, 2015
69
25
108
All the problems you encounter, please send them to me privately, do not spam this topic with all the minor issues, and use it only for announcing the updates.
 

Mr-Malone

You risk and you will win
Sep 11, 2015
69
25
108
@S I M P L E . I gave you all the help you needed, if you did not keep the settings made by me that does not mean you have to ask for support every time. I am sorry.

!! UPDATE : xx.12.2017 (Soon to launch.)

* Implementing the automatic completion of uniqid
* Channel quality panel setting ( opus voice, opus music )
* Automatic message after channel creation.

* A new graphical interface.
* Automatically fill out the channel description with user data and the date the channel was created.

* Solving the error 500
 

Mr-Malone

You risk and you will win
Sep 11, 2015
69
25
108
Hello friends I came back with this promise update.

This is a 2.0 BETA version, so I expect the opinions and the problems you encounter.

How to install?

1. Read the file first (readmefirst.md)
2. Edit the config.cfg file with your server data
3. Upload the files (php needed)
4. Access the site and test it.

What do I need?

* A web host with php installed.
* An account query with channel creation privileges and user changes and shifts.

What does this version contain?

* Form in 3 interactive parts.
* Updated graphical interface
* Display the date the channel was created and its founder in the channel description.
* Displaying the unique ID and when the channel was created (preferably no one has access to editing the topic) in the channel TOPIC
* The error page in this case.
* Set the password both to the channel and to the channel.
* Set contact address
* Automatically complete the uniq-id.

Image:


Where can I download it?
 
Last edited:

dany112dany

Member
Jan 2, 2016
5
3
38
Some feature for future :
1) Remove the creation of sub-channel( usually people want only one channel)
2) limit channel creation ( 1 per uniq id or something like that)
3) remove/change step 3 ( it's hard for normal user what it means Uniq ID so better wil be if will write somenting like : Ok <name from teamspeak of crient> are sure you want to make this channel ?)

PS. It's working very well :)
 
Last edited:

pipeter21

Active Member
Jul 5, 2017
15
3
93
Hello friends I came back with this promise update.

This is a 2.0 BETA version, so I expect the opinions and the problems you encounter.

How to install?

1. Read the file first (readmefirst.md)
2. Edit the config.cfg file with your server data
3. Upload the files (php needed)
4. Access the site and test it.

What do I need?

* A web host with php installed.
* An account query with channel creation privileges and user changes and shifts.

What does this version contain?

* Form in 3 interactive parts.
* Updated graphical interface
* Display the date the channel was created and its founder in the channel description.
* Displaying the unique ID and when the channel was created (preferably no one has access to editing the topic) in the channel TOPIC
* The error page in this case.
* Set the password both to the channel and to the channel.
* Set contact address
* Automatically complete the uniq-id.

Image:


Where can I download it?
I need that the created channels were located above a spacer. Thanks. Eg, CSGO, League of legends, etc
 

Mr-Malone

You risk and you will win
Sep 11, 2015
69
25
108
I need that the created channels were located above a spacer. Thanks. Eg, CSGO, League of legends, etc
Please be more explicit, and if you can send me a private message with your petitions.
 

metanoia

Active Member
Mar 15, 2018
3
0
73
So there is a bug.. When I hit create channel, it doesn`t show crear.php. Have any clue why?
 
Top