Advertisement
Guest User

Untitled

a guest
Nov 1st, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. /* CONFIG */
  5. $ts3_ip= 'localhost';
  6. $ts3_user= 'serveradmin';
  7. $ts3_pass= 'xTqAQaij';
  8. $ts3_query= '10011';
  9. $ts3_port= '9987'
  10.  
  11.  
  12. class ts3 {
  13.  
  14. function showbanlist() {
  15.  
  16. global $ts3_ip, $ts3_user, $ts3_pass, $ts3_query, $ts3_port ;
  17.  
  18. $ts3 = TeamSpeak3::factory("serverquery://$ts3_user:$ts3_pass@$ts3_ip:$ts3_query/?server_port=$ts3_port");
  19.  
  20. $banlist = $ts3 -> banlist();
  21.  
  22. echo '<table class="table table-striped table-bordered table-hover" border="1">';
  23. echo '
  24. <tr>
  25. <th>Ban ID</th>
  26. <th>Ban IP</th>
  27. <th>Ban Name</th>
  28. <th>Ban Duration</th>
  29. <th>Banned By</th>
  30. <th>Ban reason</th>
  31. </tr>';
  32.  
  33. foreach ($banlist as $row)
  34.  
  35. {
  36.  
  37. if(empty($row['reason']))
  38. $reason = "No raison given";
  39. else
  40. $reason = $row['reason'];
  41.  
  42. if(empty($row['name']))
  43. $name = "No name given";
  44. else
  45. $name = $row['name'];
  46.  
  47. if(empty($row['ip']))
  48. $ip = "No IP given";
  49. else
  50. $ip = $row['ip'];
  51.  
  52. if($row['duration'] == 0)
  53. $expires = "Ban permanent";
  54. else
  55. $expires = date('d-m-Y H:i:s', $row['created'] + $row['duration']);
  56.  
  57. echo '<td>' . $row['banid'] . '</td>';
  58. echo '<td>' . $ip . '</td>';
  59. echo '<td>' . $name . '</td>';
  60. echo '<td>' . $expires . '</td>';
  61. echo '<td>' . $row['invokername'] . '</td>';
  62. echo '<td>' . $reason . '</td>';
  63. echo '</tr>';
  64.  
  65. }
  66.  
  67.  
  68. }
  69.  
  70. }
  71.  
  72. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement