Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Anti-Leech Attachments - prevent hotlinking and bandwidth theft! Details »»
Anti-Leech Attachments - prevent hotlinking and bandwidth theft!
Version: 1.1, by steadicamop steadicamop is offline
Developer Last Online: Dec 2014 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.x Rating:
Released: 06-13-2007 Last Update: 01-09-2009 Installs: 191
Uses Plugins Template Edits
 
No support by the author.

Title : Anti-Leech Attachments

Version : 1.1

Coder : Jason Williams

Purpose : Prevent your forum attachments from being directly linked to - prevent bandwidth abuse.

Why : Bandwidth can be expensive, plus I was frustrated with one of my members linking to three video clips on my forum from his own site, effectively abusing the bandwidth I pay for, so I set about a system that stops hotlinking, but at the same time, as a courtesy, providing a dynamic link to the post containing the attachment.

How : This could be replicated very easily using .htaccess but the one thing that it can't do is give you the link to the attachment itself. This mod displays a message informing the user that hotlinking is not allowed, then giving them the link to the post to view the attachment directly.

Known Issues : The security can be defeated by using the drop down style menu on the Anti Leech page - this has only been confirmed as an issue on Firefox. I have unsucessfully tried to find a way of removing the drop down on that page only.

Confirmed working with vBSEO 3.2.0.

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!

Demo : http://www.steadiforum.com/attachmen...9&d=1180779148

Installation :

1. Import Product - product-antileech.xml
2. Save bandwidth!

File uploads : 0
Files to Import : 1
New Templates : 1
New Phrases : 2
Uses Hooks : 1
Uses Queries : 1

History :
v1.0 - Original release

v1.1 - Added enable/disable option, tested on VB 3.8

Done - if you like please click install! (and click Nominate for MOTM!)

Download Now

File Type: xml product-antileech.xml (3.4 KB, 728 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 05-13-2009, 09:47 PM
steadicamop's Avatar
steadicamop steadicamop is offline
 
Join Date: Jul 2004
Location: Lancashire, UK
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry guys, been out of the loop for quite a while now, will take a look at this and see if anything needs updating, I have tested it on my current install and it works fine.

Jason (Steadicamop)
Reply With Quote
  #73  
Old 05-13-2009, 09:54 PM
steadicamop's Avatar
steadicamop steadicamop is offline
 
Join Date: Jul 2004
Location: Lancashire, UK
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[Update]

Tested on vb 3.8.0 - click to test -- http://www.steadiforum.com/attachmen...2&d=1222457106

Could you confirm which version of vb you are attempting to run this on? I will re-investigate the admincp issue, there should be the option there.

Thanks,

Jason
Reply With Quote
  #74  
Old 05-19-2009, 01:43 PM
Snookieboy Snookieboy is offline
 
Join Date: Apr 2007
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works perfectly on my forum - VB 3.8.2 with VBSEO

Only problem that still remains is with people with no referer entry (ie they have antivirus programs like Norton which remove the referer tag for no apprant reason). A fix that would also allow people with no referer to download to would be brilliant.

Example attachment: http://digiex.net/attachments/guides...otosendfix.zip
Reply With Quote
  #75  
Old 06-04-2009, 12:34 AM
Sp32 Sp32 is offline
 
Join Date: Sep 2008
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed, much appreciated
Reply With Quote
  #76  
Old 08-10-2009, 12:38 AM
ShackMaster ShackMaster is offline
 
Join Date: Apr 2006
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed on my 3.8.3 board, but does not work and there is no option in vB Options either. I tried replacing the plugin code as an earlier poster suggested, but it still does not work.
Reply With Quote
  #77  
Old 08-10-2009, 11:58 AM
pablete pablete is offline
 
Join Date: Feb 2009
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks. there is a mod like this but to do this with the images displayed in a forum? is that if someone copies the address of an image to put in another forum, this will not show any image and leave another pic in place? thanks
Reply With Quote
  #78  
Old 09-18-2009, 12:44 AM
grafbyte grafbyte is offline
 
Join Date: Apr 2007
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi

im install dir in the 3.8.4 and i cant not see the settings
PHP Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="antileech" active="1">
    <title>Anti Leech Attachments</title>
    <description>Prevent hot linking your 

attachments!</description>
    <version>1.1</version>
    <url>https://vborg.vbsupport.ru/showthread.php?t=149666</url>
    

<versioncheckurl><![CDATA[https://vborg.vbsupport.ru/misc.php?do=productcheck&pid=antileech]]></versioncheckurl>
    

<dependencies>
    </dependencies>
    <codes>
    </codes>
    <templates>
        <template name="antileech" 

templatetype="template" date="172182599" username="Jason" version="1.00b"><![CDATA[$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - $vbphrase[antileech]</title>
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" 

align="center">
<tr>
    <td class="tcat">$vboptions[bbtitle] - $vbphrase[antileech]</td>
</tr>
                <td class="panelsurround" align="center"><br /><br />
            <div class="panel" style="width:70%">
        <br /><phrase 1="{$id['postid']}">$vbphrase[antileechmessage]</phrase><br /><br />
</div><br /><br /></td>
</tr>
</table>
$footer
</body>
</html>]]></template>
    </templates>
    <plugins>
        <plugin active="1" executionorder="5">
            

<title>anti-leech</title>
            <hookname>attachment_start</hookname>
            <phpcode><![CDATA[if 

($vbulletin->options['al_disable'])
{
    $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;
    }  
}]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
        <phrasetype name="GLOBAL" 

fieldname="global">
            <phrase name="antileech" date="1172182599" username="Jason" 

version="1.0"><![CDATA[Anti Leech Protected]]></phrase>
            <phrase name="antileechmessage" 

date="1172182522" username="Jason" version="1.0"><![CDATA[Sorry, only direct links from threads are allowed to view 

attachments.  As a courtesy, the link to the post containing the attachment is provided below.<br /><br /> <a 

href=showthread.php?p={1}>Click here to visit the post with the attachment.</a> <br /><br /> Leeching from the forum is not 

permitted, to save bandwidth abuse only direct clicks from the thread the attachment is with will work. All attachments are 

viewable by guests (you are not required to register).]]></phrase>
        </phrasetype>
        <phrasetype 

name="vBulletin Settings" fieldname="vbsettings">
            <phrase name="setting_al_disable_desc" 

date="1231584976" username="Jason" version="1.00b"><![CDATA[Enable Anti-Leech Attachments?  Allows non-hotlinking of 

attachments, the only way they can be viewed is from clicking the attachment link on the post.]]></phrase>
            

<phrase name="setting_al_disable_title" date="1231584976" username="Jason" version="1.00b"><![CDATA[Enable Anti-Leech 

Attachments]]></phrase>
            <phrase name="settinggroup_leech_settings" date="1231576342" username="Jason" 

version="1.00b"><![CDATA[Anti-Leech Settings]]></phrase>
        </phrasetype>
    </phrases>
    <options>
    

</options>
    <helptopics>
    </helptopics>
    <cronentries>
    </cronentries>
    <faqentries>
    </faqentries>
</product>
Reply With Quote
  #79  
Old 09-30-2009, 09:43 AM
TheChaosFactor TheChaosFactor is offline
 
Join Date: Sep 2009
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pablete View Post
thanks. there is a mod like this but to do this with the images displayed in a forum? is that if someone copies the address of an image to put in another forum, this will not show any image and leave another pic in place? thanks
I just copied the address and posted that pic in my forum using image tags with no problem, which is what I thought this was supposed to prevent?

Not sure I understand the use of this, at all?
Reply With Quote
  #80  
Old 09-30-2009, 04:36 PM
kalisekj kalisekj is offline
 
Join Date: Dec 2006
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed but its not working I am still able to hot link to my attachments
Reply With Quote
  #81  
Old 10-04-2009, 02:14 PM
TheChaosFactor TheChaosFactor is offline
 
Join Date: Sep 2009
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kalisekj View Post
Installed but its not working I am still able to hot link to my attachments
I tested it using the demo pic and hotlinked it from there, so I don't think it's just you.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:08 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.05087 seconds
  • Memory Usage 2,346KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete