Файл: modules/mail/newspaper/section.php
Строк: 41
<?php
$title = 'Просмотр категории';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
$_GET['id'] = abs(intval($_GET['id']));
if($db->query("SELECT `id` FROM `newspaper_section` WHERE `id`='".$_GET['id']."'")->num_rows==0){
error('Категории не существует.');
}
$section = $db->query("SELECT * FROM `newspaper_section` WHERE `id`=".$_GET['id']."")->fetch_assoc();
?>
<div class="title">
<a href="/newspaper">Газета</a> | <?=output($section['name'])?>
</div>
<?
$nav=new navig("SELECT * FROM `newspaper_article` WHERE `section`='".$_GET['id']."'");
$q = $db->query("SELECT * FROM `newspaper_article` WHERE `section`='".$_GET['id']."' ORDER BY `id` DESC LIMIT ".$nav->start.", ".$nav->nstr);
while($n = $q->fetch_assoc()){
?>
<div class="textq">
<a href="/newspaper/article/<?=$n['id']?>"><?=htmlspecialchars($n['name'])?></a>
</div>
<?
}
?>
<div class="nvgstr">
<?
$nav->panel();
?>
</div>
<?
if($db->query("SELECT `id` FROM `newspaper_article` WHERE `section`='".$_GET['id']."'")->num_rows==0){
?>
<div class="error">Новостей в данном разделе пока нет</div>
<?
}
if($user['journalist']==1){
?>
<div class="nvg">
<a href="/newspaper/new_article/<?=$section['id']?>">Добавить статью</a>
</div>
<?
}
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>