PDA

View Full Version : Any variable to print no permissions in the showthread??


benative
07-23-2011, 12:46 AM
I have a custom image link in the showthread and I would like to block people with no permission... is there a way to do it in the template with a vb variable? or do I have to create a plug in for that?

kh99
07-23-2011, 01:18 AM
Do you mean you want to block certain usergroups? You can do this:

<vb:if condition="!is_member_of($bbuserinfo, A, B, C)">
// custom image link code
</vb:if>


where A, B, C are usergroup ids to block. If you'd rather list the groups that have permission, remove the '!' from in front of is_member_of.

benative
07-23-2011, 01:42 AM
Thanks but that hide the link. I want it to remain the image link and block guest to access to that link.. so that they want to sign up.
Thanks

--------------- Added 1311389160 at 1311389160 ---------------

to be more specific.. I would like them to click on it and get a no permission notice so that they are forced to sign in. then, I wish that they comeback to where they were.
is it complicated? do I need to write a plug in?

kh99
07-23-2011, 01:50 AM
What does the custom link link to? Is it a vbulletin page? If so then you might be able to check in that page by writing a plugin. If you're linking directly to an image then I think all you can do is replace the link with something else, like

<vb:if condition="!is_member_of($bbuserinfo, A, B, C)">
// custom image link code
<vb:else />
// a link to a "no permission" page
</vb:if>

benative
07-23-2011, 02:13 AM
What does the custom link link to? Is it a vbulletin page? If so then you might be able to check in that page by writing a plugin. If you're linking directly to an image then I think all you can do is replace the link with something else, like

<vb:if condition="!is_member_of($bbuserinfo, A, B, C)">
// custom image link code
<vb:else />
// a link to a "no permission" page
</vb:if>

Thank you for the above code but I think I need a plug in rather than a vriable..the image link will lead people to the same exact page.. that's just a way of having people log in

here is an example if a guest want to see what's the content, they will want to click on the image link... then I want it to show no permission. and then people will log in. and finally, they will return to the last showthread page that they were looking at.. and they will be able to see their hidden contents..

just like Click here to (https://vborg.vbsupport.ru/showthread.php?t=267256) https://vborg.vbsupport.ru/external/2011/07/47.jpg (https://vborg.vbsupport.ru/showthread.php?t=267256)


in that case I don't have the no permission.. but I want that to be the no permission. and once they log in they come back to where they are and they can see the contents now...

Thank you for your help. hope I make sense