Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Attachment and avatar hotlinking protection (1.0.1) Details »»
Attachment and avatar hotlinking protection (1.0.1)
Version: 1.00, by fury fury is offline
Developer Last Online: Sep 2018 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-02-2003 Last Update: Never Installs: 12
 
No support by the author.

Support in this thread or by email (preferrably thread)

vBulletin 2.2.x (tested on 2.2.9)

Prevents people from linking to attachments and custom avatars on your forum from other sites.

Example:
Attachment hotlinking protection: Click and watch the redirection message. You are then taken straight to the post containing the attachment.

Custom avatar hotlinking protection: Click and watch the redirection message again. This time you are taken to the user's profile.

When the attachment is linked to via an img tag, it is shown as a red x in IE, or a torn paper in Mozilla.

Modifications:
2 file modifications
/forum/attachment.php
/forum/avatar.php
1 new template
redirect_wrongreferrer

Updates since 1.0:
Added custom avatar hotlinking protection

Modifications since last version:
2 file modifications
/forum/attachment.php
/forum/avatar.php
1 template modification
redirect_wrongreferrer

For upgrade instructions see the text file.

Note for people who have problems getting the avatar hotlinking protection to work: Try this code in the avatar.php modification instead of mine

Show Your Support

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

Comments
  #42  
Old 03-10-2003, 05:56 AM
Sia Bani Sia Bani is offline
 
Join Date: Oct 2002
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi again. I have another question...does anyone know how to make an advertisement of my site by replacing the image that is being hotlinked? Basically, instead of the x or the actual image they're trying to hotlink, how could I make an ad of my site come up? Anyone come up with this already?
Reply With Quote
  #43  
Old 05-21-2003, 06:26 AM
dennx dennx is offline
 
Join Date: Sep 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this hack work in vB 2.3??
Reply With Quote
  #44  
Old 05-24-2003, 08:58 PM
phenom phenom is offline
 
Join Date: Feb 2003
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed this on 2.3.0 and it... sorta... works

The images don't seem to be able to be hotlinking, but instead of getting the message from the new template, I get this:

Code:
Parse error: parse error, unexpected T_STRING in /home/pcbaseb/public_html/forums/attachment.php on line 39
Reply With Quote
  #45  
Old 05-24-2003, 09:02 PM
fury's Avatar
fury fury is offline
 
Join Date: Oct 2001
Location: Indiana
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dennx: It should

phenom: Show me your line 39, if you don't mind
Reply With Quote
  #46  
Old 05-25-2003, 08:06 AM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A great idea, just like Nuke has.
Reply With Quote
  #47  
Old 06-03-2003, 03:21 AM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, i changed this around a bit cause i didn't work for me. Some ppl couldn't see the images in the forum.
PHP Code:
if (!$GLOBALS[HTTP_REFERER]) {
    
$HTTPREFERER "http://www.7thgencivic.com/";
} else {
    
$HTTPREFERER $GLOBALS[HTTP_REFERER];
}

$c_url parse_url($HTTPREFERER);

if (!
substr_count($c_url[host], "www.7thgencivic.com") || !substr_count($c_url[host], "7thgencivic.com")) {
  
$redirectquery $DB_site->query_first("SELECT postid,threadid FROM post WHERE attachmentid='".$attachmentid."'");
  
$url $bburl "/showthread.php?s=".$session[sessionhash]."&threadid=".$redirectquery[threadid]."#post".$redirectquery[postid];
  
$redirecttype "post";
  eval(
"standardredirect(\"".gettemplate("redirect_wrongreferrer")."\",\"\$url\");");

Reply With Quote
  #48  
Old 07-05-2003, 12:54 AM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody using this hack gotten reports that it screws up if you have Windows NT or are behind a proxy? I have tried multiple hacks to protect avatars and attachments, but I have a few users they say the see the replacement image even when they are on the site viewing the image.

Any ideas? I think a .htaccess might work for me, but I don't know what I'm suppose to put in it.
Reply With Quote
  #49  
Old 07-07-2003, 12:33 PM
Andrus Andrus is offline
 
Join Date: Dec 2001
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My question is this... One of my sites is a new site, and some are still entering the site through the IP right? So would you not want to have both the IP and the domain name listed, and if so could you simply seperate Domain, and IP with a comma in the code?
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 02:22 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07477 seconds
  • Memory Usage 2,292KB
  • Queries Executed 23 (?)
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_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete