View Full Version : Total Posts
We have a "Chit Chat" forum on our boards where users can post anything. The problem is that some of our users complain because others get very high post counts by making useless posts to the Chit Chat forum. I'd really appreciate it if someone could tell me how to make the user post counts not go up in a specific forum.
Thanks
Sure this is pretty easy to do. Just open up "newreply.php" and change the following code:
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
And replace it with this:
// Change the number 1 below to the forum you don't want posts to count in
if ($threadinfo[forumid]==1) {
$DB_site->query("UPDATE user SET posts=posts,$dotitle"."lastpost=".time()." WHERE userid=$userid");
} else {
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
}
And that should do it.
-Chris
look just what i have been looking for as well :)
what if you want to specify 2 or more forums ?
Originally posted by eva2000
what if you want to specify 2 or more forums ?
Then just change that first line and add an 'or' for each forum you want to exclude:
if ($threadinfo[forumid]==1 or $threadinfo[forumid]==2) {
Well thanks for the quick reply! It works great but I have a problem. What about new threads? I did the same change for the newthread.php but my post count increased when I posted a new thread. I'll be very happy if you could find a solution for the new threads.
Thanks
Originally posted by DoST
What about new threads?
Sorry about the oversight there, yes you should be able to make the same change to newthread.php as you did in newreply.php, the code for incrementing the post count is the same in both. I'm not sure why it still changed your post count, but you might want to empty your browser's cache file and try it again?
It doesn't work for me. Maybe someone else who tried can tell if it works or not?
I did it a little differently.
In the Forum table I added a column called countposts
countposts smallint(6) default 1
Then using SQL queries I set them forums I wanted to ignore in the post count to zero.
update forum set countposts=0 where forumid=XX
newthread.php
Look for:
$foruminfo=$DB_site->query_first("SELECT
change to:
$foruminfo=$DB_site->query_first("SELECT countposts,
Leave the rest of the line alone.
Under that line add:
$countposts=$foruminfo[countposts];
Then look for:
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
Change to:
//Wayne Luke 11/01/2000
//Exclude certain forums from post counts
if ($countposts) {
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
} else {
$DB_site->query("UPDATE user SET posts=posts,$dotitle"."lastpost=".time()." WHERE userid=$userid");
}
// End Modification.
newreply.php
Look for:
$foruminfo=$DB_site->query_first("SELECT
Change to:
$foruminfo=$DB_site->query_first("SELECT countposts,
Leave the rest of the line as it is.
Look for:
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
Change to:
//Wayne Luke 11/01/2000
//Exclude certain forums from post counts
if ($countposts) {
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
} else {
$DB_site->query("UPDATE user SET posts=posts,$dotitle"."lastpost=".time()." WHERE userid=$userid");
}
// End Modification
THen if I want to exclude another forum in the future, I can just set the countposts column = 0 for that forum without touching the code.
[Edited by wluke on 12-26-2000 at 04:39 PM]
Thanks, I think I will include this on my site.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.