• 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?


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,


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>