Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 05:18

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



ts3admin.class channel erstellen

Discussion on ts3admin.class channel erstellen within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2012
Posts: 1,004
Received Thanks: 62
ts3admin.class channel erstellen

Tach,

Ich habe ein kleines POST Script erstellt.

Oben hab ich eine Variable erstellt die sich $name nent. Dort wird der Name der in der Textbox beim Formular eingetippt wurde gespeichert.
Meine Frage ist wie ich via ts3admin.class dann einen Channel erstellen kann.


channelCreate($name) hab ich schon probiert , leider vergebens.
imagecload is offline  
Old 05/19/2013, 19:23   #2
 
KoKsPfLaNzE's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 731
Received Thanks: 233
bitte guck dir doch zuerst die docu an.



Habs kurz überflogen und mich bissel anfrüher erinnert, du musst da ein Array rein reichen mit der konfiguration des Channel (name, codex,...).

Zum testen kannst dir och mal alles ausgeben lassen was die Methode zurück gibt. Da steht meist auch der error da.
KoKsPfLaNzE is offline  
Old 05/19/2013, 19:42   #3
 
elite*gold: 0
Join Date: Nov 2012
Posts: 1,004
Received Thanks: 62
Ich suchn fertigen Beispielcode mit ner $_POST Methode.
imagecload is offline  
Old 05/19/2013, 20:58   #4
 
elite*gold: 25
Join Date: Sep 2011
Posts: 5,536
Received Thanks: 1,266
PHP Code:
<?php

$settings 
= array(
    
'channel_flag_semi_permanent' => 1
);

$ts3AdminClassInstance->channelCreate($settings);
?>
$settings ist ein Array, da rein gehören noch die Propertys wie Channel namen etc
IchVerabschiedeMich is offline  
Old 05/19/2013, 21:17   #5


 
elite*gold: 0
Join Date: Feb 2010
Posts: 7,220
Received Thanks: 6,758
PHP Code:
$settings = array();

$settings['channel_name'] = $_POST['name'];
$settings['channel_flag_semi_permanent'] = 1
$settings['channel_flag_permanent'] = 1;

channelCreate($settings); 
Damit würdest du schon einen Channel erstellt bekommen, der Rest muss nicht angegeben sein. Allerdings entweder setzt du den Channel Permanent oder semi Permanent, aber nicht beides
#SoNiice is offline  
Thanks
1 User
Old 05/20/2013, 11:39   #6
 
elite*gold: 0
Join Date: Nov 2012
Posts: 1,004
Received Thanks: 62
Der Code funktioniert nicht. Wenn ich das Formular abschickte taucht eine Weiße Seite auf obwohl da stehen sollte "Channel wurde erstellt".

PHP Code:
<?PHP
/**
  * clientkick.php
  *
  * Is a small script to demonstrate how to kick a client via ts3admin.class
  *
  * by par0noid solutions - ts3admin.info
  *
*/

/*-------SETTINGS-------*/
$ts3_ip '94.249.253.111';
$ts3_queryport 10011;
$ts3_user 'serveradmin';
$ts3_pass 'y1SKCgLy';
$ts3_port 9987;
$name=$_POST['username']; 
/*----------------------*/

#Include ts3admin.class.php
require("ts3admin.class.php");

#build a new ts3admin object
$tsAdmin = new ts3admin($ts3_ip$ts3_queryport);
$name=$_POST['username']; 
if(
$tsAdmin->getElement('success'$tsAdmin->connect())) {
    
#login as serveradmin
    
$tsAdmin->login($ts3_user$ts3_pass);
    
    
#select teamspeakserver
    
$tsAdmin->selectServer($ts3_port);
    
    
#check if id parameter is set
    
if(isset($_GET['id']) and !empty($_GET['id']) and ctype_digit($_GET['id'])) {
        
#kick player from server
        
if(!$tsAdmin->clientKick($_GET['id'], 'server')) {
            
#show error if client kick was failed
            
echo '<script>alert(\'Client not found\')</script>';
        }
    }
    
    
#get clientlist
    
$clients $tsAdmin->clientList();
    
 
    
#print client count
        
$settings = array();




$settings['channel_name'] = $_POST['username'];
$settings['channel_flag_semi_permanent'] = 1;*
$settings['channel_flag_permanent'] = 0;




channelCreate($settings); *
    
    
#print clients to browser
    
foreach($clients['data'] as $client) {
        
    }
}else{
    echo 
'Connection could not be established.';
}

/**
 * This code retuns all errors from the debugLog
 */
if(count($tsAdmin->getDebugLog()) > 0) {
    foreach(
$tsAdmin->getDebugLog() as $logEntry) {
        echo 
'<script>alert("'.$logEntry.'");</script>';
    }
}
?>
imagecload is offline  
Old 05/20/2013, 12:38   #7
 
KoKsPfLaNzE's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 731
Received Thanks: 233
Quote:
Originally Posted by imagecload View Post
Der Code funktioniert nicht. Wenn ich das Formular abschickte taucht eine Weiße Seite auf obwohl da stehen sollte "Channel wurde erstellt".

PHP Code:
<?PHP
/**
  * clientkick.php
  *
  * Is a small script to demonstrate how to kick a client via ts3admin.class
  *
  * by par0noid solutions - ts3admin.info
  *
*/

/*-------SETTINGS-------*/
$ts3_ip '94.249.253.111';
$ts3_queryport 10011;
$ts3_user 'serveradmin';
$ts3_pass 'y1SKCgLy';
$ts3_port 9987;
$name=$_POST['username']; 
/*----------------------*/

#Include ts3admin.class.php
require("ts3admin.class.php");

#build a new ts3admin object
$tsAdmin = new ts3admin($ts3_ip$ts3_queryport);
$name=$_POST['username']; 
if(
$tsAdmin->getElement('success'$tsAdmin->connect())) {
    
#login as serveradmin
    
$tsAdmin->login($ts3_user$ts3_pass);
    
    
#select teamspeakserver
    
$tsAdmin->selectServer($ts3_port);
    
    
#check if id parameter is set
    
if(isset($_GET['id']) and !empty($_GET['id']) and ctype_digit($_GET['id'])) {
        
#kick player from server
        
if(!$tsAdmin->clientKick($_GET['id'], 'server')) {
            
#show error if client kick was failed
            
echo '<script>alert(\'Client not found\')</script>';
        }
    }
    
    
#get clientlist
    
$clients $tsAdmin->clientList();
    
 
    
#print client count
        
$settings = array();




$settings['channel_name'] = $_POST['username'];
$settings['channel_flag_semi_permanent'] = 1;*
$settings['channel_flag_permanent'] = 0;




channelCreate($settings); *
    
    
#print clients to browser
    
foreach($clients['data'] as $client) {
        
    }
}else{
    echo 
'Connection could not be established.';
}

/**
 * This code retuns all errors from the debugLog
 */
if(count($tsAdmin->getDebugLog()) > 0) {
    foreach(
$tsAdmin->getDebugLog() as $logEntry) {
        echo 
'<script>alert("'.$logEntry.'");</script>';
    }
}
?>
das wird auch kaum so gehen. hast überhaupt schonmal davor php gemacht?


$tsAdmin->channelCreate($settings);
KoKsPfLaNzE is offline  
Old 05/20/2013, 17:37   #8
 
elite*gold: 0
Join Date: Nov 2012
Posts: 1,004
Received Thanks: 62
jein , Grundkenntnisse kenne ich aber insgeheim , nein.

PHP Code:
<?PHP
/**
  * clientkick.php
  *
  * Is a small script to demonstrate how to kick a client via ts3admin.class
  *
  * by par0noid solutions - ts3admin.info
  *
*/

/*-------SETTINGS-------*/
$ts3_ip '94.249.253.111';
$ts3_queryport 10011;
$ts3_user 'serveradmin';
$ts3_pass 'xxxxxx';
$ts3_port 9987;
$name=$_POST['username']; 
/*----------------------*/

#Include ts3admin.class.php
require("ts3admin.class.php");

#build a new ts3admin object
$tsAdmin = new ts3admin($ts3_ip$ts3_queryport);

if(
$tsAdmin->getElement('success'$tsAdmin->connect())) {
    
$tsAdmin->login($ts3_user$ts3_pass);
    
$tsAdmin->selectServer($ts3_port);
    
$settings = array();
    
$settings['channel_name'] = $name;
    
$settings['channel_flag_semi_permanent'] = 1;
    
$settings['channel_flag_permanent'] = 1;
    
$tsAdmin->channelCreate($settings);

}   

?>
Will leider immer noch nicht. Das selbe wie vorhin.
imagecload is offline  
Old 05/20/2013, 22:24   #9
 
KoKsPfLaNzE's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 731
Received Thanks: 233
dann lass dir doch ma den error ausgeben bzw guck ins log file wenn an php was net stimmt.
KoKsPfLaNzE is offline  
Old 05/20/2013, 23:04   #10


 
elite*gold: 0
Join Date: Feb 2010
Posts: 7,220
Received Thanks: 6,758
Anscheinend hast du meinen Post nicht mal gelesen. Ich habe extra geschrieben, ENTWEDER du setzt die "Semi-Permanent" Flag auf 1 ODER die "Permanent" Flag, aber nicht beides.

PHP Code:
<?php
    
include('ts3admin.class.php');

    
$ts3 = new ts3admin('ip'serverqueryport);

    
$ts3->connect();
    
$logged $ts3->login('serverquerylogin''serverquerypw');

    if(
$logged["success"]) {
        
$select $ts3->selectServer('serverport''port'true);
        if(
$select["success"]) {
            
$settings = array(); 
            
$settings['channel_name'] = "ChannelName"
            
$settings['channel_flag_permanent'] = 1
            
$ts3->channelCreate($settings); 
        } else {
            echo 
'Server kann nicht ausgewählt werden!';
        }

    } else {
        echo 
'Login fehlerhaft!';
    }
?>
Hab's mal eben ordentlich gemacht, funktioniert einwandfrei - bereits getestet.
#SoNiice is offline  
Reply


Similar Threads Similar Threads
2 Channel Erstellen!
06/22/2011 - Flyff Private Server - 2 Replies
Hallo hier zeig ich euch wie ihr ein 2ten Channel erstellt ! ihr geht in eure Account Server.ini und sucht euch das hir daraus: Das fügt ihr einfach noch ein Channel hinzu. So ungefähr sollte es dann Aussehen:
2. Channel erstellen
04/21/2011 - Metin2 Private Server - 1 Replies
Hallo Leute, ich suche schon ne ganze weile ein How to um einen 2. Channel auf meinem Metin2 p-server zu erstellen jedoch habe ich bis jetz nichts gefunden !!!außer so n thread wo als antwort n link für n zweiten channel von flyff war aba scheint so als ob das nichts bringt^^ deswegen wollte ich euch nochmal fragen pls help thx schonmal im vorraus ;)
Channel Erstellen ?
03/20/2010 - Metin2 Private Server - 10 Replies
Hallo liebe Leute, Ich Habe ein Problem un zwar will bei meinem P-server noch zusätzlich zum ch1 einen ch2 erstellen nur Leider weiß ich nicht wie das geht und habe auch kein Gutes HOW TO gefunden hoffe das mir einer von euch helfen kann...
Globalen channel erstellen
10/01/2009 - WoW Private Server - 0 Replies
Hallo, weiß denn jemand wie man auf einem Privatserver einen globalen channel erstellt, so das ihn jeder lesen kann egal wo man ist, Kleines beispiel zur verdeutlichung: Ich schreibe etwas in Dunkelküste und person xxx kann es in Tirisfal lesen. sollte wenn möglich horde und allianz können! servertyp mangos patch 3.2.2a
Eigenen Channel erstellen
11/02/2005 - World of Warcraft - 10 Replies
So wie das topic schon sagt möchte ich gerne einen eigenen channel im game erstellen, wenn es geht mit passwort! 1. Wie erstelle ich einen eigenen channel? mit /join "Channelname"? 2. Wie mache ich da ein Passwort rein? geht es überhaupt? Danke für hoffentlich zahlreiche antworten :D



All times are GMT +1. The time now is 05:18.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.