Файл: modules/mail/newspaper/article.php
Строк: 32
<?php
$title = 'Просмотр статьи';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
$_GET['id'] = abs(intval($_GET['id']));
if($db->query("SELECT `id` FROM `newspaper_article` WHERE `id`='".$_GET['id']."'")->num_rows==0){
error('Статьи не сущесвует.');
}
$article = $db->query("SELECT * FROM `newspaper_article` WHERE `id`=".$_GET['id']."")->fetch_assoc();
$section = $db->query("SELECT * FROM `newspaper_section` WHERE `id`=".$article['section']."")->fetch_assoc();
?>
<div class="title">
<a href="/newspaper">Газета</a>
|
<a href="/newspaper/section/<?=$section['id']?>"><?=htmlspecialchars($section['name'])?></a>
|
<?=htmlspecialchars($article['name'])?>
</div>
<div class="text">
<?if($user['journalist']==1 or $user['level']>=1){?>
<a href="/newspaper/edit_article/<?=$_GET['id']?>">Редактировать</a> | <a href="/newspaper/del_article/<?=$_GET['id']?>">Удалить</a><br/>
<?}?>
<b><?=output($article['name'])?></b>
<img src="/files/newspaper/images/<?=$article['img']?>" style="max-width:100%; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; border-top-right-radius: 20px; border-top-left-radius: 20px;">
<p><?=output($article['content'])?></p>
</div>
<div class="section1">
<b>Просмотров:</b> <?=$article['views']?><br/>
<b>Дата публикации:</b> <?=times($article['time'])?><br/>
<b>Добавил:</b> <?=nick($article['id_us'])?><br/>
<a href="/newspaper/comm/<?=$_GET['id']?>">Комментарии</a> [<?=$db->query("SELECT `id` FROM `newspaper_comm` WHERE `id_article`='".$_GET['id']."'")->num_rows?>]
</div>
<?
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>