Файл: modules/mail/newspaper/index.php
Строк: 27
<?php
$title = 'Газета';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
?>
<div class="title">Новые статьи</div>
<?
$query = $db->query("SELECT `id`, `name` FROM `newspaper_article` ORDER BY `id` DESC LIMIT 5");
while ($a = $query->fetch_assoc()) {
?>
<div class="section">
<a href="/newspaper/article/<?=$a['id']?>"><?=htmlspecialchars($a['name'])?></a>
</div>
<?
}
?>
<div class="title">Категории</div>
<?
$query = $db->query("SELECT * FROM `newspaper_section`");
while ($s = $query->fetch_assoc()) {
?>
<div class="section">
<a href="/newspaper/section/<?=abs(intval($s['id']))?>"><?=output($s['name'])?></a> <a href="/newspaper/section/<?=abs(intval($s['id']))?>/del/">[Уд.]</a> <a href="/newspaper/section/<?=abs(intval($s['id']))?>/edit">[Ред.]</a>
</div>
<?
}
?>
<?
if($user['level']>=1){
?>
<div class="nvg">
<a href="/newspaper/new_section">Создать раздел</a>
</div>
<?
}
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>