<?php
function task_inactivemembers($task)
{
global $db;
// Nicht aktivierte Accounts löschen
$cut = TIME_NOW-604800;
$query = $db->simple_select("users", "uid", "usergroup = '5' AND regdate < {$cut}");
while($users = $db->fetch_array($query)) {
$db->update_query("posts", array('uid' => 0), "uid='{$users['uid']}'");
$db->delete_query("userfields", "ufid='{$users['uid']}'");
$db->delete_query("privatemessages", "uid='{$users['uid']}'");
$db->delete_query("events", "uid='{$users['uid']}'");
$db->delete_query("moderators", "uid='{$users['uid']}'");
$db->delete_query("forumsubscriptions", "uid='{$users['uid']}'");
$db->delete_query("threadsubscriptions", "uid='{$users['uid']}'");
$db->delete_query("sessions", "uid='{$users['uid']}'");
$db->delete_query("banned", "uid='{$users['uid']}'");
$db->delete_query("threadratings", "uid='{$users['uid']}'");
$db->delete_query("users", "uid='{$users['uid']}'");
update_stats(array('numusers' => '-1'));
}
add_task_log($task, "Nicht aktivierte Accounts gelöscht.");
}
?>