Файл: us_guest/inc/act.clean.php
Строк: 116
<?
$ank = get_user(intval(@$_GET['user_id']));
if (!@$ank['id']) {
$set['title'] = 'Ошибка!';
include('../sys/inc/thead.php');
title();
aut();
$err[] = 'Пользователь не найден';
err();
?>
<div class="foot">
<img src="/us_guest/images/back.png" alt="Назад"> <a href="/">Назад</a><br />
</div>
<?
include('../sys/inc/tfoot.php');
exit();
}
if ($user['id'] != $ank['id'] && $user['group_access'] < 7) {
$set['title'] = 'Ошибка!';
include('../sys/inc/thead.php');
title();
aut();
$err[] = 'Доступ закрыт';
err();
?>
<div class="foot">
<img src="/us_guest/images/back.png" alt="Назад"> <a href="/">Назад</a><br />
</div>
<?
include('../sys/inc/tfoot.php');
exit();
}
$set['title'] = ' '.$ank['nick'];
include('../sys/inc/thead.php');
title();
aut();
if (isset($_GET['all'])) {
if (isset($_POST['submited']) && isset($_POST['mdp']) && $_POST['mdp'] == $mdp) {
$q = mysql_query("SELECT * FROM `us_guest_comms` WHERE `id_user_adm` = '$ank[id]'");
while ($comment = mysql_fetch_array($q)) {
mysql_query("DELETE FROM `us_guest_comms` WHERE `id` = '$comment[id]'");
$select_files = mysql_query("SELECT * FROM `us_guest_files` WHERE `id_comment` = '$comment[id]' AND `id_user_adm` = '$ank[id]'");
while ($file = mysql_fetch_array($select_files)) {
mysql_query("DELETE FROM `us_guest_files` WHERE `id` = '$file[id]'");
if (is_file(H."us_guest/files/$file[id].dat"))unlink(H."us_guest/files/$file[id].dat");
if (is_file(H."us_guest/screens/user_$ank[id]_file_$file[id]_small.png"))unlink(H."us_guest/screens/user_$ank[id]_file_$file[id]_small.png");
if (is_file(H."us_guest/screens/user_$ank[id]_file_$file[id]_big.png"))unlink(H."us_guest/screens/user_$ank[id]_file_$file[id]_big.png");
}
}
header("Location: /us_guest/?user_id=$ank[id]");
exit();
}
?>
<form action="" method="POST">
Вы действительно хотите удалить все сообщения из гостевой?<br />
<input type="hidden" name="mdp" value="<? echo $mdp?>">
<input type="submit" name="submited" value="Да, хочу">
</form>
<div class="foot">
<img src="/us_guest/images/back.png" alt=""> <a href="/us_guest/?user_id=<? echo $ank['id']?>">Отмена</a>
</div>
<?
include('../sys/inc/tfoot.php');
exit();
}
if (isset($_POST['submited']) && isset($_POST['mdp']) && $_POST['mdp'] == $mdp) {
$ch = intval($_POST['ch']);
$mn = intval($_POST['mn']);
$nt = $ch*$mn*3600;
$nt = $time-$nt;
$q = mysql_query("SELECT * FROM `us_guest_comms` WHERE `id_user_adm` = '$ank[id]' AND `time` < '$nt'");
while ($comment = mysql_fetch_array($q)) {
mysql_query("DELETE FROM `us_guest_comms` WHERE `id` = '$comment[id]'");
$select_files = mysql_query("SELECT * FROM `us_guest_files` WHERE `id_comment` = '$comment[id]' AND `id_user_adm` = '$ank[id]'");
while ($file = mysql_fetch_array($select_files)) {
mysql_query("DELETE FROM `us_guest_files` WHERE `id` = '$file[id]'");
if (is_file(H."us_guest/files/$file[id].dat"))unlink(H."us_guest/files/$file[id].dat");
if (is_file(H."us_guest/screens/user_$ank[id]_file_$file[id]_small.png"))unlink(H."us_guest/screens/user_$ank[id]_file_$file[id]_small.png");
if (is_file(H."us_guest/screens/user_$ank[id]_file_$file[id]_big.png"))unlink(H."us_guest/screens/user_$ank[id]_file_$file[id]_big.png");
}
}
header("Location: /us_guest/?user_id=$ank[id]");
exit();
}
?>
<div class="p_m">
<img src="/us_guest/images/delete.png" alt=""> <a href="/us_guest/?act=clean&user_id=<? echo $ank['id']?>&all">Удалить все сообщения</a>
</div>
<form action="" method="POST">
Будут удалены сообшения, написанные ... тому назад:<br />
<input type="text" name="ch" size="3" value="1" />
<select name="mn">
<option value="1" selected="selected">Часов</option>
<option value="24">Дней</option>
<option value="168">Недель</option>
<option value="744">Месяцев</option>
</select><br />
<input type="hidden" name="mdp" value="<? echo $mdp?>">
<input type="submit" name="submited" value="Удалить!">
</form>
<div class="foot">
<img src="/us_guest/images/back.png" alt=""/> <a href="/us_guest/?user_id=<? echo $ank['id']?>">Назад</a>
</div>
<?
include_once '../sys/inc/tfoot.php';
exit();
?>