Файл: vkollektive2014/soo/inc/new_t.php
Строк: 38
<?
$title=$title.''.$soo['name'].' - Форум - '.$forum['name'].' - '.@$razdel['name'].' - Новая тема'; // заголовок страницы
include_once '../head.php';
if (isset($_POST['name']) && isset($_POST['msg']))
{
$time=time()-7200;
if (isset($_SESSION['time_c_t_forum']) && $_SESSION['time_c_t_forum']>$time-600 && $u['id']!=$soo['admid'] )$err='Нельзя так часто создавать темы';
$name=check(htmlspecialchars($_POST['name'], ENT_QUOTES));
$msg=check(htmlspecialchars($_POST['msg'], ENT_QUOTES));
$_SESSION['time_c_t_forum']=$time;
mysql_query("INSERT INTO `soo_forum_thems` (`id_forum`, `id_soo`, `time_create`, `id_user`, `name`, `text`, `time`) values('$forum[id]', '$soo[id]', '$time', '$u[id]', '$name', '$msg', '$time')");
$them['id']=mysql_insert_id();
$q = mysql_query("SELECT * FROM `frends` WHERE `user` = '$u[id]' AND `lenta_forum` = '1' AND `i` = '1'");
while ($f = mysql_fetch_array($q))
{
$a = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$f[frend]' LIMIT 1"));
}
header("Location: ?s=$soo[id]&id_forum=$forum[id]&id_them=$them[id]");exit;
include_once '../foot.php';
}
echo "<div class='div'><form method="post" action="?s=$soo[id]&id_forum=$forum[id]&act=new">";
echo "Название темы:<br />n";
echo "<input name="name" type="text" maxlength='32' value='' /><br />n";
echo "Сообщение:<br />n";
echo "<textarea name="msg"></textarea><br />n";
echo "<input value="Создать" type="submit" /><br />n";
echo "</form></div>n";
echo "<div class="div">n";
echo "- <a href="?s=$soo[id]&id_forum=$forum[id]" title='Вернуться к списку тем'>Назад</a><br />n";
echo "- <a href="forum.php?s=$soo[id]">Форум</a><br />n";
echo "- <a href="index.php?s=$soo[id]">В сообщество</a><br />n";
echo "</div>n";
?>