View Full Version : Give Users +10 postcount when they post a thread
Moreland
06-21-2003, 10:04 AM
Very Simple I presume
Just how do I do it ? I dont want to add any reward things or anything like that, just simple give users +10 posts if they post a thread.
Thanks :)
PS: also when i delete the thread it needs to -10 postcounts from the user that started it.
I am using VB 2.3.0
Chris M
06-21-2003, 11:08 AM
Open root/newthread.php
Find:
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");
}
Replace with:
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+10,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");
}
Open admin/functions.php
Find:
if (is_array($userpostcount)) {
while(list($postuserid,$subtract)=each($userpostco unt)) {
$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");
}
}
add below:
if (!empty($userpostcount)) {
$DB_site->query("UPDATE user SET posts=posts-9 WHERE userid='$postuserid'");
}
:)
It says -9, as the query above it will reduce the user's post count for the amount of posts in that thread that they made, so the first post will be counted as 1 post, so to make it remove 10 you have to subtract the 1 which was already removed, leaving you with 9 to remove afterwards;) I have also made it check that the User's post count is not 0, and if it is, it will not run that query...
It should all work:)
Satan
Moreland
06-21-2003, 11:36 AM
Satan thanks alot :) I will do that and let you know what happens
Moreland
06-21-2003, 11:47 AM
Works :D thanks
Chris M
06-22-2003, 03:42 AM
No problemos:)
Satan
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.