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)
-   -   Miscellaneous Hacks - Anti-Leech Attachments - prevent hotlinking and bandwidth theft! (https://vborg.vbsupport.ru/showthread.php?t=149666)

samuelss 01-15-2009 12:17 PM

Thanks for the Mod. The options are not showing on my 3.80 also so there must be something somewhere.

Thanks.

alik4277 01-16-2009 03:28 PM

If you can not see option to enable Anti-Leech:

Go to AdminCP -> Plugin & Products -> Plugin Manager -> anti-leech Plugin

Replace all plugin code with
PHP Code:

    $ref str_replace('http://www.','',$_SERVER['SERVER_NAME']);
    if(!
strstr($_SERVER['HTTP_REFERER'],$ref)) {
        
$id $vbulletin->db->fetch_array($vbulletin->db->query_read("SELECT postid FROM ".TABLE_PREFIX."attachment WHERE attachmentid = ".mysql_escape_string($_REQUEST['attachmentid'])));
            eval(
'$navbar = "' fetch_template('navbar') . '";');
        eval(
'print_output("' fetch_template('antileech') . '");');
        exit;
    } 

Save

MẪ$T?Я 01-16-2009 03:34 PM

it`s nice :up:

will try it

ammm
Quote:

Important : This has been tested on 3.6.2 and 3.8, I can presume it will be compatible with 3.7.x because it works on 3.8 - as always BACKUP FIRST
backup for database ?

thanks

YLP1 01-16-2009 04:43 PM

Installed and just doing a test run. Woo Hoo! This is awesome!! Works like a charm... cept I still don't have the acp enable/disable to show --- I used the code snippet from a couple of posts abovea and that didn't allow this mod to show up in the vbacp either.

samuelss 01-16-2009 08:13 PM

Quote:

Originally Posted by alik4277 (Post 1714787)
If you can not see option to enable Anti-Leech:

Go to AdminCP -> Plugin & Products -> Plugin Manager -> anti-leech Plugin

Replace all plugin code with
PHP Code:

    $ref str_replace('http://www.','',$_SERVER['SERVER_NAME']);
    if(!
strstr($_SERVER['HTTP_REFERER'],$ref)) {
        
$id $vbulletin->db->fetch_array($vbulletin->db->query_read("SELECT postid FROM ".TABLE_PREFIX."attachment WHERE attachmentid = ".mysql_escape_string($_REQUEST['attachmentid'])));
            eval(
'$navbar = "' fetch_template('navbar') . '";');
        eval(
'print_output("' fetch_template('antileech') . '");');
        exit;
    } 

Save

I still cannot see this in my VBulletin Options on 3.8.0 even after i have changed the code as you mentioned above. I also noticed that "if ($vbulletin->options['al_disable'])" is missing from the code you quoted above.

Thanks

alik4277 01-16-2009 08:36 PM

samuelss,
Replace, Save and test it

samuelss 01-16-2009 09:10 PM

Thanks. I have replaced and saved with and without "if ($vbulletin->options['al_disable'])". I have also tried install and uninstall and nothing is still showing.

Thanks.

alik4277 01-16-2009 09:21 PM

You can nothing find.
Replace plugin code with mine code, save and open link to attach-file on new window

Angel-Wings 01-17-2009 04:53 PM

Hmmm - can't this be done already with htaccess ?

Something like:

Quote:

<FilesMatch "attachment\.php">
RewriteCond %{HTTP_REFERRER} !^http://(www\.)?example.com(/)?.*$ [NC]
RewriteRule .*\.*$ - [F,NC]
</FilesMatch>
And when using the filesystem as storage:

Quote:

<LocationMatch "/uploads">
RewriteCond %{HTTP_REFERRER} !^http://(www\.)?example.com(/)?.*$ [NC]
RewriteRule .*\.*$ - [F,NC]
</LocationMatch>
Or is there any difference like some additional check ? Reading the addon, if I understand it right you parse HTTP_REFERRER too via PHP, doing it directly via the Server is maybe less portable, but maybe also faster that PHP doesn't need to be called everytime.

pipin 02-02-2009 05:00 AM

Quote:

Originally Posted by samuelss (Post 1715104)
Thanks. I have replaced and saved with and without "if ($vbulletin->options['al_disable'])". I have also tried install and uninstall and nothing is still showing.

Thanks.

Same here with 3.8.1

Does not work and no Option in the vB Settings.


All times are GMT. The time now is 11:04 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.01254 seconds
  • Memory Usage 1,753KB
  • 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
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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