[WEB] Show if IP banned in Ban List

Post your modifications and addons here.
Example, Addons to CMS-sites that shows the latest bans and such.
dnbESTgaming
Posts: 7
Joined: 24 Sep 2013, 19:39

[WEB] Show if IP banned in Ban List

Post by dnbESTgaming »

Hello. So I was wondering, how can I make a thing on my amxbans ban list that shows your IP and tells if the IP is banned or not. I asked my friend for help and he told me to insert

Code: Select all

<span> 
        {if isset($check_id)} 
            <div class='error'><a href="http://{$smarty.server.HTTP_HOST}{$smarty.server.PHP_SELF}?bid={$check_id}"><span style='color:red;font-weight:bold;'>{"_YOUAREBANNED"|lang}</span></a></div> 
        {else} 
            <div class='success'>{"_IP"|lang} &mdash; {$your_ip}. <span style='color:green;font-weight:bold;'>{"_YOUNOTBANNED"|lang} </span></div> 
        {/if} 
    </span>  
to ban_list.tpl so i did. At first it didn't show the users IP. Then I just replaced {$your_ip} with {$smarty.server.REMOTE_ADDR} and it began to show IP. I went to my server and banned mysef for 1 hour. Ban appeared in banlist but the text didn't show i was banned. Can someone please help me ?
dnbESTgaming
Posts: 7
Joined: 24 Sep 2013, 19:39

Re: Amxbans IP show

Post by dnbESTgaming »

Please help ?
sami1
Posts: 53
Joined: 18 Jul 2013, 21:28

Re: Amxbans IP show

Post by sami1 »

i tried.. i can't make it work.
dnbESTgaming
Posts: 7
Joined: 24 Sep 2013, 19:39

Re: Amxbans IP show

Post by dnbESTgaming »

But is there any other way to make it work ?

http://kohila.eu/cs_bans.php there it works... I don't know what did they use to make it work.. But due to the dynamic IP i have, I've seen it tell me that my IP is banned (Sry for my english.)
YamiKaitou
Amxbans Developer
Posts: 257
Joined: 17 Apr 2013, 14:09

Re: Amxbans IP show

Post by YamiKaitou »

You probably need to add code to AMXBans. I do not think there is any way to do this with the default files. Though, I may be wrong since I haven't messed with the web part that much
Retired, don't bug me
dnbESTgaming
Posts: 7
Joined: 24 Sep 2013, 19:39

Re: Amxbans IP show

Post by dnbESTgaming »

wow.... That's why i'm here... I want to know what code where to add...
dnbESTgaming
Posts: 7
Joined: 24 Sep 2013, 19:39

Re: Amxbans IP show

Post by dnbESTgaming »

Is anyone willing to help ?:)
serfreeman1337
Posts: 8
Joined: 01 Oct 2013, 12:42

Re: Amxbans IP show

Post by serfreeman1337 »

Try this:

Code: Select all

{foreach from=$ban_list item=binfo}
	{if $binfo.player_ip == $smarty.server.REMOTE_ADDR}
		{assign var = host_ip_banned value = true}
		{break}
	{/if}
{/foreach}

{if isset($host_ip_banned)} 
	<div class='error'><span style='color:red;font-weight:bold;'>{"_YOUAREBANNED"|lang} {"_IP"|lang} &mdash; {$smarty.server.REMOTE_ADDR}</span></a></div> 
{else} 
	<div class='success'>{"_IP"|lang} &mdash; {$smarty.server.REMOTE_ADDR} <span style='color:green;font-weight:bold;'>{"_YOUNOTBANNED"|lang} </span></div> 
{/if}
dnbESTgaming
Posts: 7
Joined: 24 Sep 2013, 19:39

Re: Amxbans IP show

Post by dnbESTgaming »

serfreeman1337 wrote:Try this:

Code: Select all

{foreach from=$ban_list item=binfo}
	{if $binfo.player_ip == $smarty.server.REMOTE_ADDR}
		{assign var = host_ip_banned value = true}
		{break}
	{/if}
{/foreach}

{if isset($host_ip_banned)} 
	<div class='error'><span style='color:red;font-weight:bold;'>{"_YOUAREBANNED"|lang} {"_IP"|lang} &mdash; {$smarty.server.REMOTE_ADDR}</span></a></div> 
{else} 
	<div class='success'>{"_IP"|lang} &mdash; {$smarty.server.REMOTE_ADDR} <span style='color:green;font-weight:bold;'>{"_YOUNOTBANNED"|lang} </span></div> 
{/if}
Thank you. I had to remove {break} then it worked well. Thank you :)
Zapy
Site Admin
Posts: 122
Joined: 01 Apr 2013, 15:52

Re: Amxbans IP show

Post by Zapy »

the question is why you would want this function as you ban by steam-id not by ip-address?
Project Leader for Amxbans.net from 2013
Head Community admin for Warzone Short Valley
Swedish Gaming Community since 2000
www.warzone.nu
Locked