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

XF 1.1 If statment - show somthing when post count equals X

Discussion in 'XenForo Questions and Support' started by Martry, Apr 10, 2013.

  1. Martry

    Martry Member

    Is it possible to use an {if} statement to show a certain profile field on the edit profile page, like the homepage field, only when the registered user has reached a certain amount of posts.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  3. Martry

    Martry Member

  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Are you working in the message_user_info template?

    You may want to use $visitor instead of $user , depending on exactly where you are working.
     
    Martry likes this.
  5. Martry

    Martry Member

    Thank you for your help buddy, you are correct it worked fine when i changed $user to $visitor. :D

    I was editing account_personal_details template.

    Code:
    <xen:if is="{$visitor.message_count} > 3">
    <dd><input type="url" name="homepage" value="{$visitor.homepage}" id="ctrl_homepage" class="textCtrl" /></dd>
    <xen:else />
    <dd>You must have at least 3 forum posts to add your website.</dd>
    </xen:if>
     

Share This Page