Simple & Clean Channel Creator. [Web]

Discussion in 'Web scripts' started by EscuderoKevin, Jun 29, 2016.

  1. vupyC

    vupyC New Member

    Dear friends, I still can't find channel order
    help me please
     
  2. LucasB

    LucasB New Member

    Write the last channel ID !
    YaTQA -> http://prntscr.com/btp73q
     
  3. TheSpartaPT

    TheSpartaPT New Member

  4. Umar

    Umar Restricted

    go to index.php and check line 46 there is something worrng there
     
  5. TheSpartaPT

    TheSpartaPT New Member

    i don't think so cuz i didn't even mess with it but i'll post the line 46 here :

    PHP:
        if (!$FLAG){
            echo 
    "<p><b>".$lang['f_connectts'].".</b></p><br/>";  <-- line 46
            header
    ("refresh: 10; url = ./");
            die;
        }
     
    Last edited: Jul 20, 2016
  6. LucasB

    LucasB New Member

  7. TheSpartaPT

    TheSpartaPT New Member

    yeah i was testing on localhost because i'm not going to use this web script i'm taking ideas from it so i could build one myself, is that the problem ? if it is it doesn't even matter because the server runs on linux :/
     
  8. Magic

    Magic Member

    If someone like me wants to make as last in order and as SUBCHANNEL, change this
    Line 66
    Code:
     "channel_order" => "$order"));
    to
    Code:
     "cpid" => "$order"));
    and in $order in config put the id of the header they will be subbed under.
     
    EscuderoKevin likes this.
  9. EscuderoKevin

    EscuderoKevin Active Member

    Sorry , Im Back bad Internet.....

    Errors ?
     
    decon20 likes this.
  10. Sempz

    Sempz New Member

    hi , i have this :
    Code:
    <?php
        if(!isset($_SESSION['ts3_last_query']))
        $_SESSION['ts3_last_query'] = microtime(true);
    
        if($_SESSION['ts3_last_query'] >= microtime(true))
        die('Tens de esperar 10 segundos para criar outro canal!');
    
        $_SESSION['ts3_last_query'] = microtime(true)+10.0;
    
        date_default_timezone_set('Portugal'); //Change Here!
        require_once("libraries/TeamSpeak3/TeamSpeak3.php");
        include 'data/config.php';
    
    
        function getClientIp() {
            if (!empty($_SERVER['HTTP_CLIENT_IP']))
                return $_SERVER['HTTP_CLIENT_IP'];
            else if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
                return $_SERVER['HTTP_X_FORWARDED_FOR'];
            else if(!empty($_SERVER['HTTP_X_FORWARDED']))
                return $_SERVER['HTTP_X_FORWARDED'];
            else if(!empty($_SERVER['HTTP_FORWARDED_FOR']))
                return $_SERVER['HTTP_FORWARDED_FOR'];
            else if(!empty($_SERVER['HTTP_FORWARDED']))
                return $_SERVER['HTTP_FORWARDED'];
            else if(!empty($_SERVER['REMOTE_ADDR']))
                return $_SERVER['REMOTE_ADDR'];
            else
                return false;
        }
    
        $connect = "serverquery://".$USER_QUERY.":".$PASS_QUERY."@".$HOST_QUERY.":".$PORT_QUERY."/?server_port=".$SERVER_PORT."";
        $ts3 = TeamSpeak3::factory($connect);
        $ts3->execute("clientupdate", array("client_nickname" => $NICK_QUERY));
        $FLAG = false;
    
        foreach ($ts3->clientList(array('client_type' => '0', 'connection_client_ip' => getClientIp())) as $client) {
            $clientuid = $client->client_unique_identifier;
            $client_nickname = $client->client_nickname;
            $client_clid = $client->clid;
            $FLAG = true;
            break;
        }
        if (!$FLAG){
            echo "<p><b>".$lang['f_connectts'].".</b></p><br/>";
            header("refresh: 10; url = ./");
            die;
        }
    
        if (isset($_POST["create"])) {
    
            $channelname = $_POST['channelname'];
        $subchannelname = $_POST['subchannelname'];
            $password = $_POST['password'];
            $unixTime = time();
            $realTime = date('[Y-m-d]-[H:i]',$unixTime);
            $channel_admin_group = 5;
    
            try
            {
                $cid1 = $ts3->channelCreate(array(
                "channel_name" => "$channelname",
                "channel_password" => "$password",
                "channel_flag_permanent" => "1",
                "channel_description" => '[center][b][u]'.$channelname.'[/u][/b][/center][hr][b][list][*]Data: '.$realTime.'[*]Dono da sala: ' . $client_nickname . '[/list][/b]',
                "cpid" => $cid,
           "channel_order" => "$order"
        ));
           $sub_cid = $ts3->channelCreate(array(
           "channel_name" => "$subchannelname",
           "channel_password" => "$password",
           "channel_flag_permanent" => TRUE,
           "cpid" => $cid1,
        ));
         
                $ts3->clientGetByUid($clientuid)->setChannelGroup($cid1, $channel_admin_group);
                $ts3->clientMove($client_clid, $cid1);
         
            }
            catch(Exception $e)
            {
                echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
            }
        }
    ?>
    <!DOCTYPE html>
    <html lang="en" class="no-js">
        <head>
            <meta charset="UTF-8" />
            <title>NEW-SENSE</title>
            <link rel="stylesheet" type="text/css" href="css/demo.css" />
            <link rel="stylesheet" type="text/css" href="css/style.css" />
            <link rel="stylesheet" type="text/css" href="css/animate-custom.css" />
        </head>
        <body>
            <div class="container">
                <header>
                    <h1>Cria a tua sala<span> Permanente</span></h1>
                </header>
                <section>        
                    <div id="container_demo" >
                        <div id="wrapper">
                            <div id="login" class="animate form">
                                <form  method="post" autocomplete="on">
                                    <h1>Settings</h1>
                                    <p>
                                        <label  class="uname" data-icon="u" > Ola, <?php echo $client_nickname; ?></label>
                                        <input  readonly type="text" value="<?php echo $clientuid; ?>"/>
                                    </p>
                                    <p>
                                        <label  class="uname" data-icon="u" > Nome do Canal </label>
                                        <input  name="channelname" required="required" type="text" placeholder="My Super Channel."/>
                                    </p>
                    <p>
                                        <label  class="uname" data-icon="u" > Nome do Sub-Canal </label>
                                        <input  name="subchannelname" required="required" type="text" placeholder="My sub Super Channel."/>
                                    </p>
                                    <p>
                                        <label class="youpasswd" data-icon="p"> Passwords dos canais</label>
                                        <input name="password" required="required" type="text" placeholder="eg. X8df!90EO" />
                                    </p>
                                    <p class="login button">
                                        <input type="submit" name="create" value="Criar Canais!" />
                                    </p>
                                </form>
                                <?php echo $client_clid; ?></br>
                            </div>
                     
                        </div>
                    </div>
                </section>
            </div>
        </body>
    </html>
    
    I would like to have a random [*spacerRANDOM]▃ i did the subchannel but i cant do the random spacer :( Help pls
     
  11. EscuderoKevin

    EscuderoKevin Active Member


    Give me in Screen. What do you like...
     
    decon20 likes this.
  12. Sempz

    Sempz New Member

    Last edited by a moderator: Jul 20, 2016
  13. Sempz

    Sempz New Member

    Code:
    try
            {
           $cid = $ts3->channelCreate(array(
                "channel_name" => "[*spacer$randomnumbers]▃",
                "channel_password" => "$password",
                "channel_flag_permanent" => "1",
           "channel_order" => "$order"
        ));
    
     
  14. EscuderoKevin

    EscuderoKevin Active Member

    Wat ? xd

    Example:

    PHP:
    $cid1 $ts3->channelCreate(array(
    "channel_name" => "$channelname",
    "channel_password" => "$password",
    "channel_flag_permanent" => "1",
    "channel_description" => '[center][b][u]'.$channelname.'[/u][/b][/center][hr][b][list][*]Data: '.$realTime.'[*]Dono da sala: ' $client_nickname '[/list][/b]',
    "channel_order" => "$order"
    ));
    $sub_cid $ts3->channelCreate(array(
    "channel_name" => "$subchannelname",
    "channel_password" => "$password",
    "channel_flag_permanent" => TRUE,
    "cpid" => $cid1,
    ));
    $random mt_rand(0,10000)
    $sub_cid $ts3->channelCreate(array(
    "channel_name" =>  [*spacer$random]*,
    "channel_password" => "$password",
    "channel_flag_permanent" => TRUE,
    "cpid" => $cid1,
    ));
     
    decon20 likes this.
  15. Sempz

    Sempz New Member

    it work's , thank you dude :D
     
  16. greetings, series possible to make a counter for example from 1 to 1000 when they are created channels
     
  17. Sempz

    Sempz New Member

    That would be good asswell :D
     
  18. vans1208

    vans1208 New Member

    It would be nice if it was possible to adjust/switch the channel codec

    MFG Dave
     
  19. 3rKaN_BRATTE

    3rKaN_BRATTE New Member

    Could you make a Anti Spam so if somebody already have a Channel (ore is in a specified channelgroup id, that is gone be added after creating the channel) that he is not possible to creat a another channel. Only if he loses his channel (the specified channelgroup id).

    Would be nice if you could do that!
     
  20. KELAZEDZN

    KELAZEDZN New Member


    Re-edit from KELAZE :3 xD
     

Share This Page