<?
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';
include_once 'sys/inc/user.php';
include_once 'sys/inc/icons.php'; // Иконки главного меню

include_once 'sys/inc/thead.php';
title();
err();
if(isset($user))
{
include_once 'sys/inc/bonus.php';
}
if (!$set['web'])
{
echo "<div class='title'>\n";
echo "<center><a href=\"/online.php\" title=\"онлайн\" style=\"color:#cdcecf; text-decoration:none\"><font color=\"#fee300\" size=\"2\">СейчАс В зНаКоМсТвАх </font><font color=\"#ffffff\">".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > ".(time()-600).""), 0)." </font></a>";
echo "<font color=\"#fee300\" size=\"2\"> [</font><font color=\"#ffffff\">+".mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > ".(time()-600)." AND `pereh` > '0'"), 0)."</font><font color=\"#fee300\" size=\"2\"> гостей ]</font></center>\n";
echo "</div>\n";
$sexwars = mysql_fetch_assoc(mysql_query("SELECT * FROM `sexwars` WHERE `active` = '1' LIMIT 1"));

if (isset($sexwars['id'])) {
?>

<?    
}

echo "<div class='main_menu'>\n";
if (isset($user)){
echo "<div align=\"right\"><img src='/style/icons/icon_stranica.gif' alt='S' />
<a href='/info.php?id=$user[id]'>$user[nick]</a> | <a href=\"exit.php\"><font color=\"#ff0000\">Выход</font></a></div>";
}else{
echo "<div align=\"right\"><a href='aut.php'>Войти </a> | <a href='/reg.php'>Зарегистрироваться</a></div>";
include_once '1/1.dat';
}
include_once 'plugins/lineykavip/inc_wap.php';
echo "</div>";
?>
<div class="mess" style="background-color: #ffedc8;">
  <img src="/plugins/sexwar/images/mf-icon.png" /> <a href="/plugins/sexwar/wars.php?id=<?= $sexwars['id']?>"> Битва Полов </a> βeta версия
  <table style="width: 100%;">
    <tr>
      <td style="width: 50px;">
        <a href="/plugins/sexwar/"><img src="/plugins/sexwar/images/icon.png" /></a>
      </td>
      <td style="padding: 2px;">
        <div style="padding: 2px;">
          Девушки <?= (100 - $sexwars['male'])?>%
        </div>
        
        <div style="position: relative; width: 100%; height: 4px;">
          <div style="position: absolute; width: <?= (100-$sexwars['male'])?>%; height: 4px; background-color: #ffa8f4;"></div>
        </div>
        
        <div style="padding: 2px;">
          Парни <?= (100 - $sexwars['female'])?>%
        </div>
        
        <div style="position: relative; width: 100%; height: 4px;">
          <div style="position: absolute; width: <?= (100-$sexwars['female'])?>%; height: 4px; background-color: #96ed94;"></div>
        </div>
      </td>
    </tr>
  </table>
</div>
<?


echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/news/'> Новости </a>";
include_once H.'/news/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/bonus/'> Бонус </a>";
include_once H.'/bonus/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/user/liders/'>Лидеры</a>";
include_once H.'/user/liders/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/obmen/'>Зона обмена</a>";
echo "<div style='font-size:13px;'>Фото, игры, видео, софт...</div>";
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/gruppy/'>Группы [NEW] </a>";
include_once H.'/gruppy/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/plugins/jino/'>Лампа джина [ЕКСКЛЮЗИВ] </a>";
include_once H.'/plugins/jino/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/zags/'> Загс [XIT] </a>";
include_once H.'/zags/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/comm/'> Сообщества </a>";
include_once H.'/comm/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/user/users.php/'>Обитатели</a>";
include_once H.'/user/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/plugins/notes/'>Дневники</a>";
include_once H.'plugins/notes/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/forum/'>Форум</a>";
include_once H.'forum/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/duels/'> Дуэли </a>";
include_once H.'duels/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/chat/'>Чат</a>";
include_once H.'chat/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/guest/'>Гостевая</a>";
include_once H.'guest/count.php';
include_once H.'guest/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/user/love/'>Знакомства</a>";
include_once H.'/user/love/count.php';
include_once H.'/user/love/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/klan/'> Кланы </a>";
include_once H.'klan/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/foto/'>Фотогалерея</a>";
include_once H.'foto/count.php';
echo "</div>";
echo '<div class="menu_razd"><div class="g_menu"> Игры онлайн </div></div>';
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/fm/'>Футбол</a>";
include_once H.'fm/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/fish/'> Рыбалка </a>";
include_once H.'fish/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/baby_mmoblove/'> Мой ребёнок [XIT] </a>";
include_once H.'baby_mmoblove/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/ferma_mmoblove/'> Садовкики </a>";
include_once H.'ferma_mmoblove/count.php';
echo "</div>";
echo "<div class='main_menu'>";
echo "<img src='/style/icons/nasocke.gif' alt='*'>";
echo " <a href='/mafia/'> Мафия </a>";
include_once H.'/mafia/count.php';
echo "</div>";
echo '<div class="menu_razd"><div class="g_menu">† Темы форума †</div></div>';

$adm_add=NULL;

$adm_add2=NULL;

if (!isset($user) || $user['level']==0){

$q222=mysql_query("SELECT * FROM `forum_f` WHERE `adm` = '1'");

while ($adm_f = mysql_fetch_assoc($q222))

{

$adm_add[]="`id_forum` <> '$adm_f[id]'";

}

if (sizeof($adm_add)!=0)

$adm_add2=' WHERE'.implode(' AND ', $adm_add);

}



$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t`$adm_add2"),0);

$k_page=k_page($k_post,$set['p_str']);

$page=page($k_page);

$start=$set['p_str']*$page-$set['p_str'];

$q=mysql_query("SELECT * FROM `forum_t`$adm_add2 ORDER BY `time_create` DESC  LIMIT 3");

if (mysql_num_rows($q)==0) {

echo "  <div class='mess '>\n";
echo "В данный момент на сайте нет тем с форума\n";

echo "  </div>\n";
}

while ($them = mysql_fetch_assoc($q))

{

echo '<div class="nav1 ">';
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_f` WHERE `id` = '$them[id_forum]' LIMIT 1"));

$razdel=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));

//$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '$post[id_them]' LIMIT 1"));

$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));


if ($set['set_show_icon']==2){

echo "<img src='/style/themes/$set[set_them]/forum/48/them_$them[up]$them[close].png' />";

}

elseif ($set['set_show_icon']==1)

{

echo "<img src='/style/themes/$set[set_them]/forum/14/them_$them[up]$them[close].png' alt='' />";

}

echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=end'>(".mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]'"),0).")</a>\n";


echo "<br><a href='/forum/$forum[id]/'>$forum[name]</a> &gt; <a href='/forum/$forum[id]/$razdel[id]/'>$razdel[name]</a><br />\n";
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));

echo "Автор: <a href='/info.php?id=$ank[id]' title='Анкета \"$ank[nick]\"'>$ank[nick]</a> (".vremja($them['time_create']).")<br />\n";


$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT 1"));

$ank2=get_user($post['id_user']);

if ($ank2['id'])echo "Посл.: <a href='/info.php?id=$ank2[id]' title='Анкета \"$ank2[nick]\"'>$ank2[nick]</a> (".vremja($post['time']).")<br />\n";

echo "  </div>\n";
}
}else{


include_once 'style/themes/'.$set['set_them'].'/index.php'; // главная web темы


}
include_once 'sys/inc/tfoot.php';
?>