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

Find How Many Times a User Posted in a Thread

Discussion in 'XenForo Development Discussions' started by James, Feb 18, 2011.

  1. James

    James Well-Known Member

    I've been working on a simple mod to view how many times a user has posted in a thread (using thread_view). I've been running something like:
    <xen:foreach loop="$posts" as ="$post">
    {$post.username} - {xen:count $post.username}
    As you can guess, it comes out as:
    James - 1
    Test - 1
    James - 1
    James - 1

    I'm not sure (perhaps I was just tired at 3am) how to merge all the 'James' posts into one, with accumulating post numbers.

    I get the feeling I'm gonna facepalm when I find out a quick method.
  2. Shadab

    Shadab Well-Known Member

    Btw, the $posts array wouldn't contain all the posts from a thread. So you won't be able to determine the correct post count in any multi-page thread; from the thread_view template itself.
    James likes this.

Share This Page