Вход Регистрация
Файл: api_forum/edit_post.php
Строк: 31
<?
////////////////////////////////////////
///// Kyber ApiCMS 2013 apicms.ru //////
///// Запрещается продажа данной CMS ///
///// Автор Евгений Медянкин Kyber /////
///// ICQ 626-000-895 или 37-22-47 /////
////////////////////////////////////////

$title 'Редактирование сообщения';
require_once 
'../api_core/apicms_system.php';
require_once 
'../design/styles/'.htmlspecialchars($api_design).'/head.php';
/////////////////////////////////////////
$postes intval($_GET['post']);
$theme_id intval($_GET['id']);
$subuser mysql_fetch_array(mysql_query("SELECT * FROM `api_forum_post` WHERE `id` = '$postes' LIMIT 1"));
/////////////////////////////////////////
if (isset($_GET['post']) && ($user['id'] == $subuser['id_user'] or $user['level']==or $user['level']==2) && mysql_result(mysql_query("SELECT COUNT(*) FROM `api_forum_post` WHERE `id` = '$postes'"),0)==1){
/////////////////////////////////////////
if (isset($_POST['txt'])){
$text apicms_filter($_POST['txt']);
if (
strlen($text)>1024)$err '<div class="content"><center>Очень длинное сообщение</center></div>';
if (
strlen($text)<3)$err '<div class="content"><center>Короткое сообщение</center></div>';
/////////////////////////////////////////
if (!isset($err)){
mysql_query("UPDATE `api_forum_post` SET `text` = '$text', `edit` = '1', `edit_time` = '$time' WHERE `id` = '$postes' LIMIT 1");
header("Location: theme.php?id=".$theme_id."&page=end");
}else{
apicms_error($err);
}
}
/////////////////////////////////////////
echo "<form action='edit_post.php?id=".$theme_id."&post=".$postes."&ok' method="post">n";
echo 
"<div class='apicms_dialog'><center><textarea name='txt'>".htmlspecialchars($subuser['text'])."</textarea><br />n";
echo 
"<input type='submit' value='Изменить сообщение'/></form></center></div>n";
////////////////////////////////////////
}else{
echo 
"<div class='erors'>Ошибка редактирования</div>n";
}
require_once 
'../design/styles/'.htmlspecialchars($api_design).'/footer.php';
?>
Онлайн: 1
Реклама