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 ts3 {
- 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 class="table table-striped table-bordered table-hover" border="1">';
- echo '
- <tr>
- <th>Ban ID</th>
- <th>Ban IP</th>
- <th>Ban Name</th>
- <th>Ban Duration</th>
- <th>Banned By</th>
- <th>Ban reason</th>
- </tr>';
- foreach ($banlist as $row)
- {
- if(empty($row['reason']))
- $reason = "No raison given";
- else
- $reason = $row['reason'];
- if(empty($row['name']))
- $name = "No name given";
- else
- $name = $row['name'];
- if(empty($row['ip']))
- $ip = "No IP given";
- else
- $ip = $row['ip'];
- if($row['duration'] == 0)
- $expires = "Ban permanent";
- else
- $expires = date('d-m-Y H:i:s', $row['created'] + $row['duration']);
- echo '<td>' . $row['banid'] . '</td>';
- echo '<td>' . $ip . '</td>';
- echo '<td>' . $name . '</td>';
- echo '<td>' . $expires . '</td>';
- echo '<td>' . $row['invokername'] . '</td>';
- echo '<td>' . $reason . '</td>';
- echo '</tr>';
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement