Вход Регистрация
Файл: backup/plugin/editposts.php
Строк: 28
<?
require_once('../core/start.php');
if(!isset(
$user['id'])){
header('location:/');
exit;
}
$id abs(intval($_GET['id']));
$them core::$dbs->queryFetch("SELECT * FROM `forum_theme` where `id` = ? limit 1",array($id));
if(
$them['type']==or empty($them['name'])){
header('location:/');
exit();
}
$raz $them['id_r'];
$praz $them['id_pr'];
$ank core::$dbs->queryFetch("SELECT * FROM `users` WHERE `id` = ? LIMIT 1",array($them['user_id']));
if(empty(
$ank['id'])){
header('location:/');
exit();
}
if((
$user_id!=$them['user_id'])&&($level<1)&&(func::user_inf($level<$them[user_id],'level'))){
header('location:/plugin/topic/'.$id);
exit();
}
$title 'Изменить сообщение';
require_once(
root.'core/header.php');
echo 
'<div class="wizart">Изменить сообщение</div>';
func::head_menu();
if(isset(
$_POST['submit'])){
$msg func::check($_POST['msg']);
if(empty(
$msg)){
$err ='Введите текст сообщения!';}
if(
strlen($msg)<3){
$err .='Слишком короткое сообщение. Минимум 3 символа.';}
if(!isset(
$err)){
core::$dbs->query("UPDATE `forum_theme` SET
`text` = ?, `who_edit` = ?, `time_edit` = ?, `kol` = `kol` + ? WHERE `id` = ? LIMIT 1"
,array($msg,$user_id,time(),1,$id));
header('location: /plugin/topic/'.$them['id']);
exit();
} else {
echo 
'<div class="err">'.$err.'</div>';
}
}
echo 
'<form method="POST" action="/plugin/editposts/'.$id.'">Сообщение:<br/><textarea name="msg">'.$post['text'].'</textarea><br /><input type="submit" name="submit" value="Отправить"></form></div>';
func::footer_menu();
require_once(
root.'core/footer.php');
?>
Онлайн: 1
Реклама