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

How can I add some info to last poster details?

Razasharp

Well-known member
#1
I am trying to show the prefix of a thread (if it has one) with the last poster info on the forum listings pages.

I've looked at the the node_forum_level templates, and tried adding this {$forum.lastPost.threadPrefix} but it doesn't work.

@Mike has said that it isn't stored hence why it isn't available.

Does anyone know how I can add this? I don't mind hacking the files if that will be the easiest way to do it.

Thanks in advance.
 

Jake Bunce

XenForo moderator
Staff member
#3
The last post info is cached in separate fields in the xf_forum table. This is to avoid having to query the actual post which you really don't want to do.

You need to add a column to xf_forum to store the associated thread prefix, then update that column when a new thread is posted. Then you can access that as part of the forum record in the templates.
 

Razasharp

Well-known member
#4
The last post info is cached in separate fields in the xf_forum table. This is to avoid having to query the actual post which you really don't want to do.

You need to add a column to xf_forum to store the associated thread prefix, then update that column when a new thread is posted. Then you can access that as part of the forum record in the templates.
Ah right... so that's what Mike was on about when he said it wasn't stored. Thanks Jake that's very helpful :)

I just need to work out how and where XF handles updating of that info - and how much Zend is like Rails (things like this would be done by observers or callback methods - does XF/Zend use them too?).

I guess this will be my first plug-in, wish me luck!