<?


$index = 1;

include 'connect.php';

//$title = $title.' | Главная';
include 'head.php';
$cusers_online = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `online` > '".(time()-$system['online_time'])."'"), 0);
if($u['id']){
echo '<div class="block_2">';
}
else
{
echo '<div class="title2" style="text-align:center; border-top:1px solid #b3b3b3;">';
}
if($u['id']){echo '<center><font color="black">';}else{echo '<center><font color="white">';}
echo 'Сейчас онлайн:</font> <a href = "users.php?online=1">';
if($u['id']){
echo '<font color="blue">';
}
else
{
echo '<font color="#fafbaf">';
}
echo ' '.$cusers_online.'</a></font></center>';
echo '</div>';

   




$cusers = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0);
$cnews = mysql_fetch_array(mysql_query("SELECT * FROM `news` ORDER BY `time` DESC"));
if ($cnews) $cnews = '('.vremya($cnews['time']).')'; else $cnews = '';
echo '<div class = "block_1"><a href = "news.php"><img src="img/news.gif">  Новости '.$cnews.'</a></div>';

echo '<div class = "block_1"><img src = "image/popular.png"> Наши звезды ';
if($u['id']){
$req = mysql_query("SELECT * FROM `popular` WHERE `user` = '".$u['id']."' LIMIT 1");
if(mysql_num_rows($req)==0){
echo '<a href = "popular.php">попасть сюда</a>';
}
}

$cusers_5 = mysql_result(mysql_query("SELECT COUNT(*) FROM `popular`"), 0);
if($cusers_5 > 0){
   $result = mysql_query("SELECT * FROM `popular` ORDER BY `time` DESC LIMIT 0, 5");
      echo '<table><tr align="center">';
	  while($user = mysql_fetch_assoc($result)){
	  echo '
      <td>';
	  ava_k($user['user'],35);
	  echo '</td>';
	  }
	  echo '</tr></table></div>';
	  
}else{
echo '<br> Пользователей не найдено!';
}
echo '</div>';


$cphotos_top = mysql_result(mysql_query("SELECT COUNT(*) FROM `photos_photo` WHERE `top` = '1'"), 0);
echo '<div class = "block_1"><a href = "photos_top.php"><img src="img/photos.gif"> ТОП-Фото ('.$cphotos_top.')</a>';
echo '<br><br><a href = "search.php"><img src="img/search.gif"> Поиск людей</a></div>';

$carbour = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `arbour`"), 0);
$carbour2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `online` > '".(time()-$system['online_time'])."' AND `location` = 'arbour'"), 0);
echo '<div class = "block_1"><a href = "arbour.php"><img src="img/guestbook.gif"> Беседка ('.$carbour.' | <font color = "green">'.$carbour2.'</font>)</a>';

$cchat = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `online` > '".(time()-$system['online_time'])."' AND `location` = 'chat'"), 0);
echo '<br><br><a href = "chat.php"><img src="img/chat.gif"> Чат (<font color = "green">'.$cchat.'</font>)</a>';

$cforum = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `forum_themes`"), 0);
$cforum2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `forum_messages`"), 0);
$cforum3 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `forum_messages` WHERE `time` > '".(time()-(60*60*24))."'"), 0);
if($cforum3 > 0) $forum_new = '<font color = "red">+'.$cforum3.'</font>';
echo '<br><br><a href = "forum.php"><img src="img/forum.gif"> Форум ('.$cforum.' | '.$cforum2.') '.$forum_new.'</a>';

$cusers_zh = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `sex` = 'zh'"), 0);
$cusers_m = $cusers-$cusers_zh;
echo '<br><br><a href = "love.php"><img src="img/love.png"> Знакомства (<font color = "#FF3399">'.$cusers_zh.'</font> | <font color = "#0099FF">'.$cusers_m.'</font>)</a>';
$cdiary = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `diary_messages`"), 0);
$cdiary2 = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `diary_messages` WHERE `time` > '".(time()-(60*60*24))."'"), 0);
if($cdiary2 > 0) $diary_new = '<font color = "red">+'.$cdiary2.'</font></div>';
echo '<br><br><a href = "diary.php"><img src="img/diary.gif"> Дневники ('.$cdiary.') '.$diary_new.'</a></div>';
$cduels = mysql_result(mysql_query("SELECT COUNT(*) FROM `duels_list` WHERE `time_end` > '".time()."'"), 0);
echo '<div class = "block_1"><a href = "duels.php"><img src="img/duels.gif"> Дуэли ('.$cduels.')</a>';

$cgarem = mysql_result(mysql_query("SELECT COUNT(*) FROM `garems_list` WHERE `users` > '0'"), 0);
echo '<br><br><a href = "garems.php"><img src="img/garems.png"> Гаремы('.$cgarem.')</a>';





echo '<br><br><a href = "search.php?act=go&online=1"><img src="img/users_online.gif"> Онлайн ('.$cusers_online.')</a>';

$cusers = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0);
echo '<br><br><a href = "search.php?act=go"><img src="img/users.gif"> Пользователи ('.$cusers.')</a></div>';

echo '<div class = "title2"><center>Реклама</center></div>
<div class = "block_2"><center><a href = "http://vk.com/visiti"><font color="green"><img src="img/vk.png"> </a></center></font></div>';

echo '<div class = "title2"><center><a href = "rules.php"><font color="white"> Правила </font></a> · <a href = "reklama.php"> <font color="white"> Реклама </font> </a> · <a href = "kont.php"> <font color="white"> Контакты </font> </a></font></center></div>';




?>
<center>
<a href="http://waptut.ru/in.go?id=3644"><img src="http://c.waptut.ru/3644/main.png" alt="waptut" /></a><script type="text/javascript" src="http://mobtop.ru/c/38644.js"></script><noscript><a href="http://mobtop.ru/in/38644"><img src="http://mobtop.ru/38644.gif" alt="MobTop.Ru - рейтинг мобильных сайтов"/></a></noscript><a href="http://razwap.ru/?uid=199">
 <img src="http://razwap.ru/count.php?uid=199" alt="Razwap.Ru"/></a> 