vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - IP Blocker Widget (https://vborg.vbsupport.ru/showthread.php?t=255245)

DHS2 12-14-2010 10:00 PM

IP Blocker Widget
 
1 Attachment(s)
Description:
Deny access to IP address array
Installation:
Create a new widget or forum side block (direct php execution)

Title for example "IP Blocker"
Description "IP Blocker Array"

Paste this code on widget configuration and save:
PHP Code:

$blacklist = array("127.0.0.1""127.0.0.1""127.0.0.1"); 
if(
in_array($_SERVER['REMOTE_ADDR'], $blacklist)) { 
    
header("Location: http://www.fbi.gov"); 
    exit(); 
}else{ 
$output '<center><img src="images/misc/security.png" /></center>';


Setup:
change 127.0.0.1 with the ip you want to block
change "security.png" with your desidered image
change "http://www.fbi.gov" with the link desidered to redirect

This is my first version (is a simple code)
If the user's IP number is contained in the array will be redirected to the FBI homepage, otherwise this will print the image. png

zelnik 12-15-2010 07:13 AM

sorry but i'm confused what this does over the built in ip ban that has been in vb since day 1?

DHS2 12-15-2010 07:47 AM

Quote:

Originally Posted by zelnik (Post 2134150)
sorry but i'm confused what this does over the built in ip ban that has been in vb since day 1?

This is not ip ban, is a simple mod for block determinated ip addresses to view the forum (or home page in case of publishin suite).

Delphiprogrammi 01-05-2011 06:34 PM

this is easy it will not block the ip address contained in the array but they will be redirected to the configuerd url this might scare spammers :D

DNN 04-06-2011 02:54 AM

I'm a lil' confused on this one too

Rahstyles 04-06-2011 09:21 AM

Hey man this is freaking neat!!! it works.. very nice.. im supposing .. if you have multiple ip's u can put an extra "" and put the ip inbetween correct?

DHS2 04-06-2011 02:34 PM

This is a simple code that I had to get rid of some people several months ago.
If you want you can develop in many different ways and it also interact with the database for example.

You can add more IP numbers if you want.
"127.0.0.1", "127.0.0.1", "127.0.0.1", "m.o.r.e", "m.o.r.e", "m.o.r.e" etc. etc.

(the best way is modify the code and download array from database or an external .txt file for many ip's)

(Sorry for my bad english)

DNN 04-17-2011 07:36 AM

Where is the download link?

LorinPotter 07-23-2011 12:04 PM

Excellent, and something that I'm wanting for my VB 3.7.

Can someone please provide me with the varable name used in 3.7 for the incoming IP?


All times are GMT. The time now is 02:11 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01558 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete