Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Created by Dinip
- //config
- $qLogin = array (
- 'loginInfo' => array (
- 'IP' => "127.0.0.1",
- 'PORT_UDP' => '9987',
- 'PORT_QUERY' => '10011',
- 'NICK' => "Banner",
- 'LOGIN_QUERY' => 'serveradmin',
- 'PASS_QUERY' => "xxx",
- )
- );
- header('Content-Type: image/png');
- require_once("lib/ts3admin.class.php");
- date_default_timezone_set("Europe/Lisbon");
- global $ts3;
- $ts3 = new ts3admin($qLogin['loginInfo']['IP'], $qLogin['loginInfo']['PORT_QUERY']);
- $date = date('d.m.y');
- $time = date('H:i');
- if($ts3->succeeded($ts3->connect())) {
- $ts3->login($qLogin['loginInfo']['LOGIN_QUERY'], $qLogin['loginInfo']['PASS_QUERY']);
- $ts3->selectServer($qLogin['loginInfo']['PORT_UDP']);
- $ts3->login($qLogin['loginInfo']['LOGIN_QUERY'], $qLogin['loginInfo']['PASS_QUERY']);
- $ts3->setName($qLogin['loginInfo']['NICK']);
- $infoServer = $ts3->getElement('data', $ts3->serverInfo(), $ts3->getData('multi', 'servergrouplist'));
- $ts3->logout();
- }
- $cfg['groups'] = array(9, 12);
- $clients = $ts3->clientList();
- $channelList = $ts3->channelList();
- $slots = $infoServer['virtualserver_clientsonline']-$infoServer['virtualserver_queryclientsonline'];
- $maxSlots = $infoServer['virtualserver_maxclients'];
- $staff = count($clients["data"]);
- $channels = count($channelList['data']);
- $textTime = "Horas: ".$time;
- $textDate = "Data: " .$date;
- $textStaff = "Staff Online: " .$staff;
- $textChannels = "Channels: " .$channels;
- $textPing = "Ping Médio: ".number_format($infoServer['virtualserver_total_ping'], 2) ." ms";
- $textClients = "Users: ".$slots."/".$maxSlots;
- $image = imagecreatefrompng("dg5.png");
- $textColor = imagecolorallocate($image, 0, 0, 0);
- //imagestring($image, 5, 10, 5, $text, $textColor);
- //imagettftext($image, 18, 0, 5, 225, $textColor, "fonts/Exo-Medium.ttf", $text);
- imagettftext($image, 17, 0, 30, 87, $textColor, "fonts/GROBOLD.ttf", $textTime);
- imagettftext($image, 17, 0, 30, 127, $textColor, "fonts/GROBOLD.ttf", $textPing);
- imagettftext($image, 17, 0, 30, 167, $textColor, "fonts/GROBOLD.ttf", $textStaff);
- imagettftext($image, 17, 0, 30, 207, $textColor, "fonts/GROBOLD.ttf", $textChannels);
- imagettftext($image, 17, 0, 30, 247, $textColor, "fonts/GROBOLD.ttf", $textClients);
- imagepng($image);
- imagedestroy($image);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement