$lastpost=$DB_site->query_first("SELECT dateline FROM post WHERE visible=1 AND userid='$user[userid]' ORDER BY dateline DESC LIMIT 1");
if ($lastpost[dateline]>0 AND $lastpost[dateline]>$days)
{
$DB_site->query("UPDATE user SET usergroupid=2 WHERE userid='$user[userid]'");
}
}
?>
Now configure your CRON job to run this file once everyday at any time you like.
Please test this script in a test board first! I dont expect a problem but I don't like giving away scripts like this as they make changes in DB so a bug can create serious problems. I didnt test the script myself.