MyBB Community Forums

Full Version: Recount one user's posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

We noticed that one user's post count is all wrong. Not sure how it happened or what went wrong if any something even did.

Was wondering if there's a plugin with which we can do a recount of just one user's posts?? I tried googling, but I keep ending up with the rebuild and recount feature in Tools & Maintenance or how to reset all post counts back to 0 without deleting the actual posts. I just want to be able to do a recount on one user.

We are on version 1.6.8.

I hope someone can help.

Regards
Nick
What's wrong with the recount&rebuild? It will fix your users counter plus all others...
But it's just one user. Would be nice to be able to do one user instead of doing all 10000 just to fix the one user.
I just recounted all user counts in a reasonably large forum on a shared host. It took less than 10 seconds for me.

Still not sure why you'd spend hours waiting for another solution.
It would be much quicker just to use the tool for everyone, but here's how you can do one user.

Run these queries in phpMyAdmin

SELECT * FROM mybb_posts WHERE uid='x'

Replace X with their uid.

Run the query, see how many rows are returned. Note the number.

UPDATE mybb_users SET postnum='y' WHERE uid='x'

Replace x with the uid and y with the postcount you got from the first query.
That method does not consider moderated posts/threads, as well as posts in forums that aren't supposed to add to the postcount.
(2012-09-27, 02:22 PM)frostschutz Wrote: [ -> ]I just recounted all user counts in a reasonably large forum on a shared host. It took less than 10 seconds for me.

Still not sure why you'd spend hours waiting for another solution.

'Cos one user's incorrect post count won't bring the forum to an halt and I figured it would be a nice thing to have in the future. Last time we did a rebuild and recount it was all wrong. Fortunately the second time it seemed to be correct. Have no idea why it would be wrong in the first place, but it was. We didn't even change anything for the second, just did the rebuild and recount again and then it seemed correct after that. So my confidence in it isn't all that great, but seeing as I'm not a php developer I can't really do much myself and have to rely on plugins (major thanks to the guys who spend time making these).

But no matter. I will let the site owner know that this is what we'll need to do as there's no easy way to do just on user.

Thanks for the help.