• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[GESIOR2012][TFS 1.0 only] Banned players list

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,966
Solutions
99
Reaction score
3,383
Location
Poland
GitHub
gesior
Very simple script that shows list of banned players, time of ban/expires and reason of ban.
As there is no information about player banned in TFS 1.0 [only account id of player banned = all characters are banned] script gets player with highest level from account and show him as banned player.

I HOPE THAT SOMEONE HAS TIME AND CAN MAKE IT LOOKS NICE (AND OF COURSE POST IT ON OTLAND IN NEW THREAD!)

Now it's just simple list of players-bans. Paste code to file pages/bans.php:
PHP:
<?php
$data = $SQL->query('SELECT `players_data`.`name`, `account_bans`.`account_id`, `account_bans`.`reason`, `account_bans`.`banned_at`, `account_bans`.`expires_at`, `account_bans`.`banned_by` FROM `account_bans` INNER JOIN (SELECT * FROM (SELECT `account_id`, `name` FROM `players` WHERE `players`.`account_id` IN (SELECT `account_id` FROM `account_bans`) ORDER BY `level` DESC) x GROUP BY `account_id`) players_data ON `account_bans`.`account_id` = `players_data`.`account_id`')->fetchAll();
echo '<h2>Active bans</h2>';
foreach($data as $i => $ban)
{
    echo ($i+1) . '. Player: <a href="?subtopic=characters&name=' . urlencode($ban['name']) . '">' . htmlspecialchars($ban['name']) . '</a> ,  banned at ' . date("j F Y, g:i a", $ban['banned_at']) . ' , expires at ' . date("j F Y, g:i a", $ban['expires_at']) . ' , reason: ' . htmlspecialchars($ban['reason']) . '<br />';
}
you can view page at:
http://your-website-domain.com/?subtopic=bans
 
and how i add it to webpage in layout.php?

Edit your layout.php file and add ex. this:
Code:
<a href='?subtopic=bans'>
  <div id='submenu_team' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
    <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
    <div id='ActiveSubmenuItemIcon_team' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>
    <div class='SubmenuitemLabel'>Bans</div>
    <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
  </div>
</a>
If you are using the default tibiacom layout. Otherwise just copy paste one of the other links and edit the text link and href link.
 
There's a way to do for TFS 0.X? Nevermind, found:

PHP:
<?PHP
$ban_types = array(1 => 'IP Banishment', 2 => 'Namelock', 3 => 'Account Banishment', 4 => 'Notation', 5 => 'Until Deletion');
$ban_reason = array("Offensive Name", "Invalid Name Format", "Unsuitable Name", "Name Inciting Rule Violation", "Offensive Statement", "Spamming", "Illegal Advertising", "Off-Topic Public Statement", "Non-English Public Statement", "Inciting Rule Violation", "Bug Abuse", "Game Weakness Abuse", "Using Unofficial Software to Play", "Hacking", "Multi-Clienting", "Account Trading or Sharing", "Threatening Gamemaster", "Pretending to Have Influence on Rule Enforcer", "False Report to Gamemaster", "Destructive Behaviour", "Excessive Unjustified Player Killing", "Invalid Payment", "Spoiling Auction");
$players_banned = $SQL->query('SELECT `bans`.`type`, `bans`.`value`, `bans`.`comment`,`bans`.`admin_id`, `bans`.`expires`, `bans`.`added`, `bans`.`reason` FROM `bans`, `players` WHERE `players`.`account_id` = `bans`.`value` AND `bans`.`active` = 1 GROUP BY `bans`.`value` ORDER BY `bans`.`added` DESC')->fetchAll();
if(!$players_banned) 
{
    $main_content .= '<h2><center><b>No one is banned at the moment at '.$config['server']['serverName'].'</b></center></h2>';
} 
else
{
    $number_of_players = 0;
    foreach($players_banned as $player) 
    {
        $nick = $SQL->query("SELECT name, id, level, account_id FROM `players` WHERE account_id =".$player['value']." ORDER BY level DESC LIMIT 1")->fetch();
        $gmnick = $SQL->query("SELECT name, id FROM `players` WHERE id =".$player['admin_id']."")->fetch();
        if($player['admin_id'] >= "1")
            $banby = "<a href=?subtopic=characters&name=".urlencode($gmnick['name'])."><font color ='green'>".$gmnick['name']."</font></a>";
        else
            $banby = "FunOT System";
        $number_of_players++;
        if(is_int($number_of_players / 2))
            $bgcolor = $config['site']['darkborder'];
        else
            $bgcolor = $config['site']['lightborder'];
        if ($player['expires'] == "-1") // If the banishment is permanent
            $expires = "Permament";
        else
            $expires = date("d/m/Y, G:i:s", $player['expires']);
        $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=15%><A HREF="?subtopic=characters&name='.$nick['name'].'">'.$nick['name'].'</A></TD><TD WIDTH=5%>'.$ban_reason[$player['reason']].'</TD><TD WIDTH=15%>'.$player['comment'].'</TD><TD>'.$banby.'</TD><TD>'.$expires.'</TD></TR>';
    }
    //list of players
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>Banned Player</center></b></TD><TD class="white"><b><center>Reason</center></b></TD><TD class="white"><b><center>Comment</center></b></TD><TD class="white"><b><center>Banned By</center></b></TD><TD class="white"><b><center>Expires</center></b></TD></TR>'.$players_rows.'</TABLE>';
}
?>
 
Last edited:
Back
Top