The Arcive of vBulletin Modifications Site. |
|
VERY quick avatar/attachment protector Details »»
|
|||||||||||||||||||||||||
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.
PHP Code:
Place at the top of avatar.php and attachment.php just after: PHP Code:
![]() Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
I don't mean to sound ignorant, but exactly what does this do?
|
|
#3
|
||||
|
||||
|
It makes it so you can't link attachment URLs to different places.
|
|
#4
|
||||
|
||||
|
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? ![]() PHP Code:
|
|
#5
|
||||
|
||||
|
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
|
|
#6
|
|||
|
|||
|
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.
|
|
#7
|
||||
|
||||
|
Quote:
Just put www.bearfacts2.com I have a question about that line, this one here: PHP Code:
|
|
#8
|
|||
|
|||
|
Quote:
PHP Code:
|
|
#9
|
|||
|
|||
|
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.
|
|
#10
|
||||
|
||||
|
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. ![]() Quote:
|
![]() |
|
|