Code:<?php require_once("libraries/TeamSpeak3/TeamSpeak3.php"); try { $ts3 = TeamSpeak3::factory("serverquery://user:[email protected]:xxxx/?server_port=yyyy"); $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>'; } } catch (TeamSpeak3_Exception $e) { if ($e->getCode() == 1281) { //I hope its code ID 1281 otherwise correct me echo "No Bans on this Server"; } else { echo "Error: ".$e->getMessage(); } } ?>
like this, havent tested it
didn't work for me :s