Example #1
1
    protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
    {
        $visitor = XenForo_Visitor::getInstance();
        if (XenForo_Permission::hasPermission($visitor['permissions'], 'moturdrn_gw2api', 'verified')) {
            require_once "library/Moturdrn/TS3GW2Auth/Includes/TeamSpeak3/ts3admin.class.php";
            $tsAdmin = new ts3admin(XenForo_Application::getOptions()->ts3gw2auth_ts3server, XenForo_Application::getOptions()->ts3gw2auth_ts3sqport);
            if ($tsAdmin->getElement('success', $tsAdmin->connect())) {
                $tsAdmin->login(XenForo_Application::getOptions()->ts3gw2auth_ts3username, XenForo_Application::getOptions()->ts3gw2auth_ts3password);
                $tsAdmin->selectServer(XenForo_Application::getOptions()->ts3gw2auth_ts3port);
            }
            $ts3server = array();
            $serverinfo = $tsAdmin->serverInfo();
            $ts3server['server_name'] = $serverinfo['data']['virtualserver_name'];
            $ts3server['connected_clients'] = $serverinfo['data']['virtualserver_clientsonline'];
            $channellist = $tsAdmin->channelList("-topic -flags -voice -limits -icon");
            $clientlist = $tsAdmin->clientList("-uid -away -voice -times -groups -info -country -icon -ip -badges");
            foreach ($channellist['data'] as $channelInfo) {
                $ts3server['channellist'][$channelInfo['cid']] = $channelInfo;
            }
            foreach ($clientlist['data'] as $clientInfo) {
                if ($clientInfo['client_type'] == 1) {
                    $this->subtractClient($ts3server['channellist'], $clientInfo['cid']);
                } else {
                    $ts3server['clientlist'][] = $clientInfo;
                }
            }
            $ts3server['channellist'] = $this->buildTree($ts3server['channellist']);
            $ts3server['clientlist'] = $this->array_orderby($ts3server['clientlist'], 'client_talk_power', SORT_DESC, 'client_nickname', SORT_ASC);
            $output = "";
            foreach ($ts3server['channellist'] as $channel) {
                $output .= $this->outputChannel($channel, $ts3server['clientlist']);
            }
            $tsOutput = <<<HTML
<b><a href="https://www.gunnars-hold.eu/resources/gunnars-hold-ts-information.10/" class='tschannellink'>* Connection & Server Details</a></b><br />
<b><a href='ts3server://ts3.gunnars-hold.eu/?port=9987' class='tschannellink'>* Or Click Here To Connect Now!</a></b><br /><br />
{$output}
HTML;
        } else {
            $tsOutput = 'You cannot view this item';
        }
        $renderTemplateObject->setParam('tsOutput', $tsOutput);
        return $renderTemplateObject->render();
    }
Example #2
0
                         $tsAdmin->clientPoke($find_temp['clid'], $config['poke_message']);
                         #Ustawienie czasu do następnego poke
                         $poketimer = date('r', time() + $config['time']);
                     }
                 }
             }
         }
     }
 }
 $i = 0;
 $sended = array();
 $send = array();
 #Sprawdzanie czy ktoś jest na kanale
 while ($i >= 0) {
     #Pobieranie listy użytkowników serwera
     $clientlList = $tsAdmin->clientList();
     #Przeszukiwanie wszystkich użytkowników
     foreach ($clientlList['data'] as $temp) {
         #Wybór użytkowników obecnym na wybranym kanale
         if ($temp['cid'] == $config['channel_id']) {
             #Przypisywanie id obecnych użytkowników na kanale do tablicy $send
             $send[$temp['clid']] = $temp['clid'];
             #Sprawdzanie kto nie dostał prywatnej wiadomości
             $diff = array_diff($send, $sended);
             poke();
             #Wysyłanie wiadomości wszystkim użytkownikom którzy dopiero weszli na kanał
             foreach ($diff as $temp_diff) {
                 #Wysyłanie wiadomości kiedy nie ma żadnego administratora
                 #if($poke > 0)
                 #{
                 $tsAdmin->sendMessage(1, $temp_diff, $config['Admin_online']);
Example #3
0
<?php

header("Content-type: image/jpeg");
putenv('GDFONTPATH=' . realpath('.'));
require_once "ts3admin.class.php";
$config = array('ip' => '127.0.0.1', 'port' => '9987', 'query_port' => '10011');
$tsServer = new ts3admin($config['ip'], $config['query_port']);
if ($tsServer->getElement('success', $tsServer->connect())) {
    $tsServer->selectServer($config['port']);
    $player = $tsServer->hostInfo();
    $clients = $tsServer->clientList();
    $name = $tsServer->serverList();
    $hostname = preg_replace("/[^a-zA-Z0-9_ %\\[\\]\\.\\(\\)%@#\$!\\/:|,-]/s", "", $name['data']['0']['virtualserver_name']);
    $plr_count = $player['data']['virtualservers_total_clients_online'];
    $max_plrs = $player['data']['virtualservers_total_maxclients'];
} else {
    $max_plrs = "0";
    $hostname = "Serwer jest OFFLINE!!!";
    $plr_count = "0";
}
$image = imagecreatefromjpeg("ts.jpg");
$color = ImageColorAllocate($image, 255, 255, 255);
$colorobr = ImageColorAllocate($image, 0, 0, 0);
imagettftext($image, 10, 0, -10, 8, $color, "visitor.ttf", $hostname);
imagettftext($image, 10, 0, 225, 17, $color, "visitor.ttf", $config['ip'] . $config['port']);
imagettftext($image, 10, 0, 310, 8, $color, "visitor.ttf", $plr_count . "/" . $max_plrs);
imagealphablending($image, false);
imagesavealpha($image, true);
imagepng($image);
ImageDestroy($image);