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

XF 1.2 Last poster {xen:

Discussion in 'Styling and Customization Questions' started by tommydamic68, Nov 2, 2013.

  1. tommydamic68

    tommydamic68 Well-Known Member

    I am trying to find the code for the last poster in a thread or message - see image where the arrow is pointing.


    This doesn't seem to work, am i missing something? {xen:username user="$boardTotals.latestUser" />
  2. Amaury

    Amaury Well-Known Member

    What are you trying to change?
  3. tommydamic68

    tommydamic68 Well-Known Member

    I want to add last poster here - I just need the correct code.

    Screen Shot 2013-11-02 at 4.53.43 PM.png
  4. tommydamic68

    tommydamic68 Well-Known Member

    Can someone please help me with this, it is surely simple code.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Look in the node_forum_level_2 template.
  6. tommydamic68

    tommydamic68 Well-Known Member

    What code do I use?

    <xen:hook name="node_forum_level_2_before_lastpost" params="{xen:array 'forum={$forum}'}" />
            <div class="nodeLastPost secondaryContent">
                <xen:if is="{$forum.privateInfo}">
                    <span class="noMessages muted">({xen:phrase private})</span>
                <xen:elseif is="{$forum.lastPost.date}" />
                    <span class="lastThreadTitle"><span>{xen:phrase latest}:</span> <a href="{xen:link posts, $forum.lastPost}" title="{$forum.lastPost.title}">{$forum.lastPost.title}</a></span>
                    <span class="lastThreadMeta">
                        <span class="lastThreadUser"><xen:if is="{xen:helper isIgnored, $forum.last_post_user_id}">{xen:phrase ignored_member}<xen:else /><xen:username user="$forum.lastPost" /></xen:if>,</span>
                        <xen:datetime time="$forum.lastPost.date" class="muted lastThreadDate" data-latest="{xen:phrase latest}: " />
                <xen:else />
    It needs to be added here:

    div class="meta">
                {xen:phrase post_by}: <xen:username user="$post" />, <xen:datetime time="{$post.post_date}" />, {xen:phrase x_replies, 'count={xen:number $thread.reply_count}'}, {xen:phrase views} {$thread.view_count},
                {xen:phrase in_forum}: <a href="{xen:link forums, $forum}">{$forum.title}</a>
  7. tommydamic68

    tommydamic68 Well-Known Member

    Why will this not give me last poster info?

    {xen:phrase last_post}: <xen:username user="$forum.lastPost" /> it just gives me Last Post:

    Screen Shot 2013-11-05 at 5.26.59 AM.png
  8. Jeremy

    Jeremy Well-Known Member

    If you do {xen:helper 'dump', $forum} what do you get?
  9. tommydamic68

    tommydamic68 Well-Known Member

    Do I add it to the code, by itself?
  10. Jeremy

    Jeremy Well-Known Member

  11. tommydamic68

    tommydamic68 Well-Known Member

    no, just made a bunch of goobly code on site, with just {xen:helper 'dump', $forum} by itself and like this:

    {xen:helper 'dump', $forum}: <xen:username user="$forum.lastPost" />
  12. Jeremy

    Jeremy Well-Known Member

    What was the output? It'll tell you what is available in the $forum variable.
  13. tommydamic68

    tommydamic68 Well-Known Member

    Here is what I get , just to be clear, all I want is who posted last in any particular post to show in the search results along with views and replies.

    Screen Shot 2013-11-06 at 5.01.01 AM.png
  14. Jeremy

    Jeremy Well-Known Member

    The data you want is not available and will require an addon to fetch it.

Share This Page