Guest User

Untitled

a guest
Nov 1st, 2016
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.01 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.    
  13.  
  14.  
  15. class Ts3f {
  16.          
  17.    
  18.     function showbanlist() {
  19.        
  20.             global $ts3_ip, $ts3_user, $ts3_pass, $ts3_query, $ts3_port;
  21.        
  22.             $ts3 = TeamSpeak3::factory("serverquery://$ts3_user:$ts3_pass@$ts3_ip:$ts3_query/?server_port=$ts3_port");
  23.                        
  24.             $banlist = $ts3 -> banlist();
  25.  
  26.             echo '<table>';  
  27.             echo '
  28.            <tr>
  29.            <th>Username</th>
  30.            <th>Duration</th>
  31.            <th>Banned by</th>
  32.            <th>Reason</th>
  33.            </tr>';
  34.  
  35.             foreach ($banlist as $row)
  36.            
  37.             {
  38.  
  39.             if(empty($row['reason']))
  40.             $reason = "No reason given";
  41.             else
  42.             $reason = $row['reason'];
  43.  
  44.             if(empty($row['name']))
  45.             $name = "No name given";
  46.             else
  47.             $name = $row['name'];
  48.  
  49.             if($row['duration'] == 0)
  50.             $expires = "Ban permanent";
  51.             else
  52.             $expires = date('d-m-Y H:i:s', $row['created'] + $row['duration']);
  53.  
  54.  
  55.             echo '<td>' . $name . '</td>';
  56.             echo '<td>' . $expires . '</td>';
  57.             echo '<td>' . $row['invokername'] . '</td>';
  58.             echo '<td>' . $reason . '</td>';
  59.             echo '</tr>';
  60.        
  61.              
  62.            
  63.             }
  64.  
  65.  
  66.                        }
  67.  
  68.     function tsviewer() {
  69.        
  70.         global $ts3_ip, $ts3_user, $ts3_pass, $ts3_query, $ts3_port;
  71.        
  72.         $ts3 = TeamSpeak3::factory("serverquery://$ts3_user:$ts3_pass@$ts3_ip:$ts3_query/?server_port=$ts3_port");
  73.        
  74.         echo $ts3->getViewer(new TeamSpeak3_Viewer_Html("images/viewericons/", "images/countryflags/", "data:image"));
  75.     }
  76.  
  77.            
  78.        
  79.        
  80.    
  81.    
  82.    
  83.        
  84.  
  85. }
  86. ?>http://pastebin.com/DtSNwz8a
Add Comment
Please, Sign In to add comment