MyBB Community Forums

Full Version: IP Banned Function?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

Just wondering if anyone knew the function to create this:

http://i.imm.io/B3od.png

Thanks Smile
hm i think you can do it without any plugins just add this code to index.php
this will just display that he is banned but you need to make the style by your own
How to
add to index.php :
<?php
  $userip = $_SERVER['REMOTE_ADDR'];
  $banlist = file_get_contents('bans.txt');

    if (preg_match('/'.$userip.'/i', $banlist)
    {
     print 'your banned contact the Admin at YOUREMAIL if you want to get unbanned.';
exit;
        }
?>
make bans.txt on your forum root and insert the banned ip's in it
this might work (i never actually tried it on mybb) so let me know if it worked
regards,
You can ban IP addresses and ranges in the ACP.
and i has just noticed you can do it throw your ACP
ACP>Configuration>Banning>Banned IPs
hope i helped
regards,
Cheers for the replys Smile

I was wondering if there was an actual function for creating that message inside a plugin.

I think i've got it now, I've just created a custom error message, I suppose I should of thought of using the error() function and the language variable before posting.

Thanks guys Smile
Ban IP from ACP is only for user registration or also for forum read-only access?
Ban IP from ACP totally restricts that IP from accessing your board.

Meaning they can't view the forums/login/logout/register etc.
Please don't revive old threads, especially with this kind of advices. Closing.