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



Well-known member
I'm looking to display something in "thread_view" only if the thread has been responded to within the last year (last_post_date).

<xen:if is="{$canQuickReply} && {xen:number '{xen:calc '{xen:helper utctime}'} - 31556926'} < {$thread.last_post_date}">
The above template change does not seem to work: If the thread's last post time is greater than the time one year ago.

Any help would be appreciated,

Mr. Goodie2Shoes

Well-known member
I think it will be something like this:
<xen:if is="{$canQuickReply} && ({xen:calc {xen:helper utctime} - 31556926} < {$thread.last_post_date})">
I haven't tested it... so do experiments with quotes if this one does not work.


Well-known member
Thanks, Goodie.

It turns out {xen:helper utctime} doesn't actually exist in the core, but as an add-on. I used {$serverTime} instead.

This is what worked:

<xen:if is="({xen:calc '{$serverTime} - 31556926'} > {$thread.last_post_date}) && !{$thread.sticky}">
    <xen:set var="{$canReply}">0</xen:set>
    <xen:set var="{$canQuickReply}">0</xen:set>