<?
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';
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
if ($ank['id']==0)
{
$ank=get_user($ank['id']);
$set['title']='wwe';
include_once 'sys/inc/thead.php';
aut();
title();
echo '<script type="text/javascript" language="javascript" src="blok.js"></script>';



if(isset($_SESSION['refer']) && $_SESSION['refer']!=NULL && otkuda($_SESSION['refer']))
echo "<div class='foot'>&laquo;<a href='$_SESSION[refer]'>".otkuda($_SESSION['refer'])."</a><br />\n</div>\n";

include_once 'sys/inc/tfoot.php';
exit;
}

$ank=get_user($ank['id']);
if(!$ank){header("Location: /index.php?".SID);exit;}
$ank['rating']=intval(@mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$ank[id]'"),0));
include_once 'sys/inc/thead.php';
title();



if (!$set['web'])
include_once 'sys/inc/rekl_main.php'; // реклама

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


echo "<div class='block_hr'><img src='/2info.gif'> <a href='/info.php?id=$ank[id]'>Моя Страница</a>|";
echo "<a href='/anketa.php'>Моя анкета</a><br /></div>\n";
echo "<div class='block_hr'><img src='/edit_photo.gif'> <a href='/avatar.php'>Мой аватар</a></div>\n";
$k_fr = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$ank[id]' AND `i` = '1'"), 0);
echo '<div class="block_hr"><img src="/friends.gif"> <a href="frend.php?id='.$ank['id'].'">Мои Друзья</a> ';
$zoz = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE `to` = '$user[id]'"), 0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0) > 0)
{
echo '<a href="/frend_new.php"><span style="color:blue">+'.$zoz.'</span></a>';
}
echo '</div>';
$foto = mysql_num_rows( mysql_query( "SELECT `id` FROM `gallery` WHERE `id_user` = '$ank[id]'" ) );
echo "<div class='block_hr'><img src='/PhotoIcon.gif'> <a href='/foto/$ank[id]/'>Мои Фотографии</a></div>";
if (isset($ank) && $ank['id']==$user['id'])echo '<div class="block_hr"><img src="/pochta.gif"> <a class="icolink" href="/mail.php">Моя почта</a>';
$knm=mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
if (isset($ank) && $ank['id']==$user['id'])if ($knm>0)echo " <span style='color: #0000ff; font-size: small'>+$knm</span>";
echo "</div>";
echo "<div class='block_hr'><img src='/journal3.gif'> <a href='/jurnal.php'>Мой Журнал</a> ";
$nj=mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
if ($nj>0)echo "<font color=blue>+$nj</font>";
echo "</div>";
$links = mysql_result(mysql_query("SELECT COUNT(*) FROM `favorites` WHERE `id_user`='".$user['id']."'"), 0);
echo '<div class="block_hr"><img src="/stick.gif"> <a href="link.php">Мои Заладки</a></div>';
echo "<div class='block_hr'><img src='/action_newgroup.gif'> <a href=\"guests.php\" title=\"Мои гости\">Мои гости</a></div>\n";
echo "<div class='block_hr'><img src='/ico_news.png'> <a href='/news/'>Мои Новости</a></div>\n";
echo "<div class='block_hr'><img src='/ico_play.png'> <a href='/group/group_my.php?id=".$user['id']."'>Мои Групы</a></div>\n";
echo "<div class='block_hr'><img src='/settings.gif'> <a href='/settings.php'>Настройки</a></div>\n";
if (user_access('adm_panel_show'))echo "<div class='block_hr'><img src='/admin1.png'> <a href='/adm_panel/'>Админка</a></div>\n";
echo "<div class='block_hr'><img src='/settings password.png'> <a href='/secure.php'>Смена пароля</a></div>\n";
echo '<div class="block_hr"><img src="/ico_rati.png"> <font color=blue>Мой рейтинг:</font> '.$user['rating'].'</div>';
echo '<div class="block_hr"><img src="/rating.gif"> <font color=blue>Мои баллы:</font> '.$user['balls'].'</div>';
echo "<div class='block_hr'><img src='/chat.gif'> <a href='/chat/'>ЧаТ</a>\n";
@include H.'chat/count.php';
echo "</div>\n";
echo "<div class='block_hr'><img src='/Forum.gif'> <a href='/forum/'>Форум</a>\n";
@include H.'forum/count.php';
echo "</div>\n";
echo "<div class='block_hr'><img src='/SharedZone.gif'> <a href='/obmen/'>Обменник</a>\n";
@include H.'obmen/count.php';
echo "</div>\n";
echo "<div class='block_hr'><img src='/exit.png'> <a href='/exit.php'>Выйти</a></div>\n";
echo '<div class="foot">';
echo "<center>Советуй наш сайт друзьям! <img src=\"/images/01_Smile1.gif\" alt=\"\"/></center></a>\n";
echo "</div>\n";
include_once 'sys/inc/22foot.php';
?>
<center >
<div class='block_hr'<table>
<tr>
<td>
<h4><H3><font COLOR="red">Дата <?=date("m-d-Y");?></h4></H2></font>
<b>Все права защишены!</b> &#169; &#174;
</table>
</center>
