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

XF 1.3 Marking threads as old

Razasharp

Well-known member
#1
Is there a date conditional that I can use to alert members a thread is old?

In the docs theres:

<xen:date time="$datetime" />

But that actually gives me an error on saving the template.
 

Jeremy

Well-known member
#2
Use a conditional combined with $servertime and xen:calc to determine if a threads date is old. I believe there is an old addon in the archive that describes it.
 

Razasharp

Well-known member
#3
Something like this?

PHP:
$date = new DateTime("2012-03-24 17:45:12");

<xen:if is="{$thread.last_post_date} < {$date}">
show notice
</xen:if>
Not sure where I'd set the date :/
 

Jeremy

Well-known member
#4
Code:
<xen:if is="$servertime - $post.post_date > 604800">
Show Notice
</xen:if>
That should be something along the lines of what you need. ($post.post_date may be wrong).
 

Razasharp

Well-known member
#5
Code:
<xen:if is="$servertime - $post.post_date > 604800">
Show Notice
</xen:if>
That should be something along the lines of what you need. ($post.post_date may be wrong).
Is there anyway I can specify a date Jeremy? I want all of our imported threads to show the notice (sorry should have made that clear in the first post).