It's just a more competitive system of reputation to prevent people from stacking up huge amounts of reputation and then logging off for months and still holding the most reputation. For example, say on day 1 they get 5 rep. Day 2, they get 5 rep. At day 7, they are left with 5 rep total instead of 10. It's to make reputation more competitive. The users try to get as much reputation as they can day by day instead of overall.
Quote:
Originally Posted by kh99
I haven't tried this, I'm just taking a stab at it by looking at the code that adds reputation, but maybe something like this: Before you delete the reputation or set it to 0,
PHP Code:
$reps = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "reputation WHERE dateline < $cutoff"); while ($rep = $db->fetch_array($reps)) { $userinfo = fetch_userinfo($rep['userid']); $userinfo['reputation'] -= $rep['reputation'];
// Determine this user's reputationlevelid. $reputationlevel = $db->query_first_slave(" SELECT reputationlevelid FROM " . TABLE_PREFIX . "reputationlevel WHERE $userinfo[reputation] >= minimumreputation ORDER BY minimumreputation DESC LIMIT 1 ");
// init user data manager $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT); $userdata->set_existing($userinfo); $userdata->set('reputation', $userinfo['reputation']); $userdata->set('reputationlevelid', intval($reputationlevel['reputationlevelid']));
$userdata->pre_save(); if (empty($userdata->errors)) $userdata->save(); }
|
Would this update the reputation? I already have code that sets reputation to 0 after the cut off. It just doesn't reflect the changes on the website after it runs.