• 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!

[GESIOR ACC] Ban List

Samme

.::EmmaS-SammE::.
Senator
Joined
Mar 4, 2008
Messages
2,398
Reaction score
50
Location
/poland
Hello Otlanders.

I want to share with you my little script.

I think everyone understand what is it...

Ok, lets install it.

Open index.php and after that
PHP:
	case "latestnews":
		$topic = "Latest News";
		$subtopic = "latestnews";
		include("latestnews.php");
	break;

Add

PHP:
	case "bans":
		$topic = "Ban List (Scripted By Samme from Otland.net)";
		$subtopic = "bans";
		include("bans.php");
	break;

Create a new php file and name it bans.php, and paste there following code:

PHP:
<?PHP
//////////////////
/// CREATED BY ///
///   SAMME    ///
/////  FROM  /////
/// OTLAND.NET ///
//////////////////

//Please respect the copyrights!//

$ban_reason = array("offensive name", "name containing part of sentence", "name with nonsensical letter combination", "invalid name format", "name not describing person", "name of celebrity", "name reffering to country", "Offtopic (Forum)", "name to fake official position", "offensive statement", "spamming", "advertisement not related to game", "macro use", "<center>--></center>", "off-topic public statement", "inciting rule violation", "bug abuse", "game weakness abuse", "Macro Use", "Destructive Behaviour", "<center>--></center>", "multi-clienting", "account trading", "<center>--></center>", "threatening gamemaster", "pretending to have official position", "pretending to have influence on gamemaster", "false report to gamemaster", "excessive unjustified player killing", "destructive behaviour", "spoiling auction", "invalid payment");

$players_banned = $SQL->query('SELECT `bans`.`value`, `bans`.`comment`, `bans`.`admin_id`, `bans`.`expires`, `bans`.`added`, `bans`.`reason` FROM `bans`, `players` WHERE `players`.`account_id` = `bans`.`value` AND `bans`.`type` = 3 AND `bans`.`active` = 1 GROUP BY `bans`.`value` ORDER BY `bans`.`expires`')->fetchAll();
$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(); 
	
	if($player['admin_id'] == "1")
		$banby = "Administrator";
	else
		$banby = "Auto Ban";
		
	$number_of_players++;
	if(is_int($number_of_players / 2))
		$bgcolor = $config['site']['darkborder'];
	else
		$bgcolor = $config['site']['lightborder'];
	$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=20%>'.$player['comment'].'</TD><TD>'.$banby.'</TD><TD>'.date("d/m/Y, G:i:s", $player['added']).'</TD><TD>'.date("d/m/Y, G:i:s", $player['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>Added</center></b></TD><TD class="white"><b><center>Expires</center></b></TD></TR>'.$players_rows.'</TABLE>';

	//COPY RIGHTS!! DO NOT DELETE!
	$main_content .= '<br/><p align="right">Scripted by <B>Samme</B> from Otland.net</p>';
?>

And its ready! You can see banned players on your server by entering index.php?subtopic=bans.

If you like it, I would mind a reputation point from you. ;)
 
Last edited by a moderator:
it ll be work with 0.23 ?
i mean that what is a margin between 0.3 and 0.2 in database bans ?
 
Fatal error: Call to a member function query() on a non-object in C:\xampp\htdocs\bans.php on line 13
 
i get this same error:
PHP:
Fatal error: Call to a member function fetchAll() on a non-object in /var/www/bans.php on line 13

i have to update pot ?
 
i updated ;] aand :
PHP:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'loss_items' in 'field list'' in /var/www/pot/OTS_Player.php:114 Stack trace: #0 /var/www/pot/OTS_Player.php(114): PDO->query('SELECT `id`, `n...') #1 /var/www/pot/OTS_Row_DAO.php(53): OTS_Player->load(8) #2 /var/www/pot/OTS_Base_List.php(228): OTS_Row_DAO->__construct(8) #3 /var/www/team.php(48): OTS_Base_List->current() #4 /var/www/index.php(212): include('/var/www/team.p...') #5 {main} thrown in /var/www/pot/OTS_Player.php on line 114
 
i updated ;] aand :
PHP:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'loss_items' in 'field list'' in /var/www/pot/OTS_Player.php:114 Stack trace: #0 /var/www/pot/OTS_Player.php(114): PDO->query('SELECT `id`, `n...') #1 /var/www/pot/OTS_Row_DAO.php(53): OTS_Player->load(8) #2 /var/www/pot/OTS_Base_List.php(228): OTS_Row_DAO->__construct(8) #3 /var/www/team.php(48): OTS_Base_List->current() #4 /var/www/index.php(212): include('/var/www/team.p...') #5 {main} thrown in /var/www/pot/OTS_Player.php on line 114

Well, so updating POT helped, now its problem with 0.2 db structure I think. :thumbup:

Very Nice MAN!

Thanks for you post the script.
You can create Ban Manage for use admins ?

You're welcome. Maybe in future ;)
 
Aff, you can at least try to look up , how your Gesiors AAC version make query to db. then change $SQL->query to your one.
 
//ACHTUNG~

In some cases , there may be incorrect banishment reasons, then you just need to edit a reason from $ban_reason, maybe I`ll fix that later.
 
Back
Top