Quote:
Originally Posted by imported_silkroad
Hi Dark!
We need to stop giving credits to users without activity for the past two years. Where would we add some PHP code like this:
Code:
// 60 * 60 * 24 * 365 * 2 = 63072000
$twoyearsago = time() - 63072000;
if ($userinfo[lastactivity] < $twoyearsago )
{
exit;
}
Or the same code in the template somewhere?
Code:
<if condition="$userinfo[lastactivity] < (TIMENOW - 63072000)">
User has not logged in for 30 days exit or something
</if>
Where should we do it?
Thanks!!
|
the easy way is to move those users into a usergroup that doesnt earn credits for anything
or you can add that check to the includes/functions_credits.php award_credits function, and then the includes/cron/credits_daily.php file to change this query
PHP Code:
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = credits + CASE$pcsql ELSE 0 END WHERE credits_canearn = 1");
to include the date range