<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
$show_all=true;//гости видят главную при закрытом сайте
include_once 'sys/inc/user.php';


include_once 'sys/inc/thead.php';

echo "<div class='logo'>";
echo "<img src='/style/themes/$set[set_them]/logo.png' alt='' />";
echo "</div>\n";

echo "<div class='title'>";
echo "<a href='/online.php'>Онлайн: ".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > ".(time()-1500).""), 0)."</a> \n";

echo "(+ <a href='/online_g.php'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > ".(time()-1500)." AND `pereh` > '0'"), 0)." гостей</a>)\n";

echo "</div>\n";
err();



aut();

if (!$set['web'])
if(isset($user))
{
}else{
echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/vopr16.gif' alt='' class='icon'/>\n";
echo "<a href='/info/maxmob.php'>Первый раз на Xhata.Su?</a>\n";
echo '</a><br />';
}
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/news16.gif' alt='' class='icon'/>\n";
echo "<a href='/news/'>Новости</a>\n";
echo ' ';
@include H.'news/gcount.php';
echo '</a><br />';
echo "</div>\n";

if(isset($user)){
echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/foto.gif' alt='' class='icon'/>\n";
echo '<a href="/foto_konkurs/">Фотоконкурс</a>';
$fot=mysql_fetch_array(mysql_query("SELECT * FROM `foto_conf`"));
if ($fot['closed']==0)
{
echo ' <font color="#afb0a3">(';
@include H.'foto_konkurs/count.php';
echo ')</font></a>';
echo "</div>\n";
}
$fot=mysql_fetch_array(mysql_query("SELECT * FROM `foto_conf`"));
if ($fot['closed']==1)
{
echo "";
echo '</font></a>';
}}
echo "</div>\n";

echo "<div class='gmenu'>\n";
$currD=date("d", time());
$currm=date("m", time());
$k_birsday=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm'",$db), 0);
echo "<img src='/style/icons/list_bday.gif' alt='' class='icon'/>\n";
echo "<a href='/list_bday.php'>Именниники</a> ($k_birsday)\n";
echo "</div>\n";

include_once 'sys/inc/news_main.php'; // новости 

echo "<div class='obmen'>\n";
echo "<img src='/style/icons/downloads.png' alt='' class='icon'/>\n";
echo "<a href='/obmen/'>Зона Обмена</a>\n";
echo ' ';
@include H.'obmen/count.php';
echo '</a><br />фото,игры,видео,софт..<br />';
echo "</div>\n";
if ($user['show_frends']==1)
{
################# личный уголок на главной
if(isset($user)){
echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/group.png' alt='' class='icon'/>\n";
echo '<a href="/frendon.php?id='.$user['id'].'">Друзья на сайте</a>';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` INNER JOIN `user` ON `frends`.`frend`=`user`.`id` WHERE `frends`.`user` = '$user[id]' AND `frends`.`i` = '1' AND `user`.`date_last`>'".(time()-1500)."'"), 0);
echo ' '.( ($k_post==0) ? '0' : '<font color="red">'.$k_post ).'</font><br/>';
echo "</div>\n";
}
}
################# конец уголка на главной
echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/lafes.png' alt='' class='icon'/>\n";
echo "<a href='/users.php'>Обитатели</a>\n";
echo ' <font color="#afb0a3">(';
@include H.'users_count.php';
echo ')</font>';
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/dnev.gif' alt='' class='icon'/>\n";
echo "<a href='/dnev/'>Дневники</a>\n";
echo ' ';
@include H.'dnev/count.php';
echo '</a><br />';
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/forum16.png' alt='' class='icon'/>\n";
echo "<a href='/forum/'>Форум</a>\n";
echo ' ';
@include H.'forum/count.php';
echo '</a><br />';
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/irc16.png' alt='' class='icon'/>\n";
echo "<a href='/chat/'>Чат</a>\n";
echo ' <font color="#afb0a3">(';
@include H.'chat/count.php';
echo ')</font></a><br />';
echo "</div>\n";


echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/blogs16.gif' alt='' class='icon'/>\n";
echo "<a href='/besedka/room/6/5555/'>Беседка</a>\n";
echo ' ';
@include H.'besedka/count.php';
echo '</a><br />';
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/loves16.png' alt='' class='icon'/>\n";
echo "<a href='/love/'>Знакомства</a>\n";
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/zags.png' alt='' class='icon'/>\n";
echo "<a href='/gorod'>Наш городок</a>\n";
echo ' <font color="#afb0a3">(';
@include H.'gorod/count.php';
echo ')</font></a><br />';
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/foto.gif' alt='' class='icon'/>\n";
echo "<a href='/albums.php'>Фотоальбомы</a>\n";
echo ' <font color="#afb0a3">(';
@include H.'foto/count.php';
echo ')</font></a><br />';
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/lafes.png' alt='' class='icon'/>\n";
echo "<a href='/comm/'>Сообщества</a>\n";
@include H.'comm/count.php';
echo '</a><br />';
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/rating16.gif' alt='' class='icon'/>\n";
echo "<a href='/votes/'>Голосования</a>\n";
@include H.'votes/count.php';
echo '</a><br />';
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/top10.png' alt='' class='icon'/>\n";
echo "<a href='/top/'>Топы Oбитателей</a>\n";
echo "</div>\n";

echo "<div class='gmenu'>\n";
echo "<img src='/style/icons/uk.png' alt='' class='icon'/>\n";
echo "<a href='/servis/'>Сервисы</a> | <a href='/info/'>Информация</a>\n";
echo "</div>\n";

include 'forum/incnew.php';

include_once 'sys/inc/gfoot.php';

?>