Forum

Results 1 to 5 of 5
  1. #1
    Join Date
    February 2012
    Posts
    3

    TS3 Online status + online number only, for website

    Hello!

    I'm looking for viewer on my site with only Online status (on/off) and online number. Don't need full list of online members.

    Have you ever seen something like that?

    Thanks.

  2. #2
    Join Date
    February 2012
    Location
    France
    Posts
    69
    Hello,

    Chek here: http://addons.teamspeak.com/director...web-based.html. I think you find that you wants.

  3. #3
    Join Date
    February 2012
    Posts
    3
    I can only see typical viewers with channels etc. I'm looking for simple 2 lines: Online Status, and Online Users (number). Nothing more. Any guide how can I write that or any released project anywhere?

  4. #4
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029
    Code:
    <?php
    /**
     * @name Display TS3 Status and Clientcount
     * @author SilentStorm
     */
    
    date_default_timezone_set("Europe/London");
    require_once("./libraries/TeamSpeak3/TeamSpeak3.php");
    TeamSpeak3::init();
    
    header('Content-Type: text/html; charset=utf8');
    
    $status = "offline";
    $count = 0;
    $max = 0;
    
    try {
        $ts3 = TeamSpeak3::factory("serverquery://<QUERY_USER>:<PASSWORD>@<SERVER_NAME_OR_IP>:<QUERY_PORT>/?server_port=<TS3_VOICE_PORT>&use_offline_as_virtual=1&no_query_clients=1");
        $status = $ts3->getProperty("virtualserver_status");
        $count = $ts3->getProperty("virtualserver_clientsonline") - $ts3->getProperty("virtualserver_queryclientsonline");
        $max = $ts3->getProperty("virtualserver_maxclients");
    }
    catch (Exception $e) {
        echo '<div style="background-color:red; color:white; display:block; font-weight:bold;">QueryError: ' . $e->getCode() . ' ' . $e->getMessage() . '</div>';
    }
    echo '<span class="ts3status">TS3 Server Status: ' . $status . '</span><br/><span class="ts3_clientcount">Clients online: ' . $count . '/' . $max . '</span>';
    
    ?>
    Requires TS3 PHP Framework
    Fill in the Blanks in above Code to fit your Scenario.
    Everything you have to change is surrounded by <> and written in ALL CAPS! Make sure you replace all the ALL CAPS stuff including the < and > Signs surrounding them. Do NOT replace anything else.
    Save it as ts3status.php somewhere on your Server and put the following anywhere where you want to display the information:
    Code:
    <?php
    include('path/where/you/put/the/file/ts3status.php');
    ?>

  5. #5
    Join Date
    December 2011
    Posts
    11
    Quote Originally Posted by SilentStorm View Post
    Code:
    <?php
    /**
     * @name Display TS3 Status and Clientcount
     * @author SilentStorm
     */
    
    date_default_timezone_set("Europe/London");
    require_once("./libraries/TeamSpeak3/TeamSpeak3.php");
    TeamSpeak3::init();
    
    header('Content-Type: text/html; charset=utf8');
    
    $status = "offline";
    $count = 0;
    $max = 0;
    
    try {
        $ts3 = TeamSpeak3::factory("serverquery://<QUERY_USER>:<PASSWORD>@<SERVER_NAME_OR_IP>:<QUERY_PORT>/?server_port=<TS3_VOICE_PORT>&use_offline_as_virtual=1&no_query_clients=1");
        $status = $ts3->getProperty("virtualserver_status");
        $count = $ts3->getProperty("virtualserver_clientsonline") - $ts3->getProperty("virtualserver_queryclientsonline");
        $max = $ts3->getProperty("virtualserver_maxclients");
    }
    catch (Exception $e) {
        echo '<div style="background-color:red; color:white; display:block; font-weight:bold;">QueryError: ' . $e->getCode() . ' ' . $e->getMessage() . '</div>';
    }
    echo '<span class="ts3status">TS3 Server Status: ' . $status . '</span><br/><span class="ts3_clientcount">Clients online: ' . $count . '/' . $max . '</span>';
    
    ?>
    Requires TS3 PHP Framework
    Fill in the Blanks in above Code to fit your Scenario.
    Everything you have to change is surrounded by <> and written in ALL CAPS! Make sure you replace all the ALL CAPS stuff including the < and > Signs surrounding them. Do NOT replace anything else.
    Save it as ts3status.php somewhere on your Server and put the following anywhere where you want to display the information:
    Code:
    <?php
    include('path/where/you/put/the/file/ts3status.php');
    ?>
    Just tried it out. Getting this error:
    Warning: include(/public_html/status/ts3status.php) [function.include]: failed to open stream: No such file or directory in /home1/yourcp/public_html/status/index.php on line 2

    Warning: include() [function.include]: Failed opening '/public_html/status/ts3status.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/yourcp/public_html/status/index.php on line 2
    . WHat do i do. The path directory is right and all serverquery is too

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Number of Online Users Query without Login
    By Matonym in forum Tools / Web Based
    Replies: 2
    Last Post: April 2nd, 2019, 04:15 PM
  2. [Solved] Teamspeak Website Online/Offline Status
    By paulchain in forum Server Support
    Replies: 1
    Last Post: January 16th, 2010, 03:13 PM

Posting Permissions

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