Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $image = imagecreatefrompng("banner.png");
- $black = imagecolorallocate($image, 255, 255, 0);
- $rozmiar = 30;
- $pochylenie = 0;
- $x = 105;
- $y = 301;
- putenv('GDFONTPATH=' . realpath('.'));
- // wyswietlenie daty
- //imagettftext($image, $rozmiar, $pochylenie, $x, $y, $black, "Open 24 Display St.ttf","170");
- $bbox = imagettfbbox(34, 0, "Open 24 Display St.ttf", date('H:i'));
- $x = $bbox[0] + (imagesx($image) / 2) - ($bbox[4] / 2) - 0;
- $y = $bbox[1] + (imagesy($image) / 2) - ($bbox[5] / 2) - 213;
- imagettftext($image, 34, 0, $x, $y, $black, "Open 24 Display St.ttf", date('H:i'));
- //
- include("lib/ts3admin.class.php");
- // dane połaczenia
- $ts3_ip = '';
- $ts3_queryport = 10011;
- $ts3_user = 'serveradmin';
- $ts3_pass = '';
- $ts3_port = 9987;
- // inicjacja polaczenia
- $ts3 = new ts3admin($ts3_ip, $ts3_queryport);
- if($ts3->getElement('success', $ts3->connect())) {$ts3->login($ts3_user, $ts3_pass);$ts3->selectServer($ts3_port);
- $info = $ts3->serverList();
- $all = $info['data'][0]['virtualserver_clientsonline'];
- $query = $info['data'][0]['virtualserver_queryclientsonline'];
- $user = $all - $query;
- //wyswietlenie ilosci online
- $bbox1 = imagettfbbox(34, 0, "Open 24 Display St.ttf", "$user");
- $x1 = $bbox1[0] + (imagesx($image) / 2) - ($bbox1[4] / 2) - 670;
- $y1 = $bbox1[1] + (imagesy($image) / 2) - ($bbox1[5] / 2) - 13;
- imagettftext($image, 34, 0, $x1, $y1, $black, "Open 24 Display St.ttf", "$user");
- //
- $info = $ts3->serverGroupClientList('391');
- $ilosc_a = count($info['data']);
- //wyswietlenie ilosci administratorów
- $bbox1 = imagettfbbox(34, 0, "Open 24 Display St.ttf", "$ilosc_a");
- $x1 = $bbox1[0] + (imagesx($image) / 2) - ($bbox1[4] / 2) - 453;
- $y1 = $bbox1[1] + (imagesy($image) / 2) - ($bbox1[5] / 2) - 13;
- imagettftext($image, 34, 0, $x1, $y1, $black, "Open 24 Display St.ttf", "$ilosc_a");
- //
- $ts3->logout();
- }
- else{
- echo "Nie mozna polaczyc sie z serwerem";
- }
- header("Content-type: image/png");
- imagepng($image);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement