View file masteru.site/forum/jal.php

File size: 1.81Kb
<?php
include_once ('../system/function.php');

$id = abs(intval($_GET['id']));
$forum_t2 = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_post` WHERE `id` = '".$id."'"));


$title='Жалоба на пост #'.$id.'';

include_once ('../system/header.php');

if($forum_t2 == 0) {
echo '<div class="title">Форум | Ошибка</div><div class="podmenu"><center><b>Такой темы не существует!</b></center></div>';
include_once ('../system/footer.php');
exit();
}

if(isset($_REQUEST['submit'])) {

$text = strong($_POST['text']);

if(empty($text)) {
echo '<div class="podmenu"><center><b>Введите текст сообщения!</b></center></div>';
include_once ('../system/footer.php');
exit();
}
if(mb_strlen($text,'UTF-8') < 3) {
echo '<div class="podmenu"><center><b>Минимум для ввода 3 символа!</b></center></div>';
include_once ('../system/footer.php');
exit();
}
mysql_query("INSERT INTO `post_jal` SET `text` = '".$text."',`kto` = '".$user['id']."',`time` = '".time()."', `post` = '".$id."', `tema` = '".$forum_t2['tema']."'");
header('Location: /forum/tema'.$forum_t2['tema'].'');
exit();
}
echo '<div class="title">'.$title.'</div><div class="podmenu">Текст: ';

if(!$forum_t2['citata'] == NULL) echo 'Цитата:<br /><div class="cit">'.nick($forum_t2['citata_us']).': '.nl2br(smile(bb($forum_t2['citata']))).'</div>';

echo ''.nl2br(smile(bb($forum_t2['text']))).'</div>';
echo '
<div class="podmenu">

<form action="" name="message" method="POST">
Текст жалобы:<br />';
if($user['bb_panel'] == 1) 
{
  
}
echo '<textarea rows="'.$user['rows'].'" cols="'.$user['cols'].'" placeholder="Текст сообщения..." name="text"></textarea><br />
<input type="submit" name="submit" value="Отправить" />
</form></div>';
include_once ('../system/footer.php');
?>