1. 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?

Discussion in 'XenForo Questions and Support' started by zoldos, Mar 19, 2014.

  1. zoldos

    zoldos Well-Known Member

    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:

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

    Jake Bunce XenForo Moderator Staff Member

    In the container scope you can use:

    <xen:if is="{$isAwaitingEmailConfirmation}">
    jamalfree likes this.
  3. zoldos

    zoldos Well-Known Member

    Great, thanks! What about:

    <xen:if is="{$isValid}">
    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.
  4. Milano

    Milano Well-Known Member

    You can use ! if you want to use "if is NOT" conditional, just similar to PHP.
    <xen:if is="!{$isAwaitingEmailConfirmation}">
    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

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

    zoldos Well-Known Member

    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:

    <xen:if is="!{xen:helper ismemberof, 5}">
    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!

  6. Brogan

    Brogan XenForo Moderator Staff Member

    <xen:if is="!{xen:helper ismemberof, $visitor, 5}">

    zoldos likes this.
  7. zoldos

    zoldos Well-Known Member

    Perfect, thank you very much!! :D

Share This Page