View Full Version : Template condition to calculate days since last post
0ptima
08-09-2010, 11:05 PM
Is it possible to calculate the amount of days since the last post using a template conditional?
The reason I want to do this is to put a warning message next to the reply button for posts older than a year.
This is for VB 3.8. Thanks
You could try
<if condition="$thread['lastpost'] < (TIMENOW - (365 * 86400))">
// warning message
</if>
But whether it works or not may depend on which template you put it in.
ETA...I tried it in "threadbit". Also, you might also want to enclose it in another if to check to make sure that $thread['lastpost'] is set, so that in case it isn't the message won't show up.
0ptima
08-11-2010, 02:55 AM
Thanks, will give it a try!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.