{thread.last_post_date}

Valhalla

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).

Code:
<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,
 
I think it will be something like this:
Code:
<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.
 
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:

Code:
<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>
</xen:if>
 
Top Bottom