<?
include 'config.php';
include 'func.php';
head();
ban();
####################Запись онлайна##################
mysql_query("UPDATE `profile` SET `online` = 'index' WHERE `id` = '".$id_session."'");
####################################################
$time=time()-3600*24;
$style = $user['version'];

if($user['theme'] == 1){ $icon2 = 'png';}
if($user['theme'] == 0){ $icon2 = 'gif';}
if($user['theme'] == 2){ $icon2 = 'png';}

if ($user['theme'] == 0)
echo logo ."<img src='style/vesna/logo.gif' alt='.' />".div;
else
echo logo ."<img src='style/".$icon."/logo.".$icon2."' alt='.' />".div;

$icon = 'vesna';

if (!empty($id_session)) {
if (empty($user['bezopas_vopros']) AND empty($user['otvet']))
    echo link2 . 'Внимание! Укажите данные для восстановления пароля, по ссылке <b><a href="cabinet.php?act=bezopas">Безопасность</a></b>' . div;

if (empty($user['city']) AND empty($user['country']))
    echo link2 . 'Выберите страну и город проживания, по ссылке <b><a href="myinfo/index.php?mod=life">Место проживания</a></b>' . 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);
$forumprivat = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'forum_privat' 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);
$photo_coment = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'photo_coment' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);
$photo_reyt = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'photo_reyt' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);
$blog = mysql_result(mysql_query("SELECT count(*) FROM `uvedom` WHERE `md` = 'blog' AND `status` = '1' AND `user_to` = '".$id_session."'"), 0);
$flirtomania = mysql_result(mysql_query("SELECT COUNT(*) FROM `flirt_lenta` WHERE `id_opponent`='$user[id]'"),0);

if ($flirtomania > 0) $flirtomania2 = "<a href='flirt.php?act=lenta'>Флиртомания</a> +".$flirtomania."<br/>";

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 ( $forumprivat != 0 ) $forumprivat1 = '<a href="uvedom.php?mod=forum_privat">В вашей теме ответили + '.$forumprivat.'</a>';
if ( $microblog != 0 ) $microblog2 = '<a href="uvedom.php?mod=microblog">Ваш микроблог откометировали + '.$microblog.'</a>';
if ( $photo_coment != 0 ) $photo_coment2 = '<a href="uvedom.php?mod=photo_coment">Вашу фотографию откометировали + '.$photo_coment.'</a>';
if ( $photo_reyt != 0 ) $photo_reyt2 = '<a href="uvedom.php?mod=photo_reyt">Вашу фотографию оценили + '.$photo_reyt.'</a>';
if ( $blog != 0 ) $blog2 = '<a href="uvedom.php?mod=photo_coment">Ваш блог откометировали + '.$blog.'</a>';

if (!empty($id_session) ) {
if (!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) OR !empty($forumprivat1) OR !empty($photo_coment2) OR !empty($photo_reyt) OR !empty($blog) OR !empty($flirtomania2)) {
    
    echo link1;
    echo $myg . ' ' . $fradd1 . ' ' . $flirt1 . ' ' . $black  . ' ' . $present2  . ' ' . $golos1 . ' ' . $microblog2 . ' ' . $forumprivat1 . ' ' . $photo_coment2 . ' ' . $photo_reyt2 . ' ' . $blog2 . ' ' . $flirtomania2;
    echo div;
    
}
}


if (empty($id_session)) {
    echo link1 . '
<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="reg.php"><b>Регистрация</b></a>'.div;

} else {
    echo link1 . "[<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> монет [<a href=\"pay.php\">Пополнить</a>]<br/ >";
    if( $level_session == 4 OR $level_session == 5)
    echo "[<b><a href=\"__apanel/\">Админ-панель</a></b>]<br/ >";
    if( $level_session == 2 OR $level_session == 3)
    echo "[<b><a href=\"mod.php/\">Модер-панель</a></b>]<br/ >";
    echo div;
}
//echo login_f . div;

$guest = mysql_result(mysql_query("SELECT count(*) FROM `guest_online` WHERE `time` > '".time()."'"), 0);
$friendsonl = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` INNER JOIN `profile`

                        ON

                        (`friends`.`user_2` = `profile`.`id`)

                        WHERE

                        `friends`.`user_1` = '$id_session'

                        AND

                        `profile`.`time` > '" . (time()-600) . "'"), 0);
$all_online = $online + $guest;
echo clouds . '
    На сайте: <a href="online.php"><b>'.$all_online.'</b> чел</a> [Своих: '.$online.' | Гостей: '.$guest.']<br/>
    <a href="friends.php?mod=online">Моих друзей на сайте: '.$friendsonl.'
    ' .div.padding;

    $result = mysql_query("SELECT * FROM news order by id desc limit 1");
    while($news = mysql_fetch_assoc($result)){
    
    
    $new = mysql_fetch_assoc(mysql_query("SELECT * FROM `news` order by id desc limit 1"));
    echo katalog . '<b><a href="news.php">'.$news['name'].'</a></b> ['.date2($news['date']).']<br/><b><a href="ob.php">Информация</a></b>' . div . div;
    echo kub . '<img src="style/'.$icon.'/kub.gif" alt="" />' . div;
    
    
    }



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

if ( $_SESSION['ank'] == 0) {
$res = mysql_query("SELECT * FROM `wow` WHERE `time` > '".time()."'order by id desc limit 3");
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/> <a href="wow.php">Все анкеты</a> ['.$all.']';

}

}
if ($id_session)
echo ' | <b><a href="wow.php?mod=add">Подняться</a></b> ['.$wow_rur.' монет]' . div . div;
else
echo div . div;

    $result = mysql_query("SELECT * FROM `microblog` ORDER BY `id` DESC limit 1");
    
    echo katalog;
    $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 "<b>Мысли:</b> <a href=\"microblog/\">Все</a> [ ".$mblogs." / <span style='color: #ff0000'>".$new_mblogs."</span> ]<br/ >";
    while($blog = mysql_fetch_assoc($result)){
    
    echo "<img src=\"style/".$icon."/2.png\" alt=\"\" /> <b>".user($blog[id_user]).":</b> <a href='microblog/blog.php?id=$blog[id]'>".substr($blog[name], 0, 60)."...</a><br/>"; 
    
    
    }
    echo div;

} 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."/2.png\" 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."/2.png\" 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."/2.png\" 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;

$all = mysql_result(mysql_query("SELECT count(*) FROM `jurnal`"), 0);
$new_posts = mysql_result(mysql_query("SELECT count(*) FROM `jurnal` WHERE `date` > '".$time."'"), 0);
echo "<b><img src=\"style/".$icon."/1.png\" alt=\"\" />  <a href=\"jurnal.php\">Журнал сайта</a></b>  [ ".$all." / <span style='color: #ff0000'>".$new_posts."</span> ]<br/ >";


echo "<img src=\"style/vesna/1.png\" alt=\"\" /> <a href=\"mp3/\">Глобальный Поиск MP3</a><br/ >";

$day = date('j');
$month = date('n');
$dr = mysql_result(mysql_query("SELECT count(*) FROM profile WHERE d = '".$day."' AND m = '".$month."'"), 0);
if ($dr>0)
echo "<img src=\"style/".$icon."/1.png\" alt=\"\" /> <b><a href='dr.php'>Дни Рождения</a> [$dr]</b><br />\n";

$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."/1.png\" 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."/1.png\" 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."/1.png\" 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."/1.png\" alt=\"\" />  <a href=\"besedka.php/\">Беседка</a>  [ ".$all." / <span style='color: #ff0000'>".$new_posts."</span> ] [ONL: ".$onl_besed."]<br/ >";

echo "<img src=\"style/".$icon."/1.png\" alt=\"\" />  <a href=\"garem.php\">Гарем</a><br/ >";
echo "<img src=\"style/".$icon."/1.png\" alt=\"\" />  <a href=\"sivor/\">Провокатор</a><br/ >";
echo "<img src=\"style/".$icon."/1.png\" alt=\"\" />  <a href=\"flirt.php\">Флиртомания</a><br/ >";
echo "<img src=\"style/".$icon."/1.png\" alt=\"\" />  <a href=\"brands/\">Битва брэндов</a><br/ >";

$k_iq = mysql_num_rows(mysql_query("SELECT `id_m` FROM `zags`"));
echo "<img src=\"style/".$icon."/1.png\" alt=\"\" /> <a href='married.php'>ЗАГС</a> [$k_iq]<br />\n";

$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."/1.png\" 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."/1.png\" alt=\"\" />  <a href=\"blog/\">Дневники</a> [ ".$blogs." / <span style='color: #ff0000'>".$new_blogs."</span> ]<br/ >";

echo "<img src=\"style/".$icon."/1.png\" alt=\"\" /> <a href='service/'>Сервисы</a><br />\n";
echo "<img src=\"style/".$icon."/1.png\" alt=\"\" />  <a href=\"umor/\">Развлечения</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."/1.png\" alt=\"\" />  <a href=\"votes.php\">Голосования</a> [ ".$votes_kol." / <span style='color: #ff0000'>".$new_votes."</span> ]<br/ >";
echo "<img src=\"style/".$icon."/1.png\" alt=\"\" />  <a href=\"magaz/\">Магазин</a><br/ >";


echo "<img src=\"style/".$icon."/1.png\" alt=\"\" />  <b><a href=\"info.php?\">Путеводитель сайта</a></b><br/ >";
echo "<img src=\"style/".$icon."/1.png\" alt=\"\" />  <a href=\"top.php?\">Лидеры</a> | <a href=\"elita.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)."' AND `invis` = 0 ORDER BY `time`"), 0);

echo div . katalog;
echo "<b>M:</b> <b>".$man."</b> ";
echo "<b>Ж:</b>  <b>".$women."</b> | ";
echo "<b>Всех:</b> <b>".$all."</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;

echo '</div><center><a href="http://wap.top.wapstart.ru/?s=18949"><img src="http://counter.wapstart.ru/index.php?c=21733;b=1;r=0;s=21733" alt="Каталог сайтов Top.WapStart.ru" title="Каталог сайтов Top.WapStart.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>';
?>