Файл: core/forum/index.php
Строк: 52
<?
include_once '../core/system.php';
echo only_reg();
echo ban();
$header = 'Форум';
include_once '../core/head.php';
if (isset($user) && isset($_GET['jurnal_read']))
{
mysql_query("update `user` set `jurnal_read` = '0' where `id` = '$user[id]' limit 1");
$_SESSION['message'] = "Заметка успешно скрыта"; // Оповещаем
header("Location: /?");
exit;
}
global $user;
if(isset($user['id'])){
$q = mysql_query("SELECT * FROM `jurnal` ORDER BY `id` DESC LIMIT 1");
$news = mysql_fetch_assoc($q);
if ($user[jurnal_read] == 1){
echo "<div class='block_zero center'><img src='/images/icon/2hit.png' alt=''/><b><font color=#00FF7F>$news[title]</font></b><img src='/images/icon/2hit.png' alt=''/><br /><br /><a class='btn' href='/jurnal/post/$news[id]/'><span class='end'><span class='label'>Читать Заметку</span></span></a><br /><a class='grey' href='?jurnal_read'>Скрыть</a></div><br/ >";
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_razdel`"),0);
$q = mysql_query("SELECT * FROM `forum_razdel` ORDER BY `id` ASC");
if($k_post == 0)echo "<div class='player grey'>Разделов нет!</div><div class='mini-line'></div>";
echo "<div class='player menuList'>";
while($post = mysql_fetch_assoc($q)) {
echo "<li><a href='/forum/post/$post[id]/'><img src='/images/icon/section.png'>$post[name]</a></li>";
echo "<div class='dot-line'></div>";
}
echo "</div>";
echo "<div class='player menuList'>";
echo "<li><a href='/jurnal/'><img src='/images/icon/arrow.png'>Все заметки</a></li>";
echo "</div>";
if($user[prava] == 5){
echo "<div class='player menuList'>";
echo "<li><a href='new_razdel.php'><img src='/images/icon/arrow.png'>Создать Раздел</a></li>";
echo "</div>";
}
if($user[prava] == 245345){
echo "<div class='player menuList'>";
echo "<li><a href='new_razdel.php'><img src='/images/icon/arrow.png'>Создать Раздел</a></li>";
echo "</div>";
}
}
include_once '../core/foot.php';
?>