• 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

James

Well-known member
#1
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:
Code:
<xen:foreach loop="$posts" as ="$post">
{$post.username} - {xen:count $post.username}
</xen:foreach>
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.
 

Shadab

Well-known member
#2
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.