View Full Version : [Release - MiniHack] Make update user info update post counts

21 Oct 2001, 01:22
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!

24 Oct 2001, 04:40
No comments :(

24 Oct 2001, 05:01
nice, glad someone thought of doing it... i guess i am to lazy to.. heh:rolleyes:

18 Jan 2002, 19:49
Isn't this a feature in v2.2.1 already? I installed this hack, just to be sure anyway. :) Thanks.

18 Jan 2002, 20:05
nice hack, thanx reaper

19 Jan 2002, 06:47
Yup, this is already a feature in v2.2.x.