1. 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?

Discussion in 'XenForo Development Discussions' started by Razasharp, Feb 1, 2014.

  1. Razasharp

    Razasharp Well-Known Member

    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.
  2. Razasharp

    Razasharp Well-Known Member

    Anyone have any ideas for this please?

    I could really do with adding this before I make the forum live :)
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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 likes this.
  4. Razasharp

    Razasharp Well-Known Member

    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!

Share This Page