How to get Teamspeak Status/Uptime/Servername/Version/Clients/Slots

Discussion in 'PHP' started by Ridicc, Sep 21, 2015.

  1. Ridicc

    Ridicc Super Mod

    You need the TeamSpeak 3 PHP Framework! I don't write a tutorial how to use this, because you should know PHP to use this and i don't like to see that somebody just uses copy pasta :)
    PHP:
    //Show the ip of your server
    $ts3->getAdapterHost()
    PHP:
    //Show the port of your server
    $ts3->virtualserver_port
    PHP:
    //Show the name of your server
    $ts3->virtualserver_name
    PHP:
    //Show the current uptime of your server
    TeamSpeak3_Helper_Convert::seconds($ts3->virtualserver_uptime)
    PHP:
    //Show the current server version
    TeamSpeak3_Helper_Convert::version($ts3->virtualserver_version)
    PHP:
    //Show the current online clients
    $ts3->virtualserver_clientsonline
    PHP:
    //Show the max clients
    $ts3->virtualserver_maxclients
     
    0x0539, Asphyxia, Exp and 1 other person like this.
  2. Exp

    Exp New Member

    PHP:
    $name $ts3_VirtualServer->clientGetById($clientid);
    //Getting system
    $system $name["client_platform"];

    //Getting connections time
    $connections $name->client_totalconnections

    //Getting description
    $desc $name->client_description;
     
    Asphyxia and Ridicc like this.
  3. r00t-Server

    r00t-Server Member

    but how to work ?
     
  4. Ridicc

    Ridicc Super Mod

    Code:
      $rIP = $_POST["IP"];
      $vPORT = $_POST["PORT"];
      $vQPORT = $_POST["QPORT"];
    
      require_once("libraries/TeamSpeak3/TeamSpeak3.php");
    
      try{
      $ts3 = TeamSpeak3::factory("serverquery://@$rIP:$vQPORT/?server_port=$vPORT");
      echo "Clients online: $ts3->virtualserver_clientsonline / $ts3->virtualserver_maxclients";
      }
      catch(Exception $e)
      {
      echo "Unable to connect to the Server";
      }
    
     
  5. r00t-Server

    r00t-Server Member

    Would you explain short work please know in order to understand this allowance but where we put code
    :confused::(
     
  6. Ridicc

    Ridicc Super Mod

    Do you even have any knowledge about php?
     
    Derp, Supervisor and 0day like this.
  7. r00t-Server

    r00t-Server Member

    He has knowledge in the language of php but not related to where my friend

    But you must be working on a simplified explanation to be the simplest to the person Shi Thank you

    :)
     
  8. Ridicc

    Ridicc Super Mod

    The following is a project i made when i was mad but it's very old and it wont work very well so you shouldn't c&p it but if you understand php, you should understand how this works :)

    HTML:
    <div class="form-group">
      <form method="POST">
      <div id="nebeneinander">
      <p style="margin-top:3px;font-size:10pt;float: left; cursor:default;" class="btn btn-sm">IP / Domain:</p><input maxlength="30" placeholder="Ex: 127.0.0.1" style="text-align:center;float:left; width:120px;" class="form-control" id="inputDefault" TYPE = "Text" VALUE ="" NAME = "IP">
      <p style="margin-top:3px;font-size:10pt;float: left; cursor:default;" class="btn btn-sm">Port:</p><input maxlength="5" placeholder="9987" style="text-align:center;float:left; width:60px;" class="form-control" id="inputDefault" TYPE = "Text" VALUE ="" NAME = "PORT">
      <p style="margin-top:3px;font-size:10pt;float: left; cursor:default;" class="btn btn-sm">Query Port:</p><input placeholder="10011" maxlength="5" style="text-align:center;float:left; width:60px;" class="form-control" id="inputDefault" TYPE = "Text" VALUE ="" NAME = "QPORT">
       
      <input style="float:left; margin-left:10px;" type="submit" class="btn btn-default" name="button" value="Check this Server"/>
      </div></form>
      <br /><br />
    
    PHP:
    if(isset($_POST['button']))
      {
      
    $rIP $_POST["IP"];
      
    $vPORT $_POST["PORT"];
      
    $vQPORT $_POST["QPORT"];
      require_once(
    "libraries/TeamSpeak3/TeamSpeak3.php");
      try
      {
      
    $ts3 TeamSpeak3::factory("serverquery://@$rIP:$vQPORT/?server_port=$vPORT");
      echo 
    "
      <table class=\"table table-striped table-hover \">
      <thead>
      <tr>
      <th>Server Status</th>
      <th>Server Name</th>
      <th>Server Adresse</th>
      <th>Slots</th>
      <th>Server Version</th>
      </tr>
      </thead>
      <tbody>
      <tr>
      <td style=\"color:#00C900;\">Online</td>
      <td>
    $ts3->virtualserver_name</td>
      <td>
    $rIP:$ts3->virtualserver_port</td>
      <td>
    $ts3->virtualserver_clientsonline / $ts3->virtualserver_maxclients</td>
      <td>
    $ts3->virtualserver_version</td>
      "
    ;
      }
      catch(
    Exception $e)
      {
      echo 
    "
      <table class=\"table table-striped table-hover \">
      <thead>
      <tr>
      <th>Server Status</th>
      <th>Server Name</th>
      <th>Server Adresse</th>
      <th>Slots</th>
      <th>Server Version</th>
      </tr>
      </thead>
      <tbody>
      <tr>
      <td style=\"color:#FF0000;\">Offline</td>
      <td>-</td>
      <td>-</td>
      <td>-</td>
      <td>-</td>
      "
    ;
      }
      }
    You need to register to view spoilers!
     
    Cepkin and DDoSBoy like this.
  9. r00t-Server

    r00t-Server Member

    Do you raise the script is ready and raised here Shi be the best we see and learn from you and you and take advantage of this beautiful thing

    Thank you for this beautiful explanation :(
     
  10. Ridicc

    Ridicc Super Mod

    I don't understand your problem... I gave you a whole source of this stuff and you still want an explanation? If you would have knowlege php you should understand how this works.
    Take a closer look at those things or join the r4p3 teamspeak and ask me every question you have.
    Code:
    require_once("libraries/TeamSpeak3/TeamSpeak3.php");
    
      $ts3 = TeamSpeak3::factory("serverquery://@$rIP:$vQPORT/?server_port=$vPORT");
    
    <td>$ts3->virtualserver_name</td>
    <td>$rIP:$ts3->virtualserver_port</td>
    <td>$ts3->virtualserver_clientsonline / $ts3->virtualserver_maxclients</td>
    <td>$ts3->virtualserver_version</td>
    
     
    Qraktzyl, 0x0539 and Derp like this.
  11. please can i get the style of the picture
     
  12. GlumiChan

    GlumiChan New Member

    The Framework does not contain 'client_description' anymore :/
    Not in the Clientlist and not in the ClientFindByXXX
    Where is the ClientDescription gone? O:

    EDIT (Solved):
    Solution: The "client_descrpition" is only available when the Client actually has a Description.. So you have to check it before you want to loop through clientlist and their descriptions.
     
    Last edited: Oct 8, 2016
  13. AmellRa89

    AmellRa89 VIP

    admin online ????
    needed code ??
     

Share This Page