Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    send me pls the complete script

    zb. is the complete script
    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();

  2. #17
    Join Date
    May 2010
    Posts
    6,310
    Yes yes it's free support not military support

    I write an example for you.

    *** Edit ***

    To be sure that you receive the server uptime, in your script you can write
    PHP Code:
    echo $data['virtualserver_uptime']; 
    Well, the virtualserver_uptime it's the number of second since the server startup.

    You must be separate hours, minutes and second

    PHP Code:
    $uptime $data['virtualserver_uptime'];
    $minutes $uptime 60// to find the number of minutes
    $hours floor($minutes 60);  // to find the number of hours
    $realMinutes $minutes - ($hours 60);
    echo 
    $hours.'h '.floor($realMinutes).'min'
    Last edited by florian_fr40; July 20th, 2010 at 09:02 AM.

  3. #18
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    thx 4 help

    i have not enough Experience to rewrite the script

    days and seconds

    Code:
    $uptime = $data['virtualserver_uptime'];
    $sekunden = $uptime / 1000; // to find the number of minutes
    $minuten = $uptime / 60; // to find the number of minutes
    $stunden = floor($minuten / 60);  // to find the number of hours
    $realMinuten = $minuten - ($stunden * 60);
    
    	$timeString = $tage.' Tage, '.$stunden.' Std, '.floor($realMinuten).' Min und '.$sekunden.' Sek';

  4. #19
    Join Date
    December 2009
    Location
    Germany
    Posts
    26
    understanding to convert sek and days

    Code:
    $uptime = $data['virtualserver_uptime'];
    $sekunden = $uptime / 60 / 60;
    $minuten = $uptime / 60; // to find the number of minutes
    $stunden = floor($minuten / 60);  // to find the number of hours
    $tage = floor($minuten / 60 / 24);
    $realMinuten = $minuten - ($stunden * 60);
    
    	$timeString = $tage.' Tage, '.$stunden.' Std, '.floor($realMinuten).' Min und '.$sekunden.' Sek';

  5. #20
    Join Date
    November 2010
    Location
    usa
    Posts
    6

    Please I need help

    Hello

    I am the webmaster of Net Games 3D we have a licence I knwo we can use the special support but I prefer for now ask few questions.

    I have edit the script and it is running. but cannot connect the server:

    echo:
    Teamspeak S1 OFF LINE
    Gesendete Daten: 0 MB.
    Empfangene Daten: 0 MB.
    Online seit: 0 Tage, 0 Std, 0 Min und 0 Sek

    script:
    <?PHP
    include ('ts3admin.class.php');
    $tsAdmin = new ts3admin('xxx.xxx.xxx.xxx, 10011');
    $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 S1 <img src="include/images/icons/offline.png" border="0"></a>
    <?php
    }else{
    ?>
    Teamspeak S1 <img src="include/images/icons/online.png" border="0"></a>
    <?php
    }
    $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->logout();
    $tsAdmin->quit();
    ?>

    please can u let me know if I have to change permisions or open an internal port .

    OS Linux CENTOS x86

    Thanks

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

    What is exactly the error message ?
    The IP address of web server is on query_ip_whitelist ?
    This permissions :
    • b_virtualserver_select
    • b_virtualserver_info_view

    are correctly set in the Guest query group ?

  7. #22
    Join Date
    November 2010
    Location
    usa
    Posts
    6
    It don't shows any erro just shows the server offline: http://www.netgames3d.com/_test.php

    I haven't find the files:

    b_virtualserver_select
    b_virtualserver_info_view

    Where supposed should I find this files?

    Thanks sorry on my delay on this answer I had few days off.
    Last edited by netgames3d; November 26th, 2010 at 07:11 AM.

  8. #23
    Join Date
    November 2010
    Location
    usa
    Posts
    6
    Oh! sorry I have to edit the permissions in the server configuration, may you explain me witch files should I edit with the boolean code system?

    BTW Guys amazing TS3 is an amazing system congratz!

  9. #24
    Join Date
    March 2011
    Location
    Russia
    Posts
    24
    Hello, I have not worked this script shows server offline
    Version of the server:
    3.0.0-beta30 [Build: 12998] on Windows
    Please help me

  10. #25
    Join Date
    April 2010
    Location
    Russia
    Posts
    12
    Give a ready script, please :]

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, 01:26 PM
  2. Away status
    By grindingman in forum General Questions
    Replies: 3
    Last Post: April 22nd, 2011, 10: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
  •