vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - Return to Sender - Redirect / Reject Visits From Certain Sites/IPs (https://vborg.vbsupport.ru/showthread.php?t=222217)

dartho 08-31-2009 10:00 PM

Return to Sender - Redirect / Reject Visits From Certain Sites/IPs
 
1 Attachment(s)
Make sure you check the NOTES section below!

This add-on allows you to specify domain names (or IP addresses) which you do not wish to accept links from. You have the choice to return a 404 message, redirect back to where they came (where they followed a link to your site from), display custom HTML, or redirect to another URL.

You could use this for a few different purposes. Say you suddenly get popular on slashdot or digg and your bandwidth is about to suffer - you can redirect all visitors that have clicked through on a link from said site to another URL, display them a "Too Busy" message, 404 them or just have them sent back to whence they came.

Say a dodgy site has links to your site, you could again 404, or display a "DO NOT WANT" message or just send them straight back to the referring page.

You can also just mess with people who have static IP addresses (partial addresses accepted).

Version Control
0.0.1 - Initial Release
0.0.2 - Fixed issue when having blank fields caused forum errors. Also made more lightweight (got rid of pregmatchs)
0.0.3 - Fixed another small bug
0.0.4 - OK - this time I fixed the bug :S

NOTES
WARNING
  1. Do not test with your own IP address, or domain name! You will lock your self out of your forums and will have to disable hooks to reconfigure the addon.
  2. Do not include leading HTTP:// or directory names - domain names (or partial) only!
    eg. use: evil-website.com , NOT http://evil-website.com and NOT http://evil-website.com/forum
  3. To disable the hook/plugin system, edit your includes/config.php file and place the following code on the second line (immediately below <?php) To re-enable hooks, undo the edit!
    Code:

    define('DISABLE_HOOKS', true);

elenh 09-01-2009 12:20 PM

thanks

TomHQ 09-01-2009 12:57 PM

And all this time I was just using .htaccess. Thanks for the mod. :)

EDIT: Tested. Works like a charm!

DOUBLE EDIT: Do you think you can make it so if were using the custom HTML message and a user coming from a blocked site trys to access my site will have a cookie stored on their computer so the next time they try to access the site they'll get the page/error message again?

Bibbo 09-01-2009 02:32 PM

Sounds good! *Downloaded*

l_amhed 09-01-2009 06:45 PM

Really nice idea !!

TomHQ 09-01-2009 07:10 PM

What is the syntax for multiple sites? I've tried the carriage return but that did not work.

dartho 09-01-2009 10:03 PM

Quote:

Originally Posted by TomHQ (Post 1877955)
What is the syntax for multiple sites? I've tried the carriage return but that did not work.

Should be just a new line per site - try editing the "Trash Referals!" plugin and replace
Code:

        $rtsbadrefs = explode("\r\n",$vbulletin->options['rts_bad_refs']);
        $rtsbadips = explode("\r\n",$vbulletin->options['rts_ips']);

with

Code:

        $crlf = chr(13).chr(10);
        $rtsbadrefs = explode($crlf,$vbulletin->options['rts_bad_refs']);
        $rtsbadips = explode($crlf,$vbulletin->options['rts_ips']);

let me know how that goes, thanks...

dartho 09-02-2009 05:10 AM

Quote:

Originally Posted by TomHQ (Post 1877756)
Do you think you can make it so if were using the custom HTML message and a user coming from a blocked site trys to access my site will have a cookie stored on their computer so the next time they try to access the site they'll get the page/error message again?

Good idea - I'll look at adding this as an option also

4nawadir.com 09-02-2009 11:23 AM

Great idea will be installed soon ...
Thanks

Megatr0n 09-02-2009 01:33 PM

dartho, when I installed this plugin it fed my index page with errors. Something to do with unable to produce headers and referrences the init/class_core.php files.

I was also unable to access my AdminCP. So, I had to disable all the plugins to get back in and disable your plugin.

Any ideas?


All times are GMT. The time now is 02:50 AM.

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.01344 seconds
  • Memory Usage 1,736KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete