File size: 1.54Kb
<?php
###################################################
# Скрипт портфолио #
# Версия системы: 1.0 #
# Автор: RonsoN #
# ICQ: 7-191-321 #
# Email: [email protected] #
###################################################
$id_news = int($_GET['id_news']);
if ($db->query("SELECT * FROM `news` WHERE `id` = '". $id_news ."' LIMIT 1")->rowCount() == 0) {
header('Location: /');
exit();
}
if(empty($_COOKIE[$id_news])) { $db->query("UPDATE `news` SET `look` = `look` + 1 WHERE `id` = '".$id_news."' "); }
setcookie($id_news, 1, time() + 259200);
$news = $db->query("SELECT * FROM `news` WHERE `id` = '". $id_news ."' LIMIT 1")->fetch();
$system['page_title'] = 'Новости | '.$news['title'];
require_once(HOME.'/system/header.php');
echo '<div class="menu">'.NEWS.''.$news['title'].'</div>
<div class="main">
'.out($news['text']).'
</div>
<div class="main">
Прочитано раз: '.$news['look'].'<br/>
Дата добавления: '.vtime($news['date']).'<br/>
</div>';
if (isset($user)) {
echo '<div class="navi">
'.NAVI.'<a href="/news/inc/edit/'.$news['id'].'.xhtml">Изменить</a><br/>
'.NAVI.'<a href="/news/inc/delete/'.$news['id'].'.xhtml">Удалить</a><br/>
</div>';
}
echo '
<div class="navi">
'.NEWS.'<a href="/news/">К новостям</a><br/>
'.INDEX.'<a href="/">Главная</a>
</div>';
require_once(HOME.'/system/footer.php');
?>