Advertisement
Guest User

TS3 neofrag

a guest
Jun 25th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1. <li data-toggle="tooltip" title="Rejoindre le Teamspeak">
  2. <div class="pull-left">
  3.     <?php
  4.     $compteur = "?";
  5.     if ($_SERVER['REQUEST_URI'] != '/live-editor.html') {
  6.         try {
  7.             $data = json_decode(file_get_contents("https://api.planetteamspeak.com/serverstatus/TS3_IP:PORT/"));
  8.             if (isset($data) && isset($data->status) && $data->status == 'success' && isset($data->result->users)) {
  9.                 $compteur = $data->result->users;
  10.             }
  11.         } catch (Exception $e) {
  12.         }
  13.     }
  14.     echo '<span class="badge badge-info ts3-badge">' . $compteur . '</span>';
  15.     ?>
  16. </div>
  17. <a href="ts3server://TS3_IP?port=PORT">
  18.     <span class="pe-7s-headphones"></span>
  19. </a>
  20. <style>
  21. .ts3-badge {
  22.     background-color: #4B525B;
  23.     padding: 3px 6px;
  24.     font-size: 10px !important;
  25. }
  26. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement