Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <?php
  2. $image = imagecreatefrompng("banner.png");
  3. $black = imagecolorallocate($image, 255, 255, 0);
  4. $rozmiar = 30;
  5. $pochylenie = 0;
  6. $x = 105;
  7. $y = 301;
  8. putenv('GDFONTPATH=' . realpath('.'));
  9. // wyswietlenie daty
  10. //imagettftext($image, $rozmiar, $pochylenie, $x, $y, $black, "Open 24 Display St.ttf","170");
  11. $bbox = imagettfbbox(34, 0, "Open 24 Display St.ttf", date('H:i'));
  12. $x = $bbox[0] + (imagesx($image) / 2) - ($bbox[4] / 2) - 0;
  13. $y = $bbox[1] + (imagesy($image) / 2) - ($bbox[5] / 2) - 213;
  14. imagettftext($image, 34, 0, $x, $y, $black, "Open 24 Display St.ttf", date('H:i'));
  15. //
  16. include("lib/ts3admin.class.php");
  17. // dane połaczenia
  18. $ts3_ip = '';
  19. $ts3_queryport = 10011;
  20. $ts3_user = 'serveradmin';
  21. $ts3_pass = '';
  22. $ts3_port = 9987;
  23. // inicjacja polaczenia
  24. $ts3 = new ts3admin($ts3_ip, $ts3_queryport);
  25. if($ts3->getElement('success', $ts3->connect())) {$ts3->login($ts3_user, $ts3_pass);$ts3->selectServer($ts3_port);
  26. $info = $ts3->serverList();
  27. $all = $info['data'][0]['virtualserver_clientsonline'];
  28. $query = $info['data'][0]['virtualserver_queryclientsonline'];
  29. $user = $all - $query;
  30. //wyswietlenie ilosci online
  31. $bbox1 = imagettfbbox(34, 0, "Open 24 Display St.ttf", "$user");
  32. $x1 = $bbox1[0] + (imagesx($image) / 2) - ($bbox1[4] / 2) - 670;
  33. $y1 = $bbox1[1] + (imagesy($image) / 2) - ($bbox1[5] / 2) - 13;
  34. imagettftext($image, 34, 0, $x1, $y1, $black, "Open 24 Display St.ttf", "$user");
  35. //
  36. $info = $ts3->serverGroupClientList('391');
  37. $ilosc_a = count($info['data']);
  38. //wyswietlenie ilosci administratorów
  39. $bbox1 = imagettfbbox(34, 0, "Open 24 Display St.ttf", "$ilosc_a");
  40. $x1 = $bbox1[0] + (imagesx($image) / 2) - ($bbox1[4] / 2) - 453;
  41. $y1 = $bbox1[1] + (imagesy($image) / 2) - ($bbox1[5] / 2) - 13;
  42. imagettftext($image, 34, 0, $x1, $y1, $black, "Open 24 Display St.ttf", "$ilosc_a");
  43. //
  44. $ts3->logout();
  45. }
  46. else{
  47. echo "Nie mozna polaczyc sie z serwerem";
  48. }
  49. header("Content-type: image/png");
  50. imagepng($image);
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement