Файл: sys/info/complaint_profile.php
Строк: 47
<?php
if ($user['id'] != $ank['id'] and $ank['group_access'] == 0 and $user['group_access'] == 0 and isset($user)) {
if (!isset($_GET['Block_profile'])) {
echo "<span class='ank_span' style='float:right'>";
echo "<a href='/$ank[mylink]&Block_profile'> ".lang('Жалоба на страницу')."</a><br />";
echo "</span>";
}
//блокировка статуса
if (isset($_POST['Block_profile'])) {
$msg = lang('Новая жалоба на пользователя').' [url=/'.$ank['mylink'].']'. nick($ank['id'], null, 0) .'[/url]
';
$msg .= '
--------
'.my_esc($_POST['prich']).'
--------
';
$msg .= lang('Жалоба подана от').' : [url=/'.$user['mylink'].']'. nick($user['id'], null, 0) .'[/url] ';
$c_v = strlen2($msg);
if ($c_v < 100) {
$_SESSION['message'] = lang('Нужно указать причину подробнее');
exit(header("Location: /".$ank['mylink'].'?Block_profile'));
}
if ($c_v > 5000) {
$_SESSION['message'] = lang('Причина слишком большая');
exit(header("Location: /".$ank['mylink'].'?Block_profile'));
}
query("INSERT INTO `jurnal_system` (`time` ,`type` ,`read` ,`id_user`,`msg`,`id_kont`)
VALUES ( '".time()."', 'spam_profile', '0', '".$ank['id']."','". $msg ."','0');");
$_SESSION['message'] = lang('Успешно');
//Удаляем кэш
cache_delete::user($ank['id']);
exit(header('Location: ?'));
}
//Форма блокировки
if (isset($_GET['Block_profile'])) {
echo "<div class='p_m'><form action='' method='post'>";
echo lang('Причина')." <textarea name='prich' class='form_a'></textarea>";
echo "<input class='form_a_bottom' name='Block_profile' type='submit' value='".lang('Отправить')."' /> <a href='/".$ank['mylink']."'>".lang('Отмена')."</a>";
echo "</form></div>";
}
}