Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <?php
  2.  
  3. //Created by Dinip
  4.  
  5. //config
  6. $qLogin = array (
  7. 'loginInfo' => array (
  8. 'IP' => "127.0.0.1",
  9. 'PORT_UDP' => '9987',
  10. 'PORT_QUERY' => '10011',
  11. 'NICK' => "Banner",
  12. 'LOGIN_QUERY' => 'serveradmin',
  13. 'PASS_QUERY' => "xxx",
  14. )
  15. );
  16.  
  17. header('Content-Type: image/png');
  18. require_once("lib/ts3admin.class.php");
  19. date_default_timezone_set("Europe/Lisbon");
  20. global $ts3;
  21. $ts3 = new ts3admin($qLogin['loginInfo']['IP'], $qLogin['loginInfo']['PORT_QUERY']);
  22.  
  23.  
  24. $date = date('d.m.y');
  25. $time = date('H:i');
  26. if($ts3->succeeded($ts3->connect())) {
  27.  
  28. $ts3->login($qLogin['loginInfo']['LOGIN_QUERY'], $qLogin['loginInfo']['PASS_QUERY']);
  29. $ts3->selectServer($qLogin['loginInfo']['PORT_UDP']);
  30. $ts3->login($qLogin['loginInfo']['LOGIN_QUERY'], $qLogin['loginInfo']['PASS_QUERY']);
  31. $ts3->setName($qLogin['loginInfo']['NICK']);
  32. $infoServer = $ts3->getElement('data', $ts3->serverInfo(), $ts3->getData('multi', 'servergrouplist'));
  33.  
  34.  
  35. $ts3->logout();
  36. }
  37.  
  38.  
  39. $cfg['groups'] = array(9, 12);
  40.  
  41.  
  42. $clients = $ts3->clientList();
  43. $channelList = $ts3->channelList();
  44.  
  45.  
  46. $slots = $infoServer['virtualserver_clientsonline']-$infoServer['virtualserver_queryclientsonline'];
  47. $maxSlots = $infoServer['virtualserver_maxclients'];
  48. $staff = count($clients["data"]);
  49. $channels = count($channelList['data']);
  50.  
  51. $textTime = "Horas: ".$time;
  52. $textDate = "Data: " .$date;
  53. $textStaff = "Staff Online: " .$staff;
  54. $textChannels = "Channels: " .$channels;
  55. $textPing = "Ping Médio: ".number_format($infoServer['virtualserver_total_ping'], 2) ." ms";
  56. $textClients = "Users: ".$slots."/".$maxSlots;
  57. $image = imagecreatefrompng("dg5.png");
  58. $textColor = imagecolorallocate($image, 0, 0, 0);
  59.  
  60.  
  61. //imagestring($image, 5, 10, 5, $text, $textColor);
  62. //imagettftext($image, 18, 0, 5, 225, $textColor, "fonts/Exo-Medium.ttf", $text);
  63. imagettftext($image, 17, 0, 30, 87, $textColor, "fonts/GROBOLD.ttf", $textTime);
  64. imagettftext($image, 17, 0, 30, 127, $textColor, "fonts/GROBOLD.ttf", $textPing);
  65. imagettftext($image, 17, 0, 30, 167, $textColor, "fonts/GROBOLD.ttf", $textStaff);
  66. imagettftext($image, 17, 0, 30, 207, $textColor, "fonts/GROBOLD.ttf", $textChannels);
  67. imagettftext($image, 17, 0, 30, 247, $textColor, "fonts/GROBOLD.ttf", $textClients);
  68. imagepng($image);
  69. imagedestroy($image);
  70.  
  71.  
  72. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement