Quote:
Originally Posted by Andreas
That is easy
PHP Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($DB_site))
{
exit;
}
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE usergroupid = 677 AND lastactivity < " . (TIMENOW-X*86400));
log_cron_action('Inactive VIP Users reset to Registered', $nextitem);
?>
Replace X with the number of days, save this a a php-file in includes/cron, create a cron-job for it (to be run once/day for example) and you're done.
|
If I wanted to run this against multiple usergroups (say group 123, 5 and 6), would I be correct in adjusting the syntax of the code to something along the lines of :
user SET usergroupid = 2 WHERE usergroupid = 677
OR 123 OR 5 OR 6 AND lastactivity....