[Script] Create Channel with Web

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
I need that the created channels were located above a spacer. Thanks. ;)

Sure , its easy.
We have 2 forms, Order Selection (1 , 2 , or 3 spacers ) ex Counter Strike 1.6 , CS GO , Etc etc.


In form (index.php)
PHP:
                                          <form method="post" action="crear.php">
                                              <div class="form-group">
                                                  <input type="text" name="name" class="form-control" placeholder="Numele canalului" required="required" pattern="[a-zA-Z]{4,22}" title="Numele trebuie sa aiba intre 4 si 22 caractere, sa nu includa simboluri sau cifre." value="">
                                                <input type="text" name="subname" class="form-control" placeholder="Numele sub-canalului" required="required" pattern="[a-zA-Z]{4,22}" title="Trebuie să deții obligatoriu un subcanal pentru al gestiona.Numele trebuie sa aiba intre 4 si 22 caractere, sa nu includa simboluri sau cifre." value="">
                                                <input type="text" name="ChannelPass" class="form-control" placeholder="Parola canalului" required="required" pattern="{4,22}" title="Parola canalului trebuie sa contina minimum 4 charactere." value="">
                                                <input type="text" name="idts" class="form-control" placeholder="UniqueID-ul tau" required="required" title="UniqueID-ul trebuie sa contina un minimum de 27-28 charactere." pattern="{25,50}" value="">                               
                                              </div>
                                            <button id="signIn_1" type="submit" class="btn btn-block signin">Create your channel</button>
                                          </form>

You need add 1 input more.

PHP:
                                                <select name="order">
                                                    <option value="xxx">Temp.</option>
                                                   <option value="xxx">Counter Strike 1.6</option>
                                                </select>

You need change , or create more options.

Change XXX -> Spacer ID.
And then:

PHP:
                                          <form method="post" action="crear.php">
                                              <div class="form-group">
                                                  <input type="text" name="name" class="form-control" placeholder="Numele canalului" required="required" pattern="[a-zA-Z]{4,22}" title="Numele trebuie sa aiba intre 4 si 22 caractere, sa nu includa simboluri sau cifre." value="">
                                                <input type="text" name="subname" class="form-control" placeholder="Numele sub-canalului" required="required" pattern="[a-zA-Z]{4,22}" title="Trebuie să deții obligatoriu un subcanal pentru al gestiona.Numele trebuie sa aiba intre 4 si 22 caractere, sa nu includa simboluri sau cifre." value="">
                                                <input type="text" name="ChannelPass" class="form-control" placeholder="Parola canalului" required="required" pattern="{4,22}" title="Parola canalului trebuie sa contina minimum 4 charactere." value="">
                                                <input type="text" name="idts" class="form-control" placeholder="UniqueID-ul tau" required="required" title="UniqueID-ul trebuie sa contina un minimum de 27-28 charactere." pattern="{25,50}" value="">
                                                 
                                                <select name="order" class="form-control">
                                                      <option value="">Select Your Seccion</option>
                                                    <option value="xxx">Temp.</option>
                                                   <option value="xxx">Counter Strike 1.6</option>
                                                </select>

                                            <button id="signIn_1" type="submit" class="btn btn-block signin">Create your channel</button>
                                          </form>

Now , in "crear.php" you need use that select.

Here:

PHP:
$ChannelName = $_POST['name'];
$SubChannelName = $_POST['subname'];
$ChannelPassword = $_POST['ChannelPass'];
$SubChannelPass = $_POST['SubChannelPass'];
$idUnica = $_POST['idts'];

You need "name value of select"

PHP:
$ChannelName = $_POST['name'];
$SubChannelName = $_POST['subname'];
$ChannelPassword = $_POST['ChannelPass'];
$SubChannelPass = $_POST['SubChannelPass'];
$idUnica = $_POST['idts'];
$channelorder = $_POST['order'];

And now.

You need edit this part.

PHP:
$sub_cid = $ts3_VirtualServer->channelCreate(array(
    "channel_name" => $ChannelName,
    "channel_password" => $ChannelPassword,
    "channel_codec" => TeamSpeak3::CODEC_OPUS_VOICE,
    "channel_topic" => "Canal creat via EvDBoard",
    "channel_flag_permanent" => TRUE,
    "cpid"                   => '57',
));

You need add "channel_order => $channelorder,


PHP:
$sub_cid = $ts3_VirtualServer->channelCreate(array(
    "channel_name" => $ChannelName,
    "channel_password" => $ChannelPassword,
    "channel_codec" => TeamSpeak3::CODEC_OPUS_VOICE,
    "channel_topic" => "Canal creat via EvDBoard",
    "channel_flag_permanent" => TRUE,
    "cpid"                   => '57',
    "channel_order" => $channelorder,
));

Now you can test ! ♥
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
Last form create channel above spacer, but firts in channel tree.

ex:

Spacer.

here is your channel.
1.Channel Client
2.Channel Client

Now i give you 2 options more.

1. For create channel in specify spacer (but above all channels).
2. For Create channel in more than 1 spacer (but above all channels).


1.

A. Create 1 .txt with spacer ID

ex.

channel_order.txt
firts line (1 line)
2354

B. Edit Crear.php

Put this above line 5 (error_reporting(0))

PHP:
//////////////////////////////
$order_txt = "channel_order.txt";    //String file path
$size_txt = filesize($order_txt);  // File size (how much data to read)
$heandle_txt = fopen($order_txt,"r");   // File handle
$conteude_txt = fread($heandle_txt,$tamanho_txt);  // Read data from file handle
echo $conteude_txt;
fclose($heandle_txt);  // Close handle
//////////////////////////////

Now edit:

PHP:
$sub_cid = $ts3_VirtualServer->channelCreate(array(
    "channel_name" => $ChannelName,
    "channel_password" => $ChannelPassword,
    "channel_codec" => TeamSpeak3::CODEC_OPUS_VOICE,
    "channel_topic" => "Canal creat via EvDBoard",
    "channel_flag_permanent" => TRUE,
    "cpid"                   => '57',
));

Add "channel_order" => $order_txt

PHP:
$sub_cid = $ts3_VirtualServer->channelCreate(array(
    "channel_name" => $ChannelName,
    "channel_password" => $ChannelPassword,
    "channel_codec" => TeamSpeak3::CODEC_OPUS_VOICE,
    "channel_topic" => "Canal creat via EvDBoard",
    "channel_flag_permanent" => TRUE,
    "cpid"                   => '57',
    "channel_order" => $order_txt,
));

Now you did was take the value found in the txt file and displayed here in the variable.

You need Write in txt last channel id channel, in this case the channel id its "$sub_cid"

Before "$cldbid = strval($infoCliente['cldbid']);" in crear.php you need put this..

PHP:
//////////////////////////////
$order_txt = fopen("channel_order.txt", "w") or die("file channel_order.txt not exist");
fwrite($order_txt, $sub_cid);
fclose($order_txt);
//////////////////////////////

Finish. Now you create channel and the channel_order.txt (have there last channel id)

Test it!
 

Mr-Malone

You risk and you will win
Sep 11, 2015
69
25
108
Try get permission 755 or 777 all files /ChannelEvD (or name folder parent script)
 

Neillx

Member
Oct 5, 2015
13
0
33
Hi there, when you create a channel and its hard because the place to put password and even name of channel is wrong in caracters (4-22) but with five dont work, when you click to create it shows a white page and nothing happens , sometimes it shows error 500.
 

Neillx

Member
Oct 5, 2015
13
0
33
Hi escuderoKevin, it doesnt work for me, when i try to create channel it gives a white page sometimes or error 500 without doing nothing. I also put the files with 777 perms, and the camp "name channel" or "sub channel" ask for 4-22 caracteres, but if i put 5 caracteres or a name with a number it doesnt accept.

Ty for the sharing
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
Hi escuderoKevin, it doesnt work for me, when i try to create channel it gives a white page sometimes or error 500 without doing nothing. I also put the files with 777 perms, and the camp "name channel" or "sub channel" ask for 4-22 caracteres, but if i put 5 caracteres or a name with a number it doesnt accept.

Ty for the sharing

But the problem its in crear.php or other ?
 
Top