Файл: modules/forum/pkat.php
Строк: 27
<?php
$title = 'Просмотр подраздела';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
$_GET['id'] = abs(intval($_GET['id']));
if($db->query("SELECT `id` FROM `forum_pkat` WHERE `id`='".$_GET['id']."'")==0){
error('Подраздела не существует!');
}
$pr = $db->query("SELECT `id`, `name`, `kat` FROM `forum_pkat` WHERE `id`='".$_GET['id']."'")->fetch_assoc();
$r = $db->query("SELECT `id`, `name` FROM `forum_kat` WHERE `id`='".$pr['kat']."'")->fetch_assoc();
?>
<div class="title"><a href="/forum">Форум</a> | <a href="/forum/kat/<?=$r['id']?>"><?=htmlspecialchars($r['name'])?></a> | <?=htmlspecialchars($pr['name'])?></div>
<?
$nav=new navig("SELECT * FROM `forum_topic` WHERE `pkat`='".$_GET['id']."'");
$q = $db->query("SELECT * FROM `forum_topic` WHERE `pkat`='".$_GET['id']."' ORDER BY `id` DESC LIMIT ".$nav->start.", ".$nav->nstr);
while($t = $q->fetch_assoc()){
?>
<div class="section"><a href="/forum/topic/<?=$t['id']?>"><?=htmlspecialchars($t['name'])?></a></div>
<?
}
?>
<div class="nvgstr">
<?
$nav->panel();
?>
</div>
<?if(isset($user['id'])){?>
<div class="section1"><a href="/forum/new_topic/<?=$_GET['id']?>">Создать тему</a></div>
<?}?>
<?
if($user['level']>=3){
?>
<div class="section1"><a href="/admin/forum/edit_pkat/<?=$_GET['id']?>">Изменить подраздел</a></div>
<div class="section1"><a href="/admin/forum/del_kat/<?=$_GET['id']?>">Удалить подраздел</a></div>
<?
}
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>