|
<?php
/*
#Бесплатный WAP движок StrongCMS
#Официальный сайт поддержки: http://strongcms.ru
*/
$title = 'Форум';
require ('../system/core.php');
if ($settings['forum'] == 1)
{
require ('../system/head.php');
login();
}
$switch = array(
'del_kat',
'del_razdel',
'delfile',
'kat',
'move',
'move_tem',
'my_post',
'my_tem',
'my_zakl',
'new_post',
'new_tem',
'nk',
'nr',
'nt',
'post_citata',
'post_del',
'post_otvet',
'post_red',
'razdel',
'red_kat',
'red_razdel',
'stat',
'tema',
'tema_close',
'tema_del',
'tema_top',
'who_forum',
'who_tema',
'zaklad',
'red_tem',
'visited');
if ($act && ($f = array_search($act, $switch)) !== FALSE && file_exists('switch/'.$switch[$f].'.php'))
{
require ('switch/'.$switch[$f].'.php');
} else
{
##шапка
require ('../system/head.php');
echo '<div class="title">'.$title.'</div>';
require ('menu.php');
$forum_r = $db->query("SELECT * FROM `forum_razdel` ORDER BY `id` ASC");
while ($a = $db->fetch_assoc($forum_r))
{
$c_kat = $db->super_query('select count(id) as count from `forum_kat` where `razdel` = "'.$a['id'].'"');
$c_tem = $db->super_query('select count(id) as count from `forum_tema` where `razdel` = "'.$a['id'].'"');
$c_post = $db->super_query('select count(id) as count from `forum_post` where `razdel` = "'.$a['id'].'"');
echo '<div class="podmenu">
<img src="'.HOME.'/images/category.png">
<a href="'.HOME.'/forum/razdel'.$a['id'].'">'.$a['name'].'</a> ['.$c_kat['count'].'/'.$c_tem['count'].'/'.$c_post['count'].']';
if ($user['level'] >= 3)
echo ' [<a href="'.HOME.'/forum/del_razdel'.$a['id'].'">уд</a>|<a href="'.HOME.'/forum/red_razdel'.$a['id'].'">ред</a>]';
echo '
'.smile(bb($a['opis'])).'</div>';
if ($settings['forum_all'] == 1)
{
$forum_k = $db->query("SELECT * FROM `forum_kat` WHERE `razdel` = '".$a['id']."' ORDER BY `id` ASC");
while ($k = $db->fetch_assoc($forum_k))
{
$c_tem = $db->super_query('select count(id) as count from `forum_tema` where `kat` = "'.$k['id'].'"');
$c_post = $db->super_query('select count(id) as count from `forum_post` where `kat` = "'.$k['id'].'"');
echo '<a href="'.HOME.'/forum/kat'.$k['id'].'" class="menudiv"><img src="'.HOME.'/design/theme/'.$styling.'/menu/f_razdel.png" /> '.$k['name'].' <span class="counts_right"><b>'.$c_tem['count'].'|'.$c_post['count'].'</b></span></a>';
}
}
}
$count = $db->super_query("SELECT COUNT(*) as cnt FROM `forum_razdel`");
if ($count['cnt'] < 1)
echo msg('Разделов пока что нет!');
require ('footers.php');
if ($user['level'] >= 3)
echo '<a href="'.HOME.'/forum/nr" class="menudiv"><img src="'.HOME.'/images/add.png" alt="*" /> Новый раздел</a>';
}
##ноги
require_once ('../system/footer.php');
?>