Файл: forum/index.php
Строк: 67
<?
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
$diz -> head('Форумы');
$diz -> title('Форум');
//Бан на форуме
$ban = $db -> query("SELECT * FROM `ban` WHERE `iduser` = '".$ya['id']."' and `serius` = 'forum' LIMIT 1");
if ($ban -> num_rows > 0) {
header('location: '.ROOT.'ban.php?mode=forum');
}
if ($aut == true) {
?>
<script type='text/javascript' language='JavaScript'>
function spoiler(el) {
var spoiler = document.getElementById('spoiler' + el);
if (spoiler.style.display == 'none') {
spoiler.style.display = 'block';
f1.style.display = 'none';
f2.style.display = 'block';
}else{
spoiler.style.display = 'none';
f1.style.display = 'block';
f2.style.display = 'none';
}
}
</script>
<div class="levo" id="f1"><a href="javascript:spoiler(1)" class="levo_tuch">Отобразить форумное меню</a></div>
<div class="levo" id="f2" style="display: none;"><a href="javascript:spoiler(1)" class="levo_tuch">Скрыть форумное меню</a></div>
<div id="spoiler1" style="display: none">
<?
if($ya['level']==7)echo '<div class="menu"><a href="admin.php" class="menutuch">Админка</a></div>';
echo '<div class="menu"><a href="my_tems.php?id='.$ya['id'].'" class="menutuch">Мои темы</a></div>
<div class="menu"><a href="my_posts.php?id='.$ya['id'].'" class="menutuch">Мои посты</a></div>
<div class="menu"><a href="new_tems.php" class="menutuch">Новые темы</a></div>
<div class="menu"><a href="new_posts.php" class="menutuch">Новые посты</a></div>
<div class="menu"><a href="search.php" class="menutuch">Поиск по форуму</a></div>';
?>
<div class="end">Список форумов:</div>
</div>
<?
}
$for = $db -> query("SELECT `id`,`name`,`info` FROM `forums` ORDER BY `sid` ASC");
if ($for -> num_rows > 0) {
while ($assoc = $for -> fetch_assoc()) {
$razd = $db -> query("SELECT `id` FROM `forum_razdel` WHERE `forum` = '".$assoc['id']."'");
$gid = 0; $themes = 0; $m = 0; $my_post = 0;
while ($them = $razd -> fetch_row()) {
$gid = $db -> dbcount('COUNT(`id`)','forum_tems'," `razdel` = '".$them[0]."'");
$themes += $gid;
}
$razd = $db -> query("SELECT * FROM `forum_razdel` WHERE `forum` = '".$assoc['id']."' ORDER BY `sid` ASC");
while($raz = $razd -> fetch_assoc()){
$my_post = $db -> dbcount('COUNT(`id`)','`forum_posts`',"`razdel` = '".$raz['id']."'");
$m += $my_post;
}
echo '<div class="b_title"><a href="forum.php?id='.$assoc['id'].'">'.$diz -> img('f.png').' '.$assoc['name'].' <span class="count"/>'.$themes.'/'.$m.'</span><br/>
<small>'.$assoc['info'].'</small></a></div>';
$razd = $db -> query("SELECT * FROM `forum_razdel` WHERE `forum` = '".$assoc['id']."' ORDER BY `sid` ASC");
while($raz = $razd -> fetch_assoc()){
$t = $db -> dbcount('COUNT(*)','forum_tems','`razdel` = '.$raz['id'].'');
$p = $db -> dbcount('COUNT(*)','forum_posts','`razdel` = '.$raz['id'].'');
echo '<div class="menu"><a href="razdel.php?id='.$raz['id'].'" class="menutuch">'.$diz -> img('r.png').' '.$raz['name'].' <span class="count"/>'.$t.'/'.$p.'</span></a></div>';
}
}
} else {
echo '<div class="fon">Нет созданных форумов</div>';
}
echo '<div class="levo"><a href="/index.php" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
?>