Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* CONFIG */
- $ts3_ip= 'localhost';
- $ts3_user= 'serveradmin';
- $ts3_pass= 'xTqAQaij';
- $ts3_query= '10011';
- $ts3_port= '9987';
- class Ts3f {
- function showbanlist() {
- global $ts3_ip, $ts3_user, $ts3_pass, $ts3_query, $ts3_port;
- $ts3 = TeamSpeak3::factory("serverquery://$ts3_user:$ts3_pass@$ts3_ip:$ts3_query/?server_port=$ts3_port");
- $banlist = $ts3 -> banlist();
- echo '<table>';
- echo '
- <tr>
- <th>Username</th>
- <th>Duration</th>
- <th>Banned by</th>
- <th>Reason</th>
- </tr>';
- foreach ($banlist as $row)
- {
- if(empty($row['reason']))
- $reason = "No reason given";
- else
- $reason = $row['reason'];
- if(empty($row['name']))
- $name = "No name given";
- else
- $name = $row['name'];
- if($row['duration'] == 0)
- $expires = "Ban permanent";
- else
- $expires = date('d-m-Y H:i:s', $row['created'] + $row['duration']);
- echo '<td>' . $name . '</td>';
- echo '<td>' . $expires . '</td>';
- echo '<td>' . $row['invokername'] . '</td>';
- echo '<td>' . $reason . '</td>';
- echo '</tr>';
- }
- }
- function tsviewer() {
- global $ts3_ip, $ts3_user, $ts3_pass, $ts3_query, $ts3_port;
- $ts3 = TeamSpeak3::factory("serverquery://$ts3_user:$ts3_pass@$ts3_ip:$ts3_query/?server_port=$ts3_port");
- echo $ts3->getViewer(new TeamSpeak3_Viewer_Html("images/viewericons/", "images/countryflags/", "data:image"));
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement