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:
Code:
$foruminfo=$DB_site->query_first("SELECT
change to:
Code:
$foruminfo=$DB_site->query_first("SELECT countposts,
Leave the rest of the line alone.
Under that line add:
Code:
$countposts=$foruminfo[countposts];
Then look for:
Code:
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
Change to:
Code:
//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:
Code:
$foruminfo=$DB_site->query_first("SELECT
Change to:
Code:
$foruminfo=$DB_site->query_first("SELECT countposts,
Leave the rest of the line as it is.
Look for:
Code:
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
Change to:
Code:
//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]