PDA

View Full Version : Inline attachments and guests


sdenvers
06-13-2002, 11:20 AM
I want to allow guests to view all forums including a Pictures forum, but not allow them to view inline attachments (i.e. the pictures) in the Pictures forum until they've registered. I've set to disallow download of attachments in Pictures, but it doesn't seem to work as I've also set to view attachments inline. So right now they can see the pics...

Ideally, guests would get a small picture of my choice, say "Sign up to view this pic", and registered users would get the pic.

Is this possible with vB 2.2.6, or does it require a hack?

Cheers,
Simon

Logician
06-14-2002, 11:10 AM
It requires a hack and here it is: ;)

First create your image and put it into yourboard\images\ directory.

Then edit admin\functions.php and find:


if($dobbimagecode and ($bbuserinfo[userid]==0 or $bbuserinfo[showimages])) {


BEFORE that line add:


if($bbuserinfo[userid]==0) {
// do https://vborg.vbsupport.ru/
$myimagelock='onlock.gif';
$bbcode = preg_replace("/(\[)(img)(])(\r\n)*([^\"".iif($allowdynimg,"","\?\&")."]*)(\[\/img\])/siU", "<img src=\"images\\$myimagelock\" border=\"0\" alt=\"Register to View This Image\">", $bbcode);
}


Replace "onlock.gif" with your new image (be careful about the caps of file name!) and save your file. That's it, now if the forum viewer is a guest, all images will be displayed to him as your custom image while other board members will be ablo to see them as they are. (One downside: This hack will convert images in user profiles too)

BTW I liked your idea, can be useful for some people.. :cool:

Enjoy..
Logician