ts3admin.class not working anymore :/

h1web

VIP
Sep 2, 2015
206
134
131
Hey guys, im using the latest ts3admin.class.php file ( https://raw.githubusercontent.com/par0noid/ts3admin.class/master/lib/ts3admin.class.php )

However, now my Script is not working anymore:

Code:
php group.php
PHP Fatal error:  Uncaught Error: Class 'ts3admin' not found in /var/www/ts3country/group.php:20
Stack trace:
#0 {main}
  thrown in /var/www/ts3country/group.php on line 20

im using the latest 3.10.0 Teamspeak Server :(

Code:
<?php
    require_once("ts3admin.class.php");

    $teamspeakInfo = array(
        'username' => 'serveradmin',
        'password' => 'xxx',
        'host' => 'xxx',
        'portQuery' => '10011',
        'portServer' => '9987',
        'displayname' => 'Verification Bot' // Display of the Bot
    );

    $groupsetup = array(
        "AT" => 400,
    "DE" => 400,
    "CH" => 400
    );

    require_once("ts3admin.class.php");
    $tsAdmin = new ts3admin($teamspeakInfo['host'], $teamspeakInfo['portQuery']);
    
    if($tsAdmin->getElement('success', $tsAdmin->connect())) {
        echo "> Successfully connected to the teamspeak server\n";
        $tsAdmin->login($teamspeakInfo['username'], $teamspeakInfo['password']);
        echo "> Successfully logged in\n";
        $tsAdmin->selectServer($teamspeakInfo['portServer']);
        echo "> Successfully selected server ".$teamspeakInfo['portServer']."\n";
        $tsAdmin->setName($teamspeakInfo['displayname']);
        echo "> Successfully changed name to ".$teamspeakInfo['displayname']."\n";

        $clients = $tsAdmin->clientList("-country");

        foreach($clients['data'] as $client) {
            if (array_key_exists($client["client_country"], $groupsetup)) {
                echo "> Adding Client ".$client["client_database_id"]." to ServerGroup ".$groupsetup[$client["client_country"]];
                $tsAdmin->serverGroupAddClient($groupsetup[$client["client_country"]], $client["client_database_id"]);
            };
        };
    };

?>
 

h1web

VIP
Sep 2, 2015
206
134
131
Still getting


Code:
 php -e group.php
PHP Fatal error:  Uncaught Error: Class 'ts3admin' not found in /var/www/ts3country/group.php:22
Stack trace:
#0 {main}
  thrown in /var/www/ts3country/group.php on line 22

wtf o_O
 

daffik1

Member
Feb 19, 2016
23
2
50
Why 2x require_once, }; what? and port should be int not string, delete ''. Google at "PHP display error" and @up
 
Top