XF 2.0 Thread reply count for posts within a set time

Case

Well-known member
I'm trying to alter the thread reply count to only count posts that have been made within the last 21 days.

So this bit of code in thread_list_macros :
Code:
<dd>{{ $thread.discussion_type == 'redirect' ? '&ndash;' : $thread.reply_count|number }}</dd>

I know the following would check if the post is under 21 days...
Code:
($xf.time - $post.post_date) < 1814400

Some sort of combination of that and count($posts) perhaps?
 
Full post data isn't available on the thread list (and even inside threads, you only get one page of post data). You could query for the value, but that's likely to incur significant overhead.
 
Back
Top Bottom