Hey guys/girls,
Basically I'm adding a custom template page, but what I'm trying to do is use the hasNew template function.
From what I've seen in other templates, it is usually used with $category.hasNew or $forum.hasNew. Taking cue from this, I guessed that $category could be the category id of any forum category, and using the hasNew function I would get a true/false return on whether a forum category had any new posts.
So I implemented the following code, although a bit unorthodox in the way of xenforo, I'm just making a quick fix for now:
Nonetheless, when ever I use this, the condition constantly returns true and as a consequence, the '_new' as you can see above. The problem is that I only want the '_new' to be added when there are new posts.
Any suggestions?
Thanks.
Basically I'm adding a custom template page, but what I'm trying to do is use the hasNew template function.
From what I've seen in other templates, it is usually used with $category.hasNew or $forum.hasNew. Taking cue from this, I guessed that $category could be the category id of any forum category, and using the hasNew function I would get a true/false return on whether a forum category had any new posts.
So I implemented the following code, although a bit unorthodox in the way of xenforo, I'm just making a quick fix for now:
Code:
<xen:set var="$mc_cat">3</xen:set>
<xen:set var="$os_cat">23</xen:set>
<img id="show_Minecraft" src="mc_icon{xen:if $mc_cat.hasNew, '_new'}.png" />
<img id="show_AuroraSim" src="os_icon{xen:if $os_cat.hasNew, '_new'}.png" />
Nonetheless, when ever I use this, the condition constantly returns true and as a consequence, the '_new' as you can see above. The problem is that I only want the '_new' to be added when there are new posts.
Any suggestions?
Thanks.