Hi Dark!
Maybe this is better, just add this to credits_daily.php ?
$twoyearsago = time() - 63072000;
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = 0 WHERE lastactivity < $twoyearsago");
and also, this:
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits_canearn = 0 WHERE lastactivity < $twoyearsago");
So, the first query zeros out all the old credits of users inactive for more than two years, the second query turns off all credit earnings for the same group.
However, I need to turn credits_canearn back on when a user become active again, something like:
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits_canearn = 1 WHERE lastactivity > $twoyearsago");
Thoughts?
|