<?php
//-----Создаем титл страницы-----//
$title = 'Газета';
//-----Подключаем функции-----//
require_once ('../system/function.php');
//-----Подключаем вверх-----//
require_once ('../system/header.php');
$id = abs(intval($_GET['id']));
$article = mysql_fetch_assoc(mysql_query("SELECT * FROM `article` WHERE `id` = '".$id."'"));
if(!$article)
{
echo '<div class="menu">Ошибка</div><div class="podmenu"><center><b>Такой публикации не существует!</b></center></div>';
require_once ('../system/footer.php');
exit();
}
$section = mysql_fetch_assoc(mysql_query("SELECT * FROM `category` WHERE `id` = '".$article['id_category']."'"));
$id = abs(intval($_GET['id']));
mysql_query("UPDATE `article` SET `views` = `views`+1 WHERE `id` = '".$id."'");
$author = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$article['us_id']."'"));
echo '<div class="menu">'.$article['title'].'</div>
<div class="podmenu">'.smile(bb(nl2br($article['article']))).'</div>
<div class="podmenu">
Добавил: <a href="/user_'.$article['us_id'].'">'.$author['login'].'</a><br />
Просмотров: '.$article['views'].'<br />
Добавлено: '.vremja($article['date']).'<br />
Категория: <a href="/journal/category.php?id='.$section['id'].'">'.$section['title'].'</a></div>';
if ($user['level']>2)
{
echo '<div class="podmenu">
» <a href="/panel/journal_article.php?act=edit&id='.$article['id'].'">Изменить</a><br />
» <a href="/panel/journal_article.php?act=delete&id='.$article['id'].'">Удалить</a></div>';
}
//-----Подключаем низ-----//
require_once ('../system/footer.php');
?>