Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Text to display if user does not have permission to view attachments

Aloittaja IngeJones, elokuu 24, 2006, 04:58:11 AP

« edellinen - seuraava »

IngeJones

Would it be possible to have an option to say "You have been denied access to one or more attachments" or similar when viewing a message instead of nothing showing at all when the user's group does not have attachment access?   I sometimes get the impression guests are looking around my forum and not registering because they think there is nothing to download.

texasflats

Thats what I came looking for. If this has been addressed, sorry I did search but the most I found were request.

I want something to entice registration, instead of displaying the image a blurb stating "To view this image you must log in or register"

Thanks.

KGIII

I was REALLY bored...


// Assuming there are attachments...
if (!empty($message['attachment']) && ($context['user']['is_guest']))
{
echo ' <b>No attachment for you *****!</b> ';
}
else


That's the now modified Display.template.php... Err... You should probably not call the guests names though so, well, have fun.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

KGIII

Note that for this to work guests will have to be given permissions to VIEW the attachments first. Basically you give 'em permissions in the administration center and then kick 'em in the face via the code by adding a check to see if they are guests or not. If they are you send 'em a message. If they are not (else) you let 'em see the attachments.


// Assuming there are attachments...
if (!empty($message['attachment']) && ($context['user']['is_guest']))
{
echo ' <b>No attachment for you guestboy!!! Don't be lazy and try the whole registration process like normal people!</b> ';
}
else
{
echo '


Note that that is changing the first line, adding the echo statement, and the last two lines (bracket and echo ') are actually already in place but I left 'em so you could see where they go.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

IngeJones

Thanks :D   Unfortunately...  since asking for that, my forum now has sections under control of different people, and some sections do allow guest downloads while others don't.    :(   Still I think that will be useful at some point.  Thank you again.

KGIII

LOL Well, at the very least, it was worth doing and the process was rather amusing. Initially, well, it wasn't working well. So eventually I was frustrated and you should have seen what it said when I finally DID get it working.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

IngeJones


KGIII

I should probably package that up as a mod now that I think about it. *sighs* Maybe I will get the time to do so tonight.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

khoking

Hi KGIII,

Can put into a mod? Or already have? I can't find it and I don't want to manually edit / mod my SMF...which might be difficult to upgrade in future...
Kho King
www.ShaShinKi.com
www.PentaxWorld.com

Advertisement: