MyBB Community Forums

Full Version: [F] Recount User Post Counts problem/issue.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I ran this just now, and when recounting... members were given credit for posts they made in forums that had the post count setting turned off (i.e., when posting in that forum, they aren't supposed to be credited toward their post count).

Why did this happen? Now members all have inflated post counts past what they should.

Can I fix it?
I believe you've found a bug Smile

In admin/maintenance.php, find:
$query2 = $db->simple_select(TABLE_PREFIX."posts", "COUNT(pid) AS post_count", "uid='{$user['uid']}' AND visible>0");
Replace with:
$query2 = $db->simple_select(TABLE_PREFIX."posts", "COUNT(pid) AS post_count", "uid='{$user['uid']}' AND visible>0{$fids}");

Run the post count updater again.
Awesome, used that code and recounted my posts and my post count went down a few...
I had discovered this bug before but could not be bothered to report it. Wink
Thanks, DennisTT. Worked like a charm!
...and I'm glad I was able to contribute in a small way and find a small glitch. Smile
This bug has been fixed in the latest code.

Please note the latest code is not live on the site or for download. An update will be released which contains this fix.
Yeah, I noticed this as well, but it didn't occur to me that it could be a bug! LOL...thanks, Dennis! Now I can get an accurate post count for my members! Big Grin