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

XF 1.5 Zombie thread alert

JamesBrown

Well-known member
#1
A Google search took me to an old thread on Mumsnet. At the top of the page was the following warning. What a good idea. Does anyone know if this can be done in xF


ZOMBIE THREAD ALERT: This thread hasn't been posted on for a while.
 

Mike

XenForo developer
Staff member
#2
It should be doable by adding a conditional based on the thread's last post date compared to the current time.
 

Lisa

Well-known member
#5
Was bored, so had a mess around with this. Just used simple text, but would be easy enough to expand and use images. Conditional uses a year from the last post date/time.
year conditional.png

I make no claims on how good this works or even if it's the proper way to do it as I'm not a coder of any kind lol

Code:
<xen:if is="({xen:calc '{$serverTime} - 31556926'} > {$thread.last_post_date})">
<h1>Show this notice</h1>
</xen:if>
I also tested it using one day - change the 31556926 string to 86400.

/EDIT

Oh yeah, I put it at the top of the thread_view template.
 

Lisa

Well-known member
#6
Little more messing around... still nothing special, but I think it works better displaying just above the quick reply - that way you're not assuming everyone who goes into the thread is there to post, they might be there just to read...

If they get as far as quick reply, the notice seems more logical:-

above quick reply.png

I cheated and put the code inside the ad_thread_view_below_messages template and put the image in a class so i could add some css.

Looks kinda cute.
 

Amaury

Well-known member
#8
@Lisa, if we just wanted something really basic, would it be really easy to make a duplicate of the thread status notice?

Notice.PNG

Instead of the above message, though, it would be something like, "Notice: This thread hasn't received a reply since August 21, 2015." And the lock icon would, of course, not be there. I assume it's just a matter of copying and pasting the code for the thread status in the corresponding template and then adjusting it accordingly. But everything's not always that easy, is it? ;) So I'm just making sure.
 
#12
Little more messing around... still nothing special, but I think it works better displaying just above the quick reply - that way you're not assuming everyone who goes into the thread is there to post, they might be there just to read...

If they get as far as quick reply, the notice seems more logical:-

View attachment 139513

I cheated and put the code inside the ad_thread_view_below_messages template and put the image in a class so i could add some css.

Looks kinda cute.
I would actually love to get that exact code block from you, I will repost the picture or choose another of course!
 
#13
Was bored, so had a mess around with this. Just used simple text, but would be easy enough to expand and use images. Conditional uses a year from the last post date/time.
View attachment 139509

I make no claims on how good this works or even if it's the proper way to do it as I'm not a coder of any kind lol

Code:
<xen:if is="({xen:calc '{$serverTime} - 31556926'} > {$thread.last_post_date})">
<h1>Show this notice</h1>
</xen:if>
Hi! How to specify message to be displayed in a particular subforum only?

Code:
{xen:calc '{$serverTime} - 31556926'} > {$thread.last_post_date}) + {forumid=}
?