Page 1 of 1
Online banlist?
Posted: Sun Jan 23, 2011 4:32 am
by Master Jay
Hey, I know I was gone for such a long time. I didn't need a lot of modding when I left. But now I have a question. Its not really modding BUT, it has something with my server ban list. Okay so my question today is, how do I enable my server ban list to a SMF site? Any suggestions? I was trying to make it look like this kinda, Name: Reason: Time: Admin: Keyhash:. Is this possible?
Posted: Sun Jan 23, 2011 8:14 pm
by freddy
Re: Online banlist?
Posted: Mon Jan 24, 2011 5:27 am
by Master Jay
Hey, thanks for the reply. I couden't really understand how to do this using a SMF forum. I read the README.txt but nothing helped. Can you guide me threw this please?
Posted: Mon Jan 24, 2011 5:25 pm
by freddy
uww i dont know what a SMF forum is?
you need the usual setup with MySQL, apache and php for this to work
Re: Online banlist?
Posted: Mon Jan 24, 2011 10:37 pm
by Master Jay
do you have xfire or anything ? Maybe you can help me threw this MySQL, not very easy. Xfire: xmathewx75
Posted: Mon Jan 24, 2011 11:18 pm
by freddy
sry no xfire
theres some parameters that need to be fulfilled in order to get this program to work, can you edit a shortcut with witch you start your bf server? if not its no idea to even try.
Re: Online banlist?
Posted: Tue Jan 25, 2011 12:24 am
by Master Jay
I think I will need a coder to do this. Thanks for helping.
Re: Online banlist?
Posted: Fri Jul 13, 2012 7:36 pm
by Grabbi
the Russian way:
the serverbanlist.con is a comma separated value array -> csv
you dont need a MySql etc, simply a PHP parser thats all.
The first "online Bannlist Parser" has been developed by Netorn Team / Parsultang in 2004/2005
published 2008 here:
http://www.php.ru/forum/viewtopic.php?t=13040
Simply give web or ftp access to server/mods/bf1942/serverbanlist.con
On website create a PHP with example below ( + access data)
Code: Select all
bans.php:
[php]
$bans = file("serverbanlist.con");
$number_of_bans = count($bans);
if ($number_of_bans == 0)
{
echo "Забаненных нет";
}
for ($i=0; $i<$number_of_bans; $i++)
{
$part = explode(",", $bans[$i]);
$ban_name = trim($part[0]);
$ban_ip = trim($part[1]);
$ban_keyhash = trim($part[2]);
$ban_guid = trim($part[3]);
$ban_admin = trim($part[4]);
$ban_banned = trim($part[5]);
$ban_expires = trim($part[6]);
$ban_reason = trim($part[7]);
echo "
<table>
<tr>
<td>$ban_name</td>
</tr>
</table>
";
}[/php]
optimized ( cause of " )
Code: Select all
[php]
<?
$arr=array();
for ($i=0; $i<$number_of_bans; $i++)
{
$part = explode(",", $bans[$i]);
$ban_name =trim($part[0]);
if (!in_array($ban_name,$arr['name'])) {
echo "
<table>
<tr>
<td>$ban_name</td>
</tr>
</table>
";
$arr['name'][]=$ban_name;
}
}
?>[/php]
similar (array) & advanced (csv) development from 2007 by PFC you can see here ( cause Parsultang didn't share the code at that time in 2005):
http://www.pixel-fighter.com/modules.php?name=PFC_BANS
Greetz