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

XF 1.5 IF / Conditions in XenForo?

Discussion in 'Styling and Customization Questions' started by vFranky, Jan 13, 2016.

  1. vFranky

    vFranky Active Member


    I came from vBulletin. There we have conditional code in the templates like this, which I use to display advertisments (to not logged in users) oder not (to logged in users) ==>

    <if condition="!in_array(THIS_SCRIPT, array('register','login'))">
         <if condition="$vbulletin->userinfo['userid']">
    or to do a postcount ==>

      <if condition="in_array($post['postcount'], array(3))"> 
    Is there any option to do the same in XenForo? Because I am using Audentio UI.X style with [AD] Monetization and want to use something like postcount there to position add banner in each 3rd oder 5th posting in a thread.

    Any tips are welcome, thank you very much.

    Kind regards,
  2. OUTL4W

    OUTL4W Active Member

  3. katsulynx

    katsulynx Well-Known Member

    <xen:if is="!{$visitor.user_id}"> Show this to guests only </xen:if>

    Not sure if message count was “posts“, can't look it up on my mobile. Maybe someone else knows or you have to try around a little/wait until later.
    <xen:if is="{$visitor.posts} <= 3"> Show to everyone with not more[ than 3 posts</xen:if>
    vFranky likes this.
  4. vFranky

    vFranky Active Member

    Thank you very much.

Share This Page