![]() |
VERY quick avatar/attachment protector
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:
|
I don't mean to sound ignorant, but exactly what does this do? :)
|
It makes it so you can't link attachment URLs to different places.
|
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:
|
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 ;) |
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.
|
Quote:
Just put www.bearfacts2.com I have a question about that line, this one here: PHP Code:
|
Quote:
PHP Code:
|
|
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:
|
All times are GMT. The time now is 10:17 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|