DarkReaper
10-20-2001, 10:00 PM
I've run into the problem where post counts become b0rked several times while tinkering with my vBulletin, and always was annoyed when I went to update the counters and they didn't fix it. So I went and took a look at the file, and guess what! It doesn't update post counts! Doh!
In /admin/misc.php, find this:
// update user stuff
if ($user[customtitle]==0)
Add this before it:
$totalposts=$DB_site->query_first("SELECT COUNT(postid) AS posts FROM post WHERE userid='$userid'");
$DB_site->query("UPDATE user SET posts='$totalposts[posts]' WHERE userid='$userid'");
Now whenever you update the counters for users, it will update their post counts as well!
In /admin/misc.php, find this:
// update user stuff
if ($user[customtitle]==0)
Add this before it:
$totalposts=$DB_site->query_first("SELECT COUNT(postid) AS posts FROM post WHERE userid='$userid'");
$DB_site->query("UPDATE user SET posts='$totalposts[posts]' WHERE userid='$userid'");
Now whenever you update the counters for users, it will update their post counts as well!