A slight variation for those who are interested:
I have a forum set up so guests wouldn't be able to see the attachments, and attachments themselves are shown right in the thread (not with a link).
So the following change in code does the following:
- all guest see an specified image instead of an attachment.
- whoever tries to link to your attachment image from the different site will not be able to show it. the replacement image is going to show up instead of whatever is in attachment for all unregged people.
Find this in attachment.php:
PHP Code:
$permissions=getpermissions($getforuminfo[forumid]);
if (!$permissions[canview] or !$permissions[cangetattachment]) {
show_nopermission();
}
and replace show_nopermissions(); with this:
PHP Code:
header("Location: http://www.4adrive.com/img/attachment.jpg");
exit;
So here's how it should end up looking:
PHP Code:
$permissions=getpermissions($getforuminfo[forumid]);
if (!$permissions[canview] or !$permissions[cangetattachment]) {
header("Location: http://www.4adrive.com/img/attachment.jpg");
exit;
}
Of course replace the url of the image to whatever you want displayed there.
I use the following image: