Файл: php-zona.ru/modules/forum/index.php
Строк: 19
<?php
$title = 'Форум';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
?>
<div class="title">Форум</div>
<?if(isset($user['id'])){?>
<div class="nvgup">Мои: <a href="/forum/my/topic/<?=$user['id']?>">Темы</a> | <a href="/forum/my/post/<?=$user['id']?>">Посты</a></div>
<?}?>
<?
$q = $db->query('SELECT `id`, `name` FROM `forum_kat`');
while($k = $q->fetch_assoc()){
?>
<div class="title"><a href="/forum/kat/<?=$k['id']?>"><?=$k['name']?></a>
<?if($user['level']>=3){?>
<a href="/admin/forum/edit_kat/<?=$k['id']?>">[Изм.]</a> <a href="/admin/forum/del_kat/<?=$k['id']?>">[Уд.]</a>
<?}?>
</div>
<?
$qw = $db->query("SELECT `id`, `name` FROM `forum_pkat` WHERE `kat`='".$k['id']."'");
while($pk = $qw->fetch_assoc()){
?>
<div class="section"><a href="/forum/pkat/<?=$pk['id']?>"><?=$pk['name']?></a>
<?if($user['level']>=3){?>
<a href="/admin/forum/edit_pkat/<?=$pk['id']?>">[Изм.]</a> <a href="/admin/forum/del_pkat/<?=$pk['id']?>">[Уд.]</a>
<?}?>
</div>
<?
}
}
?>
<?
if($user['level']>=3){
?>
<div class="nvg"><a href="/admin/forum/new_section">Создать раздел</a></div>
<?
}
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>