[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

Postby dnbESTgaming » 24 Sep 2013, 19:51

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

Postby dnbESTgaming » 27 Sep 2013, 21:18

Please help ?

sami1
Posts: 53
Joined: 18 Jul 2013, 21:28

Re: Amxbans IP show

Postby sami1 » 27 Sep 2013, 21:34

i tried.. i can't make it work.

dnbESTgaming
Posts: 7
Joined: 24 Sep 2013, 19:39

Re: Amxbans IP show

Postby dnbESTgaming » 27 Sep 2013, 22:41

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

Postby YamiKaitou » 27 Sep 2013, 23:31

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

dnbESTgaming
Posts: 7
Joined: 24 Sep 2013, 19:39

Re: Amxbans IP show

Postby dnbESTgaming » 28 Sep 2013, 20:13

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

Postby dnbESTgaming » 04 Oct 2013, 19:19

Is anyone willing to help ?:)

serfreeman1337
Posts: 8
Joined: 01 Oct 2013, 12:42

Re: Amxbans IP show

Postby serfreeman1337 » 05 Oct 2013, 05:49

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

Postby dnbESTgaming » 05 Oct 2013, 14:43

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: 121
Joined: 01 Apr 2013, 15:52

Re: Amxbans IP show

Postby Zapy » 06 Oct 2013, 13:26

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


Return to “Modifications and Addons”

Who is online

Users browsing this forum: No registered users and 1 guest