Member and Guest Conditionals

Michael

Active member
I need to know how to show x info to members and x info to guests, anyone know the conditionals needed? I also need a conditional like the this script ones in vbulletin if anyone would like to share one for the index that would great.

Thanks :)
 
Thanks guys, do any you lot know the guest conditional something like so:
Code:
<xen:if is="{$visitor.is_guest}">
Guests Only
</xen:if>

Just so I dont need to use the else constantly :D
 
I can't find a way to check secondary groups with a template conditional. I looked through the template functions but I don't see anything for this purpose.

Maybe some one else knows.


Nah what I meant was to allow access to 2 or 3 different usergroups using their usergroup number. Rather than coding 3 different chunks of cose - or 30 different chunks!
 
If they are all primary groups then you can do this:

Code:
<xen:if is="{$visitor.user_group_id} == X OR {$visitor.user_group_id} == Y OR {$visitor.user_group_id} == Z">
    STUFF FOR GROUPS X,Y,Z
</xen:if>

But this doesn't check secondary groups.

This code could be shortened with array functions, but those don't appear to work here. I am still learning the system.
 
If they are all primary groups then you can do this:

Code:
<xen:if is="{$visitor.user_group_id} == X OR {$visitor.user_group_id} == Y OR {$visitor.user_group_id} == Z">
    STUFF FOR GROUPS X,Y,Z
</xen:if>

But this doesn't check secondary groups.

Thanks lots. I never got the hang of secondary groups anyway - they seem to dominate too much. So all mine are primary.
 
Top Bottom