Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
VERY quick avatar/attachment protector Details »
VERY quick avatar/attachment protector
Mod Version: 1.00, by CJi (Member) CJi is offline
Developer Last Online: May 2004 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 2.2.x Rating: (0 vote - 0 average) Installs: 4
Released: 14 Jul 2002 Last Update: Never Downloads: 1
Not Supported  

This has probably been written before (I haven't checked), but I am beginning to get annoyed with people linking to my attachments/users avatars. It's quick, it's dirty, and it works. Installation time: 15 seconds per file. Number of files to edit: 2.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Edit the $referers array with your details (DOMAINS and IP Addresses ONLY. Do NOT include path information or 'http://').

Place at the top of avatar.php and attachment.php just after:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Hope this is of help to some people.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 14 Jul 2002, 21:19
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
???

I don't mean to sound ignorant, but exactly what does this do?
Reply With Quote
  #3  
Old 14 Jul 2002, 21:26
MrLister's Avatar
MrLister MrLister is offline
 
Join Date: Oct 2001
It makes it so you can't link attachment URLs to different places.
Reply With Quote
  #4  
Old 14 Jul 2002, 22:14
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Still...

I guess I'm still not sure what it does. Sorry.

What will happen if someone DOES try to link to something then?

And what would you put in this line?

My site URL is http://www.bearfacts2.com/forum/

Is that what I would put here?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #5  
Old 14 Jul 2002, 23:15
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
I'm guessing you read my thread that I posted yesterday of how I had this problem.

What he means to say Boofo is that its suppose to prevent hotlinking of your forums attachments or avatars from another site. If you hotlink an image attachment, every viewer who see's that attachment on that "other" site will come up on your forums as a guest, a very strange bug but I've had it happen to me.

I'll try this out later and see how it works
Reply With Quote
  #6  
Old 14 Jul 2002, 23:19
CJi CJi is offline
 
Join Date: Nov 2001
Yup, anyone who tries to link to an image on your site (be it an avatar or an attachment) will just get a broken image/blank screen. It prevents bandwidth leeching/database slowness. Only sites listed in the $referer array will get the actual image/attachment/avatar requested.
Reply With Quote
  #7  
Old 14 Jul 2002, 23:20
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
Re: Still...

Originally posted by Boofo

And what would you put in this line?

My site URL is http://www.bearfacts2.com/forum/

Is that what I would put here?
He stated plainly and clearly NOT to put the "http://" prefix.
Just put www.bearfacts2.com


I have a question about that line, this one here:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Is it needed to state your domain twice as it shows above, just one is missing the www?
Reply With Quote
  #8  
Old 14 Jul 2002, 23:21
CJi CJi is offline
 
Join Date: Nov 2001
Re: Still...

Originally posted by Boofo


And what would you put in this line?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You would put:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #9  
Old 14 Jul 2002, 23:23
CJi CJi is offline
 
Join Date: Nov 2001
Probably not with a bit more jiggery in the php, but like I said this was just a quicky. If you site is categorically only accessible via www., then it is not necessary to use the second entry without the www., and probably likewise for the IP address. I only did it that way for completeness.
Reply With Quote
  #10  
Old 14 Jul 2002, 23:59
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
I see...

Ok, I see now. The 3 address are just in case someone tries to get around any one of the addresses to link to the files. It makes sense now. Thank you for the code, CJi.

Velocd, did it fix your problem? I haven't run into that yet, but it is always better to be prepared, I guess.

Originally posted by CJi
Probably not with a bit more jiggery in the php, but like I said this was just a quicky. If you site is categorically only accessible via www., then it is not necessary to use the second entry without the www., and probably likewise for the IP address. I only did it that way for completeness.
Reply With Quote
  #11  
Old 15 Jul 2002, 00:04
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
By the way...

CJi, I forgot to ask in my last message...you can add more addresses to that, right, if you want some site to be able to link to it? But what would happen, if you did that, if someone linked to the extra site that you allowed in there? Is there any way to stop them from linking to that other site and bypassing it? I have a main site that I use for commercial purposes and I would maybe like to be able to links things to there. But if someone linked to my main site, this wouldn't do me any good, would it?
Reply With Quote
  #12  
Old 15 Jul 2002, 01:26
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
A quick check, would this be ok (for the DOMAIN parts):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #13  
Old 15 Jul 2002, 01:43
Brainmaster's Avatar
Brainmaster Brainmaster is offline
 
Join Date: Jul 2002
Re: VERY quick avatar/attachment protector


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
In what kind of file must I add this code?
Reply With Quote
  #14  
Old 15 Jul 2002, 02:12
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
Re: VERY quick avatar/attachment protector

From post#1:

Originally posted by CJi

Place at the top of avatar.php and attachment.php just after:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #15  
Old 15 Jul 2002, 02:41
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
Question: The instructions say to place right after <?php. There is a similar hack, but to prevent attachment stealing, here: http://www.vbulletin.org/forum/showt...threadid=35399 Now this hack says to place the code after require("./global.php");. Is there a difference between either placement? Should I change my installation of that hack to place the code right after <?php, instead of after require("./global.php");?

Actually, upon closer examination, it looks like this version and that version are pretty different. Which one is better?
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!

Last edited by JJR512; 15 Jul 2002 at 02:43.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 07:56.

Layout Options | Width: Wide Color: