Файл: core/cuctema/delete_user.php
Строк: 54
<?
$q=mysql_query("SELECT * FROM `user` WHERE `locked_time` < '".(time()-(3600*24*30))."'");
while($ank=mysql_fetch_array($q))
{
mysql_query("DELETE FROM `user` WHERE `id` = '$ank[id]' LIMIT 1");
mysql_query("DELETE FROM `chat_post` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `frends` WHERE `user` = '$ank[id]' OR `frend` = '$ank[id]'");
mysql_query("DELETE FROM `frends_new` WHERE `user` = '$ank[id]' OR `to` = '$ank[id]'");
mysql_query("DELETE FROM `blog_list` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `blog_komm` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `stena` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `stena_like` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `status_like` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `status` WHERE `id_user` = '$ank[id]'");
$q5=mysql_query("SELECT * FROM `forum_t` WHERE `id_user` = '$ank[id]'");
while ($post5 = mysql_fetch_assoc($q5))
{
mysql_query("DELETE FROM `forum_p` WHERE `id_them` = '$post5[id]'");
}
mysql_query("DELETE FROM `forum_t` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `forum_p` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `forum_zakl` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `guest` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `loads_komm` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `news_komm` WHERE `id_user` = '$ank[id]'");
$opdirbase=@opendir(H.'core/cuctema/set/user');
while ($filebase=@readdir($opdirbase))if (preg_match('#.php$#i',$filebase))include_once(H.'core/cuctema/set/user/'.$filebase);
$q5=mysql_query("SELECT * FROM `obmennik_files` WHERE `id_user` = '$ank[id]'");
while ($post5 = mysql_fetch_assoc($q5))
{
unlink(H.'sys/obmen/files/'.$post5['id'].'.dat');
}
mysql_query("DELETE FROM `obmennik_files` WHERE `id_user` = '$ank[id]'");
mysql_query("DELETE FROM `users_konts` WHERE `id_user` = '$ank[id]' OR `id_kont` = '$ank[id]'");
mysql_query("DELETE FROM `mail` WHERE `id_user` = '$ank[id]' OR `id_kont` = '$ank[id]'");
mysql_query("DELETE FROM `user_voice` WHERE `id_user` = '$ank[id]' OR `id_kont` = '$ank[id]'");
mysql_query("DELETE FROM `user_collision` WHERE `id_user` = '$ank[id]' OR `id_user2` = '$ank[id]'");
mysql_query("DELETE FROM `votes_user` WHERE `u_id` = '$ank[id]'");
}
?>