Hi,
I'm trying to create a template modification to show or hide content to different groups with severals conditional, I followed this tutorial http://xenforo.com/community/resources/conditional-statements.1604/ but can not get it to work.
The template to modify is bb_code_tag_code and the conditionals are something like:
Find
Replace
Thanks and regards, Luis.
I'm trying to create a template modification to show or hide content to different groups with severals conditional, I followed this tutorial http://xenforo.com/community/resources/conditional-statements.1604/ but can not get it to work.
The template to modify is bb_code_tag_code and the conditionals are something like:
- If the user is a user of the group guest.
- You need to login or register to view this content.
- If the user is not a valid user.
- You need to be a valid user to view this content.
- If the user is a user of the groups 2 and 6.
- You need to be a premium user to view this content.
- The rest of groups may view the content.
Find
PHP:
<pre>{xen:raw $content}</pre><xen:comment><!-- content is escaped via parser --></xen:comment>
PHP:
<xen:if is="{xen:helper ismemberof, $visitor, 1}">
<div style="padding:10px; text-align: center; font-weight: bold;">
You need to <a href="{xen:link login}">login</a> or <a href="{xen:link register}">register</a> to view this content.
</div>
<xen:elseif is="{$visitor.user_state} != 'valid'">
<div style="padding:10px; text-align: center; font-weight: bold;">
You need to be a valid user to view this content.
</div>
<xen:elseif is="{xen:helper ismemberof, $visitor, 2, 5}">
<div style="padding:10px; text-align: center; font-weight: bold;">
You need to be a premium user to view this content.
</div>
<xen:elseif is="{xen:helper ismemberof, $visitor, 3, 4, 6}">
$0
</xen:if>
Thanks and regards, Luis.