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

Afs-cms

Status
Not open for further replies.
Btw. I hope you know, ban list will display "account number" instead of character name because only account number are stored in database.

The players ID is also stored in the bans database, you use that to get the character name.
 
@Avarian

But I dont know what way to do that... give me an expample, please.
 
@Avarian

But I dont know what way to do that... give me an expample, please.

You take the player ID from bans table.
Then you select that Id from players table + name.

You said you know php/mysql, so you can make it now by yourself.
 
You take the player ID from bans table.
Then you select that Id from players table + name.

You said you know php/mysql, so you can make it now by yourself.

Show me that post. ^_^

//

I'll try it, but I dont know I want to share this to peoples like "Marcinek".
 
hey dude.. I can use this version in TFS 0.3 (trunk)?

Should work just fine, if there's any problems let me know.

@Avarian

But I dont know what way to do that... give me an expample, please.

I'll try and post an example later.

Bump. <shoooort>

Send me a copy of your database so I can make sure everything installed correctly.

Show me that post. ^_^

//

I'll try it, but I dont know I want to share this to peoples like "Marcinek".

You can't be like that :p Besides, if you do make it you'll gain more respect from Marcinek.
 
I forgot, but does the AFSCMS have list of banned players/accounts?
If so, it would be good to make it fine with 0.3 - new ban class doesn't remove bans from database, it just set them as expired.

P.S. #Ronaldinio: peoples is already a plural, kid.
 
Last edited:
Show me that post. ^_^

//

I'll try it, but I dont know I want to share this to peoples like "Marcinek".

Dude, I can do it by myself, although I am not using AFSCMS.
Nor any other.

--
I've downloaded it especially for you and Im almost done.

Code:
Players Banned:
Name:	Reason:	Until:
1 - Thiagow BR	name containing part of sentence	Sep 8 2001, 03:25:32

Done, now it takes name properly.

If noone is banned:
Code:
Name:	Reason:	Until:
Noone	is	banned.

If in bans table there is only `account` filled the table will show the highest level of that account + (account) text next to link.

Only problem Im getting now is that it shows only one row ^^'
 
Last edited:
I have try to code the banlist but i get errors i have all right but dont know why i post my banlist now i hope avarian u take a look there and maybe can fix it than release that in newer version of afscms
here we go
PHP:
<?php
include ('config.php');
include ('Includes/header_includes.php');
echo '<title>'.$worldname.' - Home Page</title>';
?>
<?php
connect_db();
$sql = 'SELECT * FROM `bans`';
$query = mysql_query($ban_sql);
$player_query = mysql_query("SELECT * FROM `players` WHERE (`name` = '".$player."') ");
		$account_ban = $player_sql['account_id'];
		$ban_query = mysql_query("SELECT * FROM `bans` WHERE (`account` = '$account_ban') ") or die(mysql_error());
		$ban_sql = mysql_fetch_array($ban_query)
?>
<h2>Banlist</h2>
<br>
<table border=1>
<tr>
<td><b>Name</b></td>
<td><b>Banned at</b></td>
<td><b>Reason</b></td>
</tr>
<?php
{
    if ($player_sql['type'] == 2) 
    {
        echo '<tr>';
        echo '<td>'.$player_sql['account_id'].'</td>'; // Players name...
        echo '<td>'.$bantime = date('M d Y, H:i:s',$ban_sql['time']).'</td>'; 
        echo '<td>'.$ban_sql[reason_id].'</td>';
        echo '</tr>'; // Done! :)
    }
}
?>
</table>

<?php
include ('Includes/footer_includes.php');
?>
 
I have try to code the banlist but i get errors i have all right but dont know why i post my banlist now i hope avarian u take a look there and maybe can fix it than release that in newer version of afscms
here we go
PHP:
<?php
include ('config.php');
include ('Includes/header_includes.php');
echo '<title>'.$worldname.' - Home Page</title>';
?>
<?php
connect_db();
$sql = 'SELECT * FROM `bans`';
$query = mysql_query($ban_sql);
$player_query = mysql_query("SELECT * FROM `players` WHERE (`name` = '".$player."') ");
		$account_ban = $player_sql['account_id'];
		$ban_query = mysql_query("SELECT * FROM `bans` WHERE (`account` = '$account_ban') ") or die(mysql_error());
		$ban_sql = mysql_fetch_array($ban_query)
?>
<h2>Banlist</h2>
<br>
<table border=1>
<tr>
<td><b>Name</b></td>
<td><b>Banned at</b></td>
<td><b>Reason</b></td>
</tr>
<?php
{
    if ($player_sql['type'] == 2) 
    {
        echo '<tr>';
        echo '<td>'.$player_sql['account_id'].'</td>'; // Players name...
        echo '<td>'.$bantime = date('M d Y, H:i:s',$ban_sql['time']).'</td>'; 
        echo '<td>'.$ban_sql[reason_id].'</td>';
        echo '</tr>'; // Done! :)
    }
}
?>
</table>

<?php
include ('Includes/footer_includes.php');
?>

Instead of include config.php
include ('configs/database_cfg.php'); and include ('configs/layout_cfg.php'); and include ('Includes/function_includes.php');
and remove connect_db();

Now your page will load so you can fix it ;p
 
Last edited:
Actually, Im bored with it. Here is the code:

Add it in info.php above ###Online List###
PHP:
 #### BANS FOR RONALDINO ####
 
case "bans":

echo '<title>'.$worldname.' - Bans List</title>';
echo '<h1>Players Banned:</h1>';
$i = 1;

$bans_query = mysql_query("SELECT * FROM `bans` ORDER BY `time`") or die(mysql_error());
$bans_sql = mysql_fetch_array($bans_query);
$playa = $bans_sql['player'];
$account = $bans_sql['account'];
$banned_name = mysql_query("SELECT name, id, level, account_id FROM `players` WHERE `id` = '$playa' or account_id ='$account' ORDER BY level DESC LIMIT 1") or die(mysql_error());
$name_sql = mysql_fetch_array($banned_name);
echo '<table border="1" cellpadding="2" style="border-collapse: collapse" bordercolor="#000000" width="100%" cellspacing="0">';
echo '<tr><td width="40%" bgcolor="#000000"><b>Name:</b></td><td width="40%" bgcolor="#000000"><b>Reason:</b></td><td width="20%" bgcolor="#000000"><b>Until:</b></td></tr>';
if(mysql_num_rows($bans_query) != 0) {
$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", "name to fake player identity", "name to fake official position", "offensive statement", "spamming", "advertisement not related to game", "real money advertisement", "non-english public statement", "off-topic public statement", "inciting rule violation", "bug abuse", "game weakness abuse", "macro use", "using unofficial software to play", "hacking", "multi-clienting", "account trading", "account sharing", "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 paymeny");
if(empty($bans_sql['player'])) { $add = '(account)'; }
$number++;
if($layout == grayshades) {
echo '<td bgcolor="#444444">'.$number.' - <a href="info.php?act=players&char='.$name_sql['name'].'">'.$name_sql['name'].'</a> '.$add.'</td><td bgcolor="#444444">'.$ban_reason[$bans_sql['reason_id']].'</td><td bgcolor="#444444">'.date("M j Y, H:i:s",$bans_sql['time']).'</td></tr>'; }
elseif($layout == blackdraft) {
echo '<td bgcolor="#444444">'.$number.' - <a href="info.php?act=players&char='.$name_sql['name'].'">'.$name_sql['name'].' </a>'.$add.'</td><td bgcolor="#444444">'.$ban_reason[$bans_sql['reason_id']].'</td><td bgcolor="#444444">'.date("M j Y, H:i:s",$bans_sql['time']).'</td></tr>'; }
elseif($layout == thegathering) {
echo '<td bgcolor="#110F01">'.$number.' - <a href="info.php?act=players&char='.$name_sql['name'].'">'.$name_sql['name'].' </a>'.$add.'</td><td bgcolor="#110F01">'.$ban_reason[$bans_sql['reason_id']].'</td><td bgcolor="#110F01">'.date("M j Y, H:i:s",$bans_sql['time']).'</td></tr>'; }
elseif($layout == dragonflames) {
echo '<td bgcolor="#110F01">'.$number.' - <a href="info.php?act=players&char='.$name_sql['name'].'">'.$name_sql['name'].' </a>'.$add.'</td><td bgcolor="#110F01">'.$ban_reason[$bans_sql['reason_id']].'</td><td bgcolor="#110F01">'.date("M j Y, H:i:s",$bans_sql['time']).'</td></tr>'; }
}
else {
if($layout == grayshades) {
echo '<td bgcolor="#444444">Noone</td><td bgcolor="#444444">is</td><td bgcolor="#444444">banned.</td></tr>'; }
elseif($layout == blackdraft) {
echo '<td bgcolor="#444444">Noone</td><td bgcolor="#444444">is</td><td bgcolor="#444444">banned.</td></tr>'; }
elseif($layout == thegathering) {
echo '<td bgcolor="#110F01">Noone</td><td bgcolor="#110F01">is</td><td bgcolor="#110F01">banned.</td></tr>'; }
elseif($layout == dragonflames) {
echo '<td bgcolor="#110F01">Noone</td><td bgcolor="#110F01">is</td><td bgcolor="#110F01">banned.</td></tr>'; }
}
echo '</table>';
break;

Now you can fix the error left by yourself :)
(Showing only 1 row).

To access it: http://127.0.0.1/info.php?act=bans

I know its kinda messed, but I didnt put my head into ;p

To make it accessible from the webpage go to layouts/your_layout/php files/xx_footer.php
and fine Players Online, above it add:
PHP:
echo '<li><a href="info.php?act=bans">Players Banned</a></li>';
 
Last edited:
Code:
Status: Online
Players online: 8 / 100
Monsters: 4369
Uptime: 0h 8m
IP: 127.0.0.1
Port: 7171
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NIE) in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 134

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 134

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 135

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NIE) in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 136

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 136

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 137
How can i repair it?
 
I have a connection, because i can create new account and new player. This error appear when i click on highscores, but why?
 
Well it says so in the error:
Access denied for user 'ODBC'@'localhost'

But i am not an expert at php and mysql, so it's best to wait for someone with some more experience to tell you what is wrong.
 
I have try to code the banlist but i get errors i have all right but dont know why i post my banlist now i hope avarian u take a look there and maybe can fix it than release that in newer version of afscms
here we go
PHP:
<?php
include ('config.php');
include ('Includes/header_includes.php');
echo '<title>'.$worldname.' - Home Page</title>';
?>
<?php
connect_db();
$sql = 'SELECT * FROM `bans`';
$query = mysql_query($ban_sql);
$player_query = mysql_query("SELECT * FROM `players` WHERE (`name` = '".$player."') ");
		$account_ban = $player_sql['account_id'];
		$ban_query = mysql_query("SELECT * FROM `bans` WHERE (`account` = '$account_ban') ") or die(mysql_error());
		$ban_sql = mysql_fetch_array($ban_query)
?>
<h2>Banlist</h2>
<br>
<table border=1>
<tr>
<td><b>Name</b></td>
<td><b>Banned at</b></td>
<td><b>Reason</b></td>
</tr>
<?php
{
    if ($player_sql['type'] == 2) 
    {
        echo '<tr>';
        echo '<td>'.$player_sql['account_id'].'</td>'; // Players name...
        echo '<td>'.$bantime = date('M d Y, H:i:s',$ban_sql['time']).'</td>'; 
        echo '<td>'.$ban_sql[reason_id].'</td>';
        echo '</tr>'; // Done! :)
    }
}
?>
</table>

<?php
include ('Includes/footer_includes.php');
?>

There's some major flaws in your script, i'll try and point a few out just in case you keep programming :)

1.) $query should be mysql_query($sql); instead of mysql_query($bans_query);
2.) You never defined the variable $player, so your $player_query won't work.
3.) Also $account_ban won't work because you never defined the variable $player_sql
4.) Since the rest of the script uses $player_sql none of it will work because of the reason stated above.
5.) Even if $player_sql had been defined, using $player_sql['account_id'] won't display the character name it will display the account ID.

Just keep practicing and you'll get it :)

Actually, Im bored with it. Here is the code:

Add it in info.php above ###Online List###
PHP:
 #### BANS FOR RONALDINO ####
 
case "bans":

echo '<title>'.$worldname.' - Bans List</title>';
echo '<h1>Players Banned:</h1>';
$i = 1;

$bans_query = mysql_query("SELECT * FROM `bans` ORDER BY `time`") or die(mysql_error());
$bans_sql = mysql_fetch_array($bans_query);
$playa = $bans_sql['player'];
$account = $bans_sql['account'];
$banned_name = mysql_query("SELECT name, id, level, account_id FROM `players` WHERE `id` = '$playa' or account_id ='$account' ORDER BY level DESC LIMIT 1") or die(mysql_error());
$name_sql = mysql_fetch_array($banned_name);
echo '<table border="1" cellpadding="2" style="border-collapse: collapse" bordercolor="#000000" width="100%" cellspacing="0">';
echo '<tr><td width="40%" bgcolor="#000000"><b>Name:</b></td><td width="40%" bgcolor="#000000"><b>Reason:</b></td><td width="20%" bgcolor="#000000"><b>Until:</b></td></tr>';
if(mysql_num_rows($bans_query) != 0) {
$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", "name to fake player identity", "name to fake official position", "offensive statement", "spamming", "advertisement not related to game", "real money advertisement", "non-english public statement", "off-topic public statement", "inciting rule violation", "bug abuse", "game weakness abuse", "macro use", "using unofficial software to play", "hacking", "multi-clienting", "account trading", "account sharing", "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 paymeny");
if(empty($bans_sql['player'])) { $add = '(account)'; }
$number++;
if($layout == grayshades) {
echo '<td bgcolor="#444444">'.$number.' - <a href="info.php?act=players&char='.$name_sql['name'].'">'.$name_sql['name'].'</a> '.$add.'</td><td bgcolor="#444444">'.$ban_reason[$bans_sql['reason_id']].'</td><td bgcolor="#444444">'.date("M j Y, H:i:s",$bans_sql['time']).'</td></tr>'; }
elseif($layout == blackdraft) {
echo '<td bgcolor="#444444">'.$number.' - <a href="info.php?act=players&char='.$name_sql['name'].'">'.$name_sql['name'].' </a>'.$add.'</td><td bgcolor="#444444">'.$ban_reason[$bans_sql['reason_id']].'</td><td bgcolor="#444444">'.date("M j Y, H:i:s",$bans_sql['time']).'</td></tr>'; }
elseif($layout == thegathering) {
echo '<td bgcolor="#110F01">'.$number.' - <a href="info.php?act=players&char='.$name_sql['name'].'">'.$name_sql['name'].' </a>'.$add.'</td><td bgcolor="#110F01">'.$ban_reason[$bans_sql['reason_id']].'</td><td bgcolor="#110F01">'.date("M j Y, H:i:s",$bans_sql['time']).'</td></tr>'; }
elseif($layout == dragonflames) {
echo '<td bgcolor="#110F01">'.$number.' - <a href="info.php?act=players&char='.$name_sql['name'].'">'.$name_sql['name'].' </a>'.$add.'</td><td bgcolor="#110F01">'.$ban_reason[$bans_sql['reason_id']].'</td><td bgcolor="#110F01">'.date("M j Y, H:i:s",$bans_sql['time']).'</td></tr>'; }
}
else {
if($layout == grayshades) {
echo '<td bgcolor="#444444">Noone</td><td bgcolor="#444444">is</td><td bgcolor="#444444">banned.</td></tr>'; }
elseif($layout == blackdraft) {
echo '<td bgcolor="#444444">Noone</td><td bgcolor="#444444">is</td><td bgcolor="#444444">banned.</td></tr>'; }
elseif($layout == thegathering) {
echo '<td bgcolor="#110F01">Noone</td><td bgcolor="#110F01">is</td><td bgcolor="#110F01">banned.</td></tr>'; }
elseif($layout == dragonflames) {
echo '<td bgcolor="#110F01">Noone</td><td bgcolor="#110F01">is</td><td bgcolor="#110F01">banned.</td></tr>'; }
}
echo '</table>';
break;

Now you can fix the error left by yourself :)
(Showing only 1 row).

To access it: http://127.0.0.1/info.php?act=bans

I know its kinda messed, but I didnt put my head into ;p

To make it accessible from the webpage go to layouts/your_layout/php files/xx_footer.php
and fine Players Online, above it add:
PHP:
echo '<li><a href="info.php?act=bans">Players Banned</a></li>';

Thanks for the script, i'll play with it later :)

Code:
Status: Online
Players online: 8 / 100
Monsters: 4369
Uptime: 0h 8m
IP: 127.0.0.1
Port: 7171
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NIE) in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 134

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 134

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 135

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NIE) in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 136

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 136

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\WebServ\httpd\Layouts\dragonflames\PHP Files\df_footer.inc.php on line 137
How can i repair it?

I have a connection, because i can create new account and new player. This error appear when i click on highscores, but why?

Your first post you display "Server Status" or "Server Information" I don't remember which is the correct term but anyway, in your second post you said the error was in highscores, so which is it in?
 
Avarian said:
Send me a copy of your database so I can make sure everything installed correctly.
ehh.. no why would I give you my database?
 
The limit is only if there is account filled in `bans`, else it would show all players of that account banned, now it shows only the highest level of account.
 
Status
Not open for further replies.
Back
Top