Forum

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Join Date
    December 2009
    Location
    Germany
    Posts
    26

    Ts3 php on/off status

    Hello,

    i have update my server Server 64-bit 3.0.0-beta25

    The Php script not working with the new ts3 server verion why?

    Code:
    $host = '127.0.0.1';		// Configure your IP or FQDN
    $query_port = 10011;		// Configure your Query Port
    $serverID = 1;
    
    $tsAdmin = new ts3admin($host, $query_port);
    $tsAdmin->connect();
    
    $tsAdmin->selectServer($serverID);
    $serverInfo = $tsAdmin->serverInfo();
    $maxclients = $serverInfo[virtualserver_maxclients];
    $clientsonline = $serverInfo[virtualserver_clientsonline] - $serverInfo[virtualserver_queryclientsonline];
    if ($serverInfo[virtualserver_status] != "online"){
    ?>
    Teamspeak³ <img src="include/images/icons/offline.png" border="0"></a>
    <?php
      }else{
    ?>
    Teamspeak³ <img src="include/images/icons/online.png" border="0"></a>
    <?php
    }
    
    $tsAdmin->logout();
    $tsAdmin->quit();
    greetz

  2. #2
    Join Date
    May 2010
    Posts
    6,310
    Hello

    Have you an error message ?
    Have you check up the permissions for the "Guest query group" ?

  3. #3
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    bei other script say Invalid server response

  4. #4
    Join Date
    May 2010
    Posts
    6,310
    What is your previous server version ? If is it too old, maybe your script is outdated.

    Check up your php script and query command line that this one use

  5. #5
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    Quote Originally Posted by Siggi View Post
    Hello,

    i have update my server Server 64-bit 3.0.0-beta25

    The Php script not working with the new ts3 server verion why?

    Code:
    $host = '127.0.0.1';		// Configure your IP or FQDN
    $query_port = 10011;		// Configure your Query Port
    $serverID = 1;
    
    $tsAdmin = new ts3admin($host, $query_port);
    $tsAdmin->connect();
    
    $tsAdmin->selectServer($serverID);
    $serverInfo = $tsAdmin->serverInfo();
    $maxclients = $serverInfo[virtualserver_maxclients];
    $clientsonline = $serverInfo[virtualserver_clientsonline] - $serverInfo[virtualserver_queryclientsonline];
    if ($serverInfo[virtualserver_status] != "online"){
    ?>
    Teamspeak³ <img src="include/images/icons/offline.png" border="0"></a>
    <?php
      }else{
    ?>
    Teamspeak³ <img src="include/images/icons/online.png" border="0"></a>
    <?php
    }
    
    $tsAdmin->logout();
    $tsAdmin->quit();
    greetz
    the old version Beta 19 an new version Beta 25 and the script is the same

    web status say me offline but the server is online

  6. #6
    Join Date
    May 2010
    Posts
    6,310
    Have you try with the last version of ts3admin script ?

    If yes and if you have the same result, send me your script I'll try to debug.

  7. #7
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    i have the new ts3admin.class from http://www.ts3admin.de.tp/

    Newest version: 0.1.7
    Last modify: Saturday, 22 May 2010

  8. #8
    Join Date
    May 2010
    Posts
    6,310
    I add the "require" line and your script and it works perfectly
    (require "ts3admin.class.php"

  9. #9
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    its say me
    Fatal error: Cannot redeclare class ts3admin in C:\Inetpub\vhosts\httpdocs\cms\include\contents\te amspeak\ts3admin.class.php on line 28

  10. #10
    Join Date
    May 2010
    Posts
    6,310
    Yes it's normal.
    I add this because in your zip file I don't have all file that you used.

    Send me all script files and I rebuild it.

  11. #11
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    i have send a pm

  12. #12
    Join Date
    May 2010
    Posts
    6,310
    Ok,

    In your serverstatus.php (as write in the documentation) you need add the login line (for example) :

    $tsAdmin->login('serveradmin', 'florian');

  13. #13
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    why the uptime script not work

    Code:
    	$tsAdmin = new ts3admin("127.0.0.1", 10011);
    	$tsAdmin->connect();
             $tsAdmin->login('serveradmin', 'secret');
             $tsAdmin->selectServer(1);
             $data = $tsAdmin->serverInfo();
    
    	$uptime = $data['virtualserver_uptime'];
             $tage = floor(($uptime / 86400000));
    	$uptime -= (86400000 * $tage);
    
    	$stunden = floor(($uptime / 3600000));
    	$uptime -= (3600000 * $stunden);
    
    	$minuten = floor(($uptime / 60000));
    	$uptime -= (60000 * $minuten);
    
    	$sekunden = floor(($uptime / 1000));
    	$uptime -= (1000 * $sekunden);            //$uptime enthält nun nur noch Millisekunden
    
    
    	$timeString = $tage.' Tage, '.$stunden.' Std, '.$minuten.' Min und '.$sekunden.' Sek';
    
    
    	echo '<br><b>Gesendete Daten:</b> ' . round($data['connection_bytes_sent_total']/1024/1024,2) . ' MB.<br>';
    	echo '<b>Empfangene Daten:</b> ' . round($data['connection_bytes_received_total']/1024/1024,2) . ' MB.<br>';
    	echo '<b>Online seit:</b> ' . $timeString;
    
    	$tsAdmin->quit();
    thx

  14. #14
    Join Date
    May 2010
    Posts
    6,310
    try with the original function that have you send

  15. #15
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    dont understand the script

    send me complete script pls

    thx 4 help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. TS3 DNS status
    By steverowland in forum Off Topic
    Replies: 1
    Last Post: October 11th, 2014, 02:26 PM
  2. Away status
    By grindingman in forum General Questions
    Replies: 3
    Last Post: April 22nd, 2011, 11:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •