<?
include 'config.php';
include 'func.php';
head();
ban();
####################Запись онлайна##################
mysql_query("UPDATE `profile` SET `online` = 'index' WHERE `id` = '".$id_session."'");
####################################################

$style = $user['version'];

if($user['theme'] == 1){ $icon2 = 'png';}
if($user['theme'] == 0){ $icon2 = 'jpg';}
echo logo ."<img src='style/".$icon."/logo.".$icon2."' alt='.' />".div;




$myguest = mysql_result(mysql_query("SELECT count(*) FROM `guest` WHERE `user_2` = '".$id_session."' AND `status` = '1'"), 0);
$fradd = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'friend' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);
$blackadd = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'black' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);
$flirt = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'simp' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);
$present = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'present' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);
$golos = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'golos' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);

$microblog = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'microblog' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);

if ( $golos != 0 ) $golos1 = '<a href="uvedom.php?mod=golos">За вашу анкету проголосовали + '.$golos.'</a>';
if ( $myguest != 0 ) $myg = '<a href="guest.php"><img src="images/eye.png" alt="." /> + '.$myguest.'</a>';
if ( $fradd != 0 ) $fradd1 = '<a href="uvedom.php?mod=fradd"><img src="images/friend-add.png" alt="." /> + '.$fradd.'</a>';
if ( $flirt != 0 ) $flirt1 = '<a href="uvedom.php?mod=flirt">Вам подмигнули + '.$flirt.'</a>';
if ( $blackadd != 0 ) $black = '<a href="uvedom.php?mod=black">Вас добавили в черный список + '.$blackadd.'</a>';
if ( $present != 0 ) $present2 = '<a href="uvedom.php?mod=present">Вам отправили подарок + '.$present.'</a>';

if ( $microblog != 0 ) $microblog2 = '<a href="uvedom.php?mod=microblog">Ваш микроблог откометировали + '.$microblog.'</a>';


if ( !empty($id_session) AND !empty($myg) OR !empty($fradd) OR !empty($mail) OR !empty($lovemail) OR !empty($flirt) OR !empty($blackadd) OR !empty($present2) OR !empty($golos1) OR !empty($microblog)) {
    
    echo link1;
    echo $myg . ' ' . $fradd1 . ' ' . $flirt1 . ' ' . $black  . ' ' . $present2  . ' ' . $golos1 . ' ' . $microblog2;
    echo div;
    
}


if (empty($id_session)) {
    echo au . '
<form action="in.php" method="post" name="form">
<b>Логин / ID:</b><br/>
<input name="login" type="text"   maxlength="15" /><br/>
<b>Пароль:</b> [<a href="pass.php">Забыли?</a>]<br/>
<input name="pass" type="text"  maxlength="20" /><br/>
Запомнить меня?: <input type="checkbox"  name="cook" value="1" /><br />
<input class="button" name="submit" type="submit" class="button" value="Вход" /></form>';
echo '<a href="registration.php"><b>Регистрация</b></a>'.div;

} else {
    echo menu . "[<b><a href=\"".$id_session."\">".$login_session."</a></b>] .: <b><a href=\"cabinet.php\">Личный кабинет</a></b> .: <b><a href=\"exit.php\">Выход</a></b><br/ >";
    echo "На личном счету: <b>".$many_session."</b> монет<br/ >";
    if( $level_session > 0)
    echo "[<b><a href=\"__apanel/\">Админ-панель</a></b>]<br/ >";
    echo div;
}
//echo login_f . div;


if ($style == 0) {
    $result = mysql_query("SELECT * FROM news order by id desc limit 1");
    while($news = mysql_fetch_assoc($result)){
    echo clouds . "
    Новости сайта:" .div.padding. " <b>".html($news['name'])."</b> | ".strftime("%d.%m.%y",$news['date'])." <br/>
    ".smile(parsebb(adminbb(nl2br(substr($news[msg], 0, 120)))))."...<br/>";
    
    echo "<a href=\"news.php\">Подробно</a> | Разместил(а): <a href=\"profile.php?id=".html($news['razmestil_id'])."\"><b>".html($news['razmestil'])."</b></a>" . div;
    echo kub . '<img src="style/'.$icon.'/kub.gif" alt="" />' . div;
    }

} else {
    
    $new = mysql_fetch_assoc(mysql_query("SELECT * FROM `news` order by id desc limit 1"));
    echo katalog . '<b><a href="news.php">Новости сайта</a></b> ['.date2($news['date']).']' . div;
}

if ($style == 0) {
echo katalog;
echo '<b>Информация:</b><br/ >';
echo "<img src=\"style/".$icon."/dot.gif\" alt=\"\" /> <b><a href='info.php?act=vopros'>Часто задаваемые вопросы</a></b><br/ >";
echo "<img src=\"style/".$icon."/dot.gif\" alt=\"\" /> <b><a href='konkurs/'>Внимание! Конкурс)</a></b><br/ >";
echo "<img src=\"style/".$icon."/dot.gif\" alt=\"\" /> <b><a href='http://jamob.ru/forum/theme.php?razdel=16&pod_forum=59&theme=43'>Онлайн игры</a></b><br/ ><br/ >";
echo div;
} else {
    echo katalog;
}
$online1 = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `time` > '".(time()-600)."' AND `sex` = 0 ORDER BY `time`"), 0);
echo "<img src=\"style/".$icon."/dot.gif\" alt=\"\" /> <a href='online2.php?mod=1'>Девушки на сайте</a> (".$online1.")<br/ >";
$online2 = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `time` > '".(time()-600)."' AND `sex` = 1 ORDER BY `time`"), 0);
echo "<img src=\"style/".$icon."/dot.gif\" alt=\"\" /> <a href='online2.php?mod=2'>Парни на сайте</a> (".$online2.")<br/ >";

if ($style == 0) {
echo '<br/ >';
$wow = mysql_result(mysql_query("SELECT count(*) FROM `wow`"), 0);
if ($wow > 0) {
echo '<b>Вершина мира:</b><br/>';

if ( $_SESSION['ank'] == 0) {
$res = mysql_query("SELECT * FROM `wow` WHERE `time` > '".time()."'order by id desc limit 2");
while($a = mysql_fetch_assoc($res)) {
    $us = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$a['user']."'"));
    if($us['upload_ava']){
    $ava = '<a href="profile.php?id='.$us['id'].'"><img src="resize.php?img=upload_ava/'.$us['upload_ava'].'&width=60&height=60" alt=""/></a>';
    } else {
    $ava = '<a href="profile.php?id='.$us['id'].'"><img src="resize.php?img=noava.png&width=60&height=60" alt=""/></a>';
    }
    echo $ava . ' ';

}
$all = mysql_result(mysql_query("SELECT count(*) FROM `wow`"), 0);
if ( $all > 1 )
echo '<br/><img src="style/'.$icon.'/dot.gif" alt="" /> <a href="wow.php">Все анкеты</a> ['.$all.']';

}

}
if ($id_session)
echo '<br/ ><img src="style/'.$icon.'/dot.gif" alt="" /> <b><a href="wow.php?mod=add">Поднять анкету</a></b> ['.$wow_rur.' монет]' . div . div;
else
echo div . div;
$time=time()-3600*24;

} else {
    echo div;
}
##ФОРУМ##

$new_msg = mysql_result(mysql_query("SELECT count(*) FROM `forum_msg` WHERE `date` > '".$time."'"), 0);
$kol_theme = mysql_result(mysql_query("SELECT count(*) FROM `forum_themes`"), 0);
$kol_msg = mysql_result(mysql_query("SELECT count(*) FROM `forum_msg`"), 0);

if ($style == 0)
echo clouds_2;


if ($style == 0)
echo "<img src=\"style/".$icon."/dot.gif\" alt=\"\" /> <a href=\"forum/index.php\">Форум</a> [ ".$kol_theme." / ".$kol_msg." / <span style='color: #ff0000'>".$new_msg."</span> ]<br/>";
else
echo katalog . "<img src=\"style/".$icon."/icon/3.gif\" alt=\"\" /> <a href=\"forum/index.php\">Форум</a> [ ".$kol_theme." / ".$kol_msg." / <span style='color: #ff0000'>".$new_msg."</span> ]" . div;

if ($style == 0) {
    echo '<b>Популярные темы:</b><br/>';
    $result = mysql_query("SELECT * FROM forum_themes ORDER BY `time` DESC limit 3");
    
    while($themes = mysql_fetch_assoc($result)){
    
    $all_posts = mysql_result(mysql_query("SELECT count(*) FROM `forum_msg` WHERE `theme` = '$themes[id]'"), 0);
    
    echo "<img src=\"style/".$icon."/dot.gif\" alt=\"\" /> <a href=\"forum/theme.php?razdel=".$themes['razdel_id']."&pod_forum=".$themes['pod_forum']."&theme=".$themes['id']."\">".$themes['name']."</a> [".$all_posts."] <a href=\"forum/theme.php?razdel=".$themes['razdel_id']."&pod_forum=".$themes['pod_forum']."&theme=".$themes['id']."&end=1\">[>>]</a><br/>"; 
    
    
    }


echo div. kub . '<img src="style/'.$icon.'/kub.gif" alt="" />' . div;
}
#########
echo katalog;
echo "<img src=\"style/".$icon."/icon/1.gif\" alt=\"\" /> <a href=\"mp3/\">Глобальный Поиск MP3</a><br/ >";

$new_files = mysql_result(mysql_query("SELECT count(*) FROM `fo_fil` WHERE `date` > '".$time."'"), 0);
$fo = mysql_result(mysql_query("SELECT count(*) FROM `fo_fil`"), 0);
echo "<img src=\"style/".$icon."/icon/2.gif\" alt=\"\" /> <a href=\"newobmen/\">Обменник файлов</a> [ ".$fo." / <span style='color: #ff0000'>".$new_files."</span> ]<br/ >";

$new_msg = mysql_result(mysql_query("SELECT count(*) FROM `chat_msg` WHERE `date` > '".$time."'"), 0);
$chat = mysql_result(mysql_query("SELECT count(*) FROM `chat_msg`"), 0);
echo "<img src=\"style/".$icon."/icon/3.gif\" alt=\"\" />  <a href=\"chat/\">Чат</a> [ ".$chat." / <span style='color: #ff0000'>".$new_msg."</span> ]<br/ >";

$new_photos = mysql_result(mysql_query("SELECT count(*) FROM `photo_photos` WHERE `date` > '".$time."'"), 0);
$photos = mysql_result(mysql_query("SELECT count(*) FROM `photo_photos`"), 0);
$album = mysql_result(mysql_query("SELECT count(*) FROM `photo_album`"), 0);
echo "<img src=\"style/".$icon."/icon/4.gif\" alt=\"\" />  <a href=\"photo/\">Фотоальбомы</a> [ ".$album." / ".$photos." / <span style='color: #ff0000'>".$new_photos."</span> ]<br/ >";

$onl_besed = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `online` = 'besedka' AND `time` > '".time()."'"), 0);
$all = mysql_result(mysql_query("SELECT count(*) FROM `vip`"), 0);
$new_posts = mysql_result(mysql_query("SELECT count(*) FROM `vip` WHERE `date` > '".$time."'"), 0);
echo "<img src=\"style/".$icon."/icon/5.gif\" alt=\"\" />  <a href=\"besedka.php/\">Беседка</a>  [ ".$all." / <span style='color: #ff0000'>".$new_posts."</span> ] [ONL: ".$onl_besed."]<br/ >";

echo "<img src=\"style/".$icon."/icon/6.gif\" alt=\"\" />  <a href=\"garem/\">Гарем</a><br/ >";
echo "<img src=\"style/".$icon."/icon/6.gif\" alt=\"\" />  <a href=\"sivor/\">Провокатор</a><br/ >";
/*echo "<img src=\"style/".$icon."/icon/6.gif\" alt=\"\" />  <a href=\"duelnew/\">Дуэли</a> [".mysql_result(mysql_query("SELECT COUNT(*) FROM `duel`"), 0)."]<br/ >";*/
if ($level_session>=1) echo "<img src=\"style/".$icon."/icon/6.gif\" alt=\"\" /> <a href='zags.php'>Обвенчать</a><br />\n";
$k_iq = mysql_num_rows(mysql_query("SELECT `id_m` FROM `zags`"));

echo "<img src=\"style/".$icon."/icon/6.gif\" alt=\"\" /> <a href='married.php'>Молодые Пары</a> [$k_iq]<br />\n";

$all = mysql_result(mysql_query("SELECT count(*) FROM `profile`"), 0);
$activ_ancet = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `love_status` = '1' ORDER BY `id`"), 0);
echo "<img src=\"style/".$icon."/icon/7.gif\" alt=\"\" />  <a href=\"love/\">Знакомства</a>  [ ".$all." / <span style='color: #ff0000'>".$activ_ancet."</span> ]<br/ >";

$new_clans = mysql_result(mysql_query("SELECT count(*) FROM `clans` WHERE `date` > '".$time."'"), 0);
$clans = mysql_result(mysql_query("SELECT count(*) FROM `clans`"), 0);
echo "<img src=\"style/".$icon."/icon/8.gif\" alt=\"\" />  <a href=\"clan/\">Группы</a> [ ".$clans." / <span style='color: #ff0000'>".$new_clans."</span> ]<br/ >";

$new_blogs = mysql_result(mysql_query("SELECT count(*) FROM `blogs` WHERE `date` > '".$time."'"), 0);
$blogs = mysql_result(mysql_query("SELECT count(*) FROM `blogs`"), 0);
echo "<img src=\"style/".$icon."/icon/9.gif\" alt=\"\" />  <a href=\"blog/\">Дневники</a> [ ".$blogs." / <span style='color: #ff0000'>".$new_blogs."</span> ]<br/ >";

$new_mblogs = mysql_result(mysql_query("SELECT count(*) FROM `microblog` WHERE `time` > '".$time."'"), 0);
$mblogs = mysql_result(mysql_query("SELECT count(*) FROM `microblog`"), 0);
echo "<img src=\"style/".$icon."/icon/9.gif\" alt=\"\" />  <a href=\"microblog/\">Микроблоги</a> [ ".$mblogs." / <span style='color: #ff0000'>".$new_mblogs."</span> ]<br/ >";
echo "<img src=\"style/".$icon."/icon/10.gif\" alt=\"\" />  <a href=\"umor/\">Развлечения</a><br/ >";
#echo "<img src=\"style/".$icon."/icon/11.gif\" alt=\"\" />  <a href=\"games.php\">Онлайн игры</a><br/ >";

#$votes_kol = mysql_result(mysql_query("SELECT count(*) FROM `votes`"), 0);
#$new_votes = mysql_result(mysql_query("SELECT count(*) FROM `votes` WHERE `date` > '".$time."'"), 0);
#echo "<img src=\"style/".$icon."/icon/12.gif\" alt=\"\" />  <a href=\"votes.php\">Голосования</a> [ ".$votes_kol." / <span style='color: #ff0000'>".$new_votes."</span> ]<br/ >";
echo "<img src=\"style/".$icon."/icon/13.gif\" alt=\"\" />  <a href=\"magaz/\">Магазин</a><br/ >";


echo "<img src=\"style/".$icon."/icon/5.gif\" alt=\"\" />  <b><a href=\"info.php?\">Путеводитель сайта</a></b><br/ >";
echo "<img src=\"style/".$icon."/icon/6.gif\" alt=\"\" />  <a href=\"top.php?\">Лидеры сайта</a><br/ >";


$man = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `sex` = '1'"), 0);
$women = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `sex` = '0'"), 0);
$all = mysql_result(mysql_query("SELECT count(*) FROM `profile`"), 0);
$online = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `time` > '".(time()-600)."' ORDER BY `time`"), 0);

echo "<img src='style/".$icon."/men.gif' alt=''/> <b>".$man."</b> ";
echo "<img src='style/".$icon."/girl.gif' alt=''/>  <b>".$women."</b> | ";
echo "<img src='style/".$icon."/men_girl.gif' alt=''/> <b>".$all."</b>" . div;
echo div;

if ($style == 0)
echo katalog . 'Версия сайта: [<a href="version.php">Mini</a>] <b>Full</b>' . div;
else
echo katalog . 'Версия сайта: [<a href="version.php">Full</a>] <b>Mini</b>' . div;

$result = mysql_query("SELECT * FROM profile");
while($a = mysql_fetch_assoc($result)){
if (strftime("%d.%m.%Y",$a['date_aut']) == date("d.m.Y"))
$b++;
}

$result = mysql_query("SELECT * FROM profile");
while($a = mysql_fetch_assoc($result)){
if (strftime("%d.%m.%Y",$a['date_reg']) == date("d.m.Y"))
$c++;
}
if (empty($c)) $c = '0';
if (empty($b)) $b = '0';
echo anketa ."<a href=\"nusers.php\">Новые анкеты</a> [<b>".$c."</b>]<br/ >";
$nuser = mysql_fetch_assoc(mysql_query("SELECT * FROM profile order by id desc limit 1"));
echo "Последняя анкета: ".xstatus($nuser['xstatus'], $nuser['id'])." ".user($nuser['id']).div;



echo div;
$guest = mysql_result(mysql_query("SELECT count(*) FROM `guest_online` WHERE `time` > '".time()."'"), 0);

$all_online = $online + $guest;

echo '<center>Онлайн: <a href="online.php"><b>'.$all_online.'</b></a> [Своих: '.$online.' | Гостей: '.$guest.']</a></center>';

echo '</div><center><a href="http://o5top.ru/in.php?10523"><img src="http://o5top.ru/img.php?10523-small" alt="o5top.ru" /></a><script type="text/javascript" src="http://mobtop.ru/c/12712.js"></script><noscript><a href="http://mobtop.ru/in/12712"><img src="http://mobtop.ru/12712.gif" alt="MobTop.Ru - рейтинг мобильных сайтов"/></a></noscript></center>';
echo '</body></html>';
?>


