• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 what is the Xen conditional for "Awaiting Email Confirmation, Valid", etc?

zoldos

Well-known member
#1
It seems members who have not fully completed their registration can access the chatroom on my forum. So my question is, what conditional statement can I use so only members who are in the state "Valid" can use the chatroom? Also, I have this snippet of code:

Code:
<xen:if is="{xen:helper ismemberof, 6}">
But I need to how to make this "if user is NOT member of"..... Help please! Thanks!
 

zoldos

Well-known member
#3
Great, thanks! What about:

Code:
<xen:if is="{$isValid}">

</xen:if>
Which is what I need so all other "states" can't use the chatroom. And what about a "if is NOT", I'm sure it's simple, but I'm still getting used to the XF framework.
 

Milano

Well-known member
#4
You can use ! if you want to use "if is NOT" conditional, just similar to PHP.
Code:
<xen:if is="!{$isAwaitingEmailConfirmation}">

</xen:if>
There are 5 user states: valid, email_confirm, email_confirm_edit, moderated, email_bounce you can use in xf templates with $visitor.user_state param. In your case it should be

Code:
<xen:if is="{$visitor.user_state} == 'valid'">

</xen:if>
 

zoldos

Well-known member
#5
Okay the user state works great, thanks! However, I still can't get the usergroup one to work, and without it, banned members can use the chatroom. I tried the below code without success:

Code:
<xen:if is="!{xen:helper ismemberof, 5}">
...
</xen:if>
Basically, I just want to make it so anyone in the Banned usergroup (group number 5) cannot access the chatroom. I also tried a variation not using the "helper" and that blocked the chatroom for everyone, even my Admin account. So I still need help!

Thanks!!