<?
/*
=============================================
 Движок:  SHCMS Engine
=============================================
 Название файла: Форум
=============================================
 Official website: http://shcms.ru
=============================================
 Данный код защищен авторскими правами
=============================================
*/
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
$shcmsengine['title'] = 'Форум';
include_once'../template/head.php';
    $allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM forum_cat"),0);
    $newlist = new Navigation($allfield,   10,  true);   
						  
						  
    $forums = mysql_query("SELECT * FROM `forum_cat`  ORDER BY `id` DESC ". $newlist->limit()."");
    $forum = mysql_fetch_array($forums);
        echo '<div class="posts"><img src="../template/icon/search.png"/> <a href="search.php">Поиск темы</a></div>';
        echo '<div class="posts"><img src="icon/icon_them/them.png"/> <a href="new.themes.php">Новые публикации </a></div>';
		if(isset($user_id))
		{
            echo '<div class="posts"><img src="../template/icon/stat_forum.png"/> <a href="stat.php">Моя статистика </a></div>';
		}
        if($forum == null){
    echo '<div class="posts">Нет категорий</div>';
        }
         else
         {
    do
    {
    echo '<div class="maintitle">';
    echo '<img src="/forum/icon/icon_cat/'.$forum['icon'].'"/> <a href="razd.php?id='.$forum['id'].'">'.$forum['name'].'</a></div>';

	    if($forum['message']){
    echo '<div class="maintext">'.$forum['message'].'</div>';
        }
    }

	  while($forum = mysql_fetch_array($forums));
    echo '<div class="pages">';
    echo $newlist->pagination();
    echo '</div>';
         }
		 
        if($user4['team'] == 6){
    echo '<div class="user_foot">Навигация</div>';
    echo '<div class="posts"><a href="new.cat.php">Создать категорию</a></div>';
	    }

	include_once'../template/foot.php';

?>