<?

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';
only_reg();
if (!isset($user) && !isset($_GET['id'])){header("Location: /index.php?".SID);exit;}
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
else



{
if (isset($_GET['u']))$arr['nick']=$_GET['u'];
$nick=mysql_real_escape_string($arr['nick']);
$res=mysql_query("SELECT id FROM user WHERE nick='$nick';");
if($row=mysql_fetch_assoc($res))$ank['id']=$row['id'];
}

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0){header("Location: /index.php?".SID);exit;}
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ank[id] LIMIT 1"));
$set['title']=''.$ank['nick'].' [id: '.$ank['id'].']'; // заголовок страницы
include_once 'sys/inc/thead.php';
title();

if ( ( !isset( $_SESSION['refer'] ) || $_SESSION['refer'] == null ) && isset( $_SERVER['HTTP_REFERER'] ) && $_SERVER['HTTP_REFERER'] != null && !ereg( 'info\.php', $_SERVER['HTTP_REFERER'] ) )
$_SESSION['refer'] = str_replace( '&', '&', ereg_replace( '^http://[^/]*/', '/', $_SERVER['HTTP_REFERER'] ) );
if ( isset( $_GET['rating'] ) && $_GET['rating'] >= 1 && $_GET['rating'] <= 5 )

{
if ( isset( $access['user_voice'] ) && $user['id'] != $ank['id'] && $user['balls'] >= 50 && $user['rating'] >= 0 && mysql_result( mysql_query( "SELECT COUNT(*) FROM `user_voice` WHERE `id_user` = '$user[id]' AND `id_kont` = '$ank[id]'" ), 0 ) == 0 )
	{
$ratsun = intval( $_GET['rating'] );
mysql_query("INSERT INTO `my_rating` (`id_user`, `id_ank`, `rat`, `time`) values('$ank[id]', '$user[id]', '$ratsun', '$time')");
$msgrat="[b]$user[nick][/b] Проголосовал за вашу страничку! Оценка на +$ratsun";
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$msgrat', '$time')");
mysql_query("UPDATE `user` SET `rating` = '".($ank['rating']+$ratsun)."' WHERE `id` = '$ank[id]' LIMIT 1",$db);
mysql_query("INSERT INTO `user_voice` (`id_user`, `id_kont`) values('$user[id]', '$ank[id]')",$db);
msg ('Ваш отзыв принят');
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ank[id] LIMIT 1"));
}
else
msg ('Что бы получить возможность голосовать, вам нужно набрать 50 баллов');
}

if (isset($_GET['frend']) && $_GET['frend']=='del')

{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0){header("Location: index.php?");exit;}
mysql_query("DELETE FROM `frends` WHERE `user` = '$user[id]' AND `frend` = '$ank[id]' LIMIT 1");
mysql_query("DELETE FROM `frends` WHERE `user` = '$ank[id]' AND `frend` = '$user[id]' LIMIT 1");
mysql_query("DELETE FROM `frends_new` WHERE `user` = '$ank[id]' AND `to` = '$user[id]' LIMIT 1");
mysql_query("DELETE FROM `frends_new` WHERE `user` = '$user[id]' AND `to` = '$ank[id]' LIMIT 1");
mysql_query("OPTIMIZE TABLE `frends`");
mysql_query("OPTIMIZE TABLE `frends_new`");
$msgno="К сожалению, обитатель [b]$user[nick][/b] удалил вас из списка друзей!";
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$msgno', '$time')");
msg ('Обитатель успешно удален из списка ваших друзей');
}

if (isset($_GET['frend']) && $_GET['frend']=='add')
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0){header("Location: index.php?".SID);exit;}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE (`user` = '$user[id]' AND `frend` = '$ank[id]') OR (`user` = '$ank[id]' AND `frend` = '$user[id]') LIMIT 1"),0)==1){header("Location: index.php?".SID);exit;}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE (`user` = '$user[id]' AND `to` = '$ank[id]') OR (`user` = '$ank[id]' AND `to` = '$user[id]') LIMIT 1"),0)==1){header("Location: index.php?".SID);exit;}
if ($ank['id']==$user['id']){header("Location: index.php?".SID);exit;}
mysql_query("INSERT INTO `frends_new` (`user`, `to`, `time`) values('$user[id]', '$ank[id]', '$time')");
mysql_query("OPTIMIZE TABLE `frends_new`");
msg ('Ваше предложение дружбы отправлено обитателю '.$ank['nick'].'');
}
# Забанить пользователя
$d1sql = mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE (`user` = '$user[id]' AND `to` = '$ank[id]') OR (`user` = '$ank[id]' AND `to` = '$user[id]') LIMIT 1");
$d2sql = mysql_query("SELECT COUNT(*) FROM `frends` WHERE (`user` = '$ank[id]' AND `frend` = '$user[id]') OR (`user` = '$user[id]' AND `frend` = '$ank[id]') LIMIT 1");
aut();

if (isset($user) && $ank['id']!=$user['id']){
mysql_query("INSERT INTO `my_guest` (`id_ank`, `id_user`, `time`) VALUES ('$ank[id]', '$user[id]', '$time')");
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) VALUES ('0', '$ank[id]', 'Вашу страничку посетил [url=/my_guest.php]новый гость[/url]', '$time')");
}

if (isset($user) && $user['id']!=$ank['id'])
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guest` WHERE `id_user` = '$ank[id]' AND `id_guest` = '$user[id]'"), 0)==0)
{
mysql_query("INSERT INTO `my_guest` (`id_user`, `id_guest`, `time`) values('$ank[id]', '$user[id]', '$time')",$db);
}
mysql_query("UPDATE `my_guest` SET `time` = '$time' WHERE `id_user` = '$ank[id]' AND `id_guest` = '$user[id]'");
}

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]' AND `time` > '$time'"), 0)!=0)
{
$q=mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$ank[id]' AND `time` > '$time' ORDER BY `time` DESC LIMIT 5");
while ($post = mysql_fetch_array($q))
{
echo '<div class="guser_aut">';
echo "<font color='#FF0000'>Обитатель был забанен за нарушение условий использования сервиса</font><br/>\n";
echo "Причина: ".$post['prich']."<br />\n";
echo "Забанен до: ".vremja($post['time'])."<br>\n";


if (isset($user) && $user['level']==4)
{

echo "<img src='img/bullet.png' alt=''> <a href='ad_mod/ban.php?id=$ank[id]&act=del'>Снять бан</a><br />\n";
echo "</div>\n";
}

include_once 'sys/inc/tfoot.php';

if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))

{

}

}

}

else

{

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' AND `date_last` > '".(time()-2500)."' LIMIT 1"),0)==1)

{

echo '<div class="page_foot">';

echo "".online($ank['id'])."\n";

if ($ank['status']==0)echo "Онлайн <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==1)echo "Готов болтать <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==2)echo "Не беспокоить <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==3)echo "Болею <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==4)echo "Депрессия <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==5)echo "Думаю <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==6)echo "Курю <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==7)echo "Кушаю <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==8)echo "Люблю <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==9)echo "Смотрю тв <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==10)echo "Слушаю музыку <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==11)echo "В ванной <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==12)echo "В туалете <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==13)echo "Занимаюсь сексом <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==14)echo "Играю в игру <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==15)echo "Пью пиво <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

else if ($ank['status']==16)echo "Сонный <img src='img/tabor/on.gif' alt='' class='icon'/><br />\n";

}else{

if ($ank['pol']==1){

echo '<img src="img/tabor/man_off.gif" alt="logo" class="icon"/> Не в сети <img src="img/tabor/off.gif" alt="" class="icon"/><br />';}

else {

echo '<img src="img/tabor/woman_off.gif" alt="" class="icon"/> Не в сети <img src="img/tabor/off.gif" alt="" class="icon"/><br />';}










}

if ($ank['ank_enter'] == '2' && !isset($user))
{

echo' </div><div class="gend"> - Пользователь запретил просмотр своей страницы<br/> - Просмотр только для друзей</div>';


		if (isset($user) && $user['id']!=$ank['id']){

echo "<div class='guser_aut'>";

echo "<img src='img/tabor/leter.gif' alt='' class='icon'/><a href=\"/mail.php?id=$ank[id]\"> Написать в приват</a><br />\n";


}
	if ( isset( $user ) && $user['id'] != $ank['id'] && mysql_result( $d1sql, 0 ) == 0 && mysql_result( $d2sql, 0 ) == 0 )
	{
	
	if (isset($user) && $user['id']!=$ank['id']){ 
echo '<img src="/img/tabor/add_frends.gif" alt="" class="icon"/><a href="info.php?id='.$ank['id'].'&frend=add">Предложить дружбу</a><br>';

}
echo "</div>";
}

else

{

if (isset($user) && $user['id']!=$ank['id']){ 
echo '<img src="img/error.gif" alt="" class="icon"/><a href="info.php?id='.$ank['id'].'&frend=del">Удалить из друзей</a><br>';


}
}

if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
{

echo "<div class='p_t'>Админ-панелька</div>\n";
if (isset($user) && $user['level']==4)
{
echo "<div class='str'>";
echo "<img src='img/tabor/bullet.png' alt=''> <a href='/adm_panel/user.php?id=$ank[id]'>Редактировать профиль</a><br />\n";
}
if ($user['id']!=$ank['id']){
if ($ank['ban']>$time)
{
if (isset($access['ban_unset']))
echo "<img src='img/bullet.png' alt=''> <a href='adm_panel/ban.php?id=$ank[id]&act=del'>Снять бан</a><br />\n";
}
else 
{
if (isset($access['ban_set']))
echo "<img src='img/tabor/bullet.png' alt=''> <a href='adm_panel/ban.php?id=$ank[id]'>Забанить пользователя</a><br />\n";
}
if (isset($access['user_delete'])){
echo "<img src='img/tabor/bullet.png' alt=''> <a href='adm_panel/delete_user.php?id=$ank[id]'>Удалить пользователя</a><br />";
mysql_query("OPTIMIZE TABLE `users`");
}}




echo "</div>\n";
}
include_once 'sys/inc/tfoot.php';
exit();
}

if ($ank['ank_enter'] == '2' && $ank['id'] != $user['id'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$ank[id]' && `frend` = '$user[id]'"),0) == '0')
{
echo' </div><div class="gend"> - Пользователь запретил просмотр своей страницы<br/> - Просмотр только для друзей</div>';

if (isset($user) && $user['id']!=$ank['id']){

echo "<div class='guser_aut'>";


include('mail/index.php');



echo "<img src='img/tabor/leter.gif' alt='' class='icon'/><a href=\"/mail.php?id=$ank[id]\"> Написать в приват</a><br />\n";

}
	if ( isset( $user ) && $user['id'] != $ank['id'] && mysql_result( $d1sql, 0 ) == 0 && mysql_result( $d2sql, 0 ) == 0 )
	{
	
	if (isset($user) && $user['id']!=$ank['id']) 
echo '<img src="img/tabor/add_frends.gif" alt="" class="icon"/><a href="info.php?id='.$ank['id'].'&frend=add">Предложить дружбу</a><br>';
$mod_dei=mysql_result(mysql_query("SELECT COUNT(*) FROM `mod_dei_go` WHERE `uid` = '$ank[id]'"),0);
echo "<span class=\"ank_n\"><img src='img/dei.png' alt='' class='icon'/> <a href='de/dei.php?uid=$ank[id]'>Совершить действие</a></span> <span class=\"ank_d\">$mod_dei</span><br />\n";
echo "<img src='img/tabor/duels.gif' alt='' class='icon'/> <a href=\"/duels.php?act=inser&id=$ank[id]\"> Вызвать на дуэль</a><br />\n";
if($ank['aa1'] != $user['id'] && $ank['pol'] != $user['pol']) 
echo "<img src='/img/garem.gif' alt='' class='icon'/><a href=\"/garem.php?act=kraz&id=$ank[id]\"> Украсть к себе в гарем</a><br />\n";



{echo '<img src="img/img/chs.png" alt="" class="icon"/> <a href="blacklist_add.php?id='.$ank['id'].'">Добавить в игнор</a><br/>';


}


{


if ($user['pol'] != $ank['pol'] && $user['gorod_brak'] == null && $ank['gorod_brak'] == null)print '<img src="/img/img/rings.gif" alt="" class="icon"/>  <a href="zags.php?id='.$ank['id'].'">Сделать предложение</a><br/>';


}

echo "</div>";
}

else


{

if (isset($user) && $user['id']!=$ank['id']) {
echo '<img src="img/tabor/add_frends.gif" alt="" class="icon"/><a href="info.php?id='.$ank['id'].'&frend=del">Удалить из друзей</a><br>';
}
}


if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
{

echo "<div class='p_t'>Админ-панелька</div>\n";
if (isset($user) && $user['level']==4)
{
echo "<div class='str'>";
echo "<img src='img/tabor/bullet.png' alt=''> <a href='/adm_panel/user.php?id=$ank[id]'>Редактировать профиль</a><br />\n";
}
if ($user['id']!=$ank['id']){
if ($ank['ban']>$time)
{
if (isset($access['ban_unset']))
echo "<img src='img/bullet.png' alt=''> <a href='adm_panel/ban.php?id=$ank[id]&act=del'>Снять бан</a><br />\n";
}
else 
{
if (isset($access['ban_set']))
echo "<img src='img/tabor/bullet.png' alt=''> <a href='adm_panel/ban.php?id=$ank[id]'>Забанить пользователя</a><br />\n";
}
if (isset($access['user_delete'])){
echo "<img src='img/tabor/bullet.png' alt=''> <a href='adm_panel/delete_user.php?id=$ank[id]'>Удалить пользователя</a><br />";
mysql_query("OPTIMIZE TABLE `users`");
}}



echo "</div>\n";


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


$sql = mysql_query("SELECT * FROM `blacklist` WHERE `user` = $ank[id] AND `lol` = $user[id];");
if(mysql_num_rows($sql) !=0 AND $user[level] <3){echo "Вы не можете просматривать страницу обитателя <b>$ank[nick]</b>  Вы добавлены в его черный список  <br/>";include_once 'sys/inc/tfoot.php';
exit;
}


if ($ank['status_vip'] > 0) print ' <img src="/imag/info/vip2.gif">';

if($ank['level']==0){

	echo '<span class="status">Обитатель сайта '.$_SERVER['HTTP_HOST'].'</span><br />';
	
	}else if($ank['level']==1){
	
		echo ' <img src="img/tabor/security.png" alt="" class="icon"/> Модератор<br />';
		
		}else if($ank['level']==2){
		
			echo ' <img src="img/tabor/user_mal.png" alt="" class="icon"/> Супер Модератор<br />';
			
			}else if($ank['level']==3){
			
				echo ' <img src="img/tabor/user_adm.png" alt="" class="icon"/> Администратор<br />';
				
				}else if($ank['level']==4){
				
					echo ' <img src="img/tabor/admin_sign.gif" alt="" class="icon"/> Системный Админ<br/>';
					}
					
					$data = mysql_query( "select * from `rangs` where `id`='1';" );
			$data = mysql_fetch_assoc( $data );

			if ( $ank['balls'] >= 51 && $ank['balls'] <= 100 )echo htmlspecialchars( $data['3'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 101 && $ank['balls'] <= 250 )echo htmlspecialchars( $data['4'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 251 && $ank['balls'] <= 400 )echo htmlspecialchars( $data['5'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 401 && $ank['balls'] <= 600 )echo htmlspecialchars( $data['6'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 601 && $ank['balls'] <= 750 )echo htmlspecialchars( $data['7'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 751 && $ank['balls'] <= 900 )echo htmlspecialchars( $data['8'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 901 && $ank['balls'] <= 1000 )echo htmlspecialchars( $data['9'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 1001 && $ank['balls'] <= 1249 )echo htmlspecialchars( $data['10'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 1250 && $ank['balls'] <= 1499 )echo htmlspecialchars( $data['11'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 1500 && $ank['balls'] <= 1749 )echo htmlspecialchars( $data['12'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 1750 && $ank['balls'] <= 1999 )echo htmlspecialchars( $data['13'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 2000 && $ank['balls'] <= 2249 )echo htmlspecialchars( $data['14'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 2250 && $ank['balls'] <= 2499 )echo htmlspecialchars( $data['15'], ENT_QUOTES ) . '<br />';
			else
			if ( $ank['balls'] >= 2500 && $ank['balls'] <= 2749 )echo htmlspecialchars( $data['16'], ENT_QUOTES ) . '<br />';
			else
   if ( $ank['balls'] >= 2750 && $ank['balls'] <= 2999 )echo htmlspecialchars( $data['17'], ENT_QUOTES ) . '<br />';
   else
   if ( $ank['balls'] >= 3000 && $ank['balls'] <= 3249 )echo htmlspecialchars( $data['18'], ENT_QUOTES ) . '<br />';
   else
   if ( $ank['balls'] >= 3250 && $ank['balls'] <= 3499 )echo htmlspecialchars( $data['19'], ENT_QUOTES ) . '<br />';
   else
   if ( $ank['balls'] >= 3500 && $ank['balls'] <= 4999 )echo htmlspecialchars( $data['20'], ENT_QUOTES ) . '<br />';
   else
   if ( $ank['balls'] >= 5000 && $ank['balls'] <= 7499 )echo htmlspecialchars( $data['21'], ENT_QUOTES ) . '<br />';
   else
   if ( $ank['balls'] >= 7500 && $ank['balls'] <= 9999 )echo htmlspecialchars( $data['22'], ENT_QUOTES ) . '<br />';
   else
   if ( $ank['balls'] >= 10000 ) echo htmlspecialchars( $data['23'], ENT_QUOTES ) . '<br />';

 echo 'Статус: ';
if($ank['balls']>=0 && $ank['balls']<=100)echo "Призывник</a><br >";
if($ank['balls']>=101 && $ank['balls']<=250)echo "Младший сержант <img src='/rank/250.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=251 && $ank['balls']<=400)echo "Сержант <img src='/rank/400.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=401 && $ank['balls']<=600)echo "Старший сержант <img src='/rank/600.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=601 && $ank['balls']<=750)echo "Старшина <img src='/rank/750.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=751 && $ank['balls']<=900)echo "Прапорщик <img src='/rank/900.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=901 && $ank['balls']<=1000)echo "Старший прапорщик <img src='/rank/1000.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=1001 && $ank['balls']<=1249)echo "Младший лейтенант <img src='/rank/1249.png' alt='' class='icon'</a><br />";
if($ank['balls']>=1250 && $ank['balls']<=1499)echo "Лейтенант <img src='/rank/1449.png' alt='' class='icon'</a><br />";
if($ank['balls']>=1500 && $ank['balls']<=1749)echo "Старший лейтенант <img src='/rank/1749.png' alt='' class='icon'</a><br />";
if($ank['balls']>=1750 && $ank['balls']<=1999)echo "Капитан <img src='/rank/1999.png' alt='' class='icon'</a><br/>";
if($ank['balls']>=2000 && $ank['balls']<=2249)echo "Майор <img src='/rank/2249.png' alt='' class='icon'</a><br/>";
if($ank['balls']>=2250 && $ank['balls']<=2549)echo "ХЕР-Майор <img src='/rank/2499.png' alt='' class='icon'</a><br />";
if($ank['balls']>=2500 && $ank['balls']<=2749)echo "Подполковник <img src='/rank/2749.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=2750 && $ank['balls']<=2999)echo "Полковник <img src='/rank/2999.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=3000 && $ank['balls']<=3249)echo "Генерал-майор <img src='/rank/3249.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=3250 && $ank['balls']<=3499)echo "Генерал-лейтенант <img src='/rank/3499.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=3500 && $ank['balls']<=4999)echo "Генерал-полковник <img src='/rank/4999.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=5000 && $ank['balls']<=7499)echo "Главнокомандующий <img src='/rank/7499.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=7500 && $ank['balls']<=9999)echo "Маршал <img src='/rank/9999.gif' alt='' class='icon'</a><br />";
if($ank['balls']>=10000)echo "Неприкасаемый<img src='/rank/10000.png' alt='' class='icon'</a><br />";

if($ank['aa2'] > 29)

{
echo "<font color='red'><b>";
echo $ank['pol'] == 1 ? "<img src='/korona.gif' alt='korona' class='icon' /> Король гаремов<br />" : "<img src='/korona.gif' alt='korona' class='icon' /> Королева гаремов<br />";
echo "</b></font>";
}

if($ank['aa3'] > 29)
{
echo "<font color='red'><b>";
echo $ank['pol'] == 1 ? "Суперский парень<br />" : "Суперская девушка<br />";
echo "</b></font>";
}


echo '</div>';
echo '<div class="menu">';

if ($ank['ank_name']!=NULL)echo "<span class=\"ank_n\">Имя:</span> <span class=\"ank_d\">$ank[ank_name]</span><br />\n";
echo "<span class=\"ank_n\">Пол:</span> <span class=\"ank_d\">".(($ank['pol']==1)?'Парень':'Девушка')."</span><br />\n";
$d1sql = mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE (`user` = '$user[id]' AND `to` = '$ank[id]') OR (`user` = '$ank[id]' AND `to` = '$user[id]') LIMIT 1");
$d2sql = mysql_query("SELECT COUNT(*) FROM `frends` WHERE (`user` = '$ank[id]' AND `frend` = '$user[id]') OR (`user` = '$user[id]' AND `frend` = '$ank[id]') LIMIT 1");
if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
if ($ank['ank_m_r']==1)$ank['mes']='Января';
elseif ($ank['ank_m_r']==2)$ank['mes']='Февраля';
elseif ($ank['ank_m_r']==3)$ank['mes']='Марта';
elseif ($ank['ank_m_r']==4)$ank['mes']='Апреля';
elseif ($ank['ank_m_r']==5)$ank['mes']='Мая';
elseif ($ank['ank_m_r']==6)$ank['mes']='Июня';
elseif ($ank['ank_m_r']==7)$ank['mes']='Июля';
elseif ($ank['ank_m_r']==8)$ank['mes']='Августа';
elseif ($ank['ank_m_r']==9)$ank['mes']='Сентября';
elseif ($ank['ank_m_r']==10)$ank['mes']='Октября';
elseif ($ank['ank_m_r']==11)$ank['mes']='Ноября';
else $ank['mes']='Декабря';
echo "Дата рождения: $ank[ank_d_r] $ank[mes] $ank[ank_g_r]г.<br />";
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
elseif (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
echo "Возраст: $ank[ank_age] лет<br />\n";
}
elseif($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL)
{
if ($ank['ank_m_r']==1)$ank['mes']='Января';
elseif ($ank['ank_m_r']==2)$ank['mes']='Февраля';
elseif ($ank['ank_m_r']==3)$ank['mes']='Марта';
elseif ($ank['ank_m_r']==4)$ank['mes']='Апреля';
elseif ($ank['ank_m_r']==5)$ank['mes']='Мая';
elseif ($ank['ank_m_r']==6)$ank['mes']='Июня';
elseif ($ank['ank_m_r']==7)$ank['mes']='Июля';
elseif ($ank['ank_m_r']==8)$ank['mes']='Августа';
elseif ($ank['ank_m_r']==9)$ank['mes']='Сентября';
elseif ($ank['ank_m_r']==10)$ank['mes']='Октября';
elseif ($ank['ank_m_r']==11)$ank['mes']='Ноября';
else $ank['mes']='Декабря';
echo "День рождения: $ank[ank_d_r] $ank[mes]<br />";
}
if ($ank['ank_d_r']>=19 && $ank['ank_m_r']==1){echo " <img src='/style/zod/1.jpg'><br /><span class=\"status\"> Зодиак:</span> Водолей<br />";}
elseif ($ank['ank_d_r']<=19 && $ank['ank_m_r']==2){echo " <img src='/style/zod/1.jpg'><br /><span class=\"status\"> Зодиак:</span> Водолей<br />";}
elseif ($ank['ank_d_r']>=18 && $ank['ank_m_r']==2){echo " <img src='/style/zod/2.jpg'><br /><span class=\"status\"> Зодиак:</span> Рыбы<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==3){echo " <img src='/style/zod/2.jpg'><br /><span class=\"status\"> Зодиак:</span> Рыбы<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==3){echo " <img src='/style/zod/3.jpg'><br /><span class=\"status\"> Зодиак:</span> Овен<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==4){echo " <img src='/style/zod/3.jpg'><br /><span class=\"status\"> Зодиак:</span> Овен<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==4){echo " <img src='/style/zod/4.jpg'><br /><span class=\"status\"> Зодиак:</span> Телец<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==5){echo " <img src='/style/zod/4.jpg'><br /><span class=\"status\"> Зодиак:</span> Телец<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==5){echo " <img src='/style/zod/5.jpg'><br /><span class=\"status\"> Зодиак:</span> Близнецы<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==6){echo " <img src='/style/zod/5.jpg'><br /><span class=\"status\"> Зодиак:</span> Близнецы<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==6){echo " <img src='/style/zod/6.jpg'><br /><span class=\"status\"> Зодиак:</span> Рак<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==7){echo " <img src='/style/zod/6.jpg'><br /><span class=\"status\"> Зодиак:</span> Рак<br />";}
elseif ($ank['ank_d_r']>=23 && $ank['ank_m_r']==7){echo " <img src='/style/zod/7.jpg'><br /><span class=\"status\"> Зодиак:</span> Лев<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==8){echo " <img src='/style/zod/7.jpg'><br /><span class=\"status\"> Зодиак:</span> Лев<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==8){echo " <img src='/style/zod/8.jpg'><br /><span class=\"status\"> Зодиак:</span> Дева<br />";}
elseif ($ank['ank_d_r']<=23 && $ank['ank_m_r']==9){echo " <img src='/style/zod/8.jpg'><br /><span class=\"status\"> Зодиак:</span> Дева<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==9){echo " <img src='/style/zod/9.jpg'><br /><span class=\"status\"> Зодиак:</span> Весы<br />";}
elseif ($ank['ank_d_r']<=23 && $ank['ank_m_r']==10){echo " <img src='/style/zod/9.jpg'><br /><span class=\"status\"> Зодиак:</span> Весы<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==10){echo " <img src='/style/zod/10.jpg'><br /><span class=\"status\"> Зодиак:</span> Скорпион<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==11){echo " <img src='/style/zod/10.jpg'><br /><span class=\"status\"> Зодиак:</span> Скорпион<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==11){echo " <img src='/style/zod/11.jpg'><br /><span class=\"status\"> Зодиак:</span> Стрелец<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==12){echo " <img src='/style/zod/11.jpg'><br /><span class=\"status\"> Зодиак:</span> Стрелец<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==12){echo " <img src='/style/zod/12.jpg'><br /><span class=\"status\"> Зодиак:</span> Козерог<br />";}
elseif ($ank['ank_d_r']<=20 && $ank['ank_m_r']==1){echo " <img src='/style/zod/12.jpg'><br /><span class=\"status\"> Зодиак:</span> Козерог<br />";}
if (isset($user) && $user['id']==$ank['id'])echo "<br />\n";

if($ank['balls']>=0 && $ank['balls']<=9){echo "<img src='/style/iconesSvIgRo/249.png'>\n";}
if($ank['balls']>=10 && $ank['balls']<=249){echo "<img src='/style/iconesSvIgRo/250.png'>\n";}
if($ank['balls']>=250 && $ank['balls']<=999){echo "<img src='/style/iconesSvIgRo/999.png'>\n";}
if($ank['balls']>=1000 && $ank['balls']<=4999){echo "<img src='/style/iconesSvIgRo/4999.png'>\n";}
if($ank['balls']>=5000 && $ank['balls']<=9999){echo "<img src='/style/iconesSvIgRo/9999.png'>\n";}
if($ank['balls']>=10000 && $ank['balls']<=24999){echo "<img src='/style/iconesSvIgRo/24999.png'>\n";}
if($ank['balls']>=25000 && $ank['balls']<=49999){echo "<img src='/style/iconesSvIgRo/49999.png'>\n";}
if($ank['balls']>=50000 && $ank['balls']<=99999){echo "<img src='/style/iconesSvIgRo/99999.png'>\n";}
if($ank['balls']>=100000 && $ank['balls']<=10000){echo "<img src='/style/iconesSvIgRo/100000.png'>\n";}
echo "<br/>\n";

echo '<font color="#'.$ank['prcolor'].'"><a href=\'privet.php\'>';

if ($ank['privet']!=NULL)echo esc(trim(br(bbcode(smiles(stripcslashes(htmlspecialchars($ank['privet'])))))))."\n";

else
echo "Всем привет!\n";






echo "</a></font>\n";

if (isset($user) && $user['id']==$ank['id'])echo "[<a href='pages/prcolor.php'><font color='FF0000'>Изм. цвет</font></a>]\n";


echo "<br/>\n";

echo '</div>';

echo '<div class="menu">';


if (isset($user) && $user['id']==$ank['id'])echo "\n";


echo " <a href='/ava/?id=".$ank['id']."'>";
 avatar($ank['id']);
 echo "</a>";



if ($ank['rating']>='0' && $ank['rating']<='100'){

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='101' && $ank['rating']<='200'){

$z='100';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='201' && $ank['rating']<='300'){

$z='200';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='301' && $ank['rating']<='400'){

$z='300';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='401' && $ank['rating']<='500'){

$z='400';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='501' && $ank['rating']<='600'){

$z='500';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='601' && $ank['rating']<='10000'){

$z='10000';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}



echo ' <img src="/style/themes/green/graph/avacom.gif" alt="avacom"/>  <a href="ava_comm.php?uid='.$ank['id'].'">Обсудить аву</a> ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `akimitsu_com` WHERE `uid` = '$ank[id]';"),0).')';



{

echo ' <a href="settings.php?p=avatar">Изм. аву</a>';

}

if ($ank['id'] == 20)
echo "<br />Местный программист... =)<br/></div>\n";else
echo '</br>';

if ($ank['rating']>='0' && $ank['rating']<='100'){
echo '<div style="border-top:1px solid #ccccaa;background-color:#eeeedd;height:17px;width:215px"><div style="background-color:#cccccc;height:17px;width:'.$ank['rating'].'%;"></div><span style="position:relative;top:-15px;left:45%;right:57%;color:#888888;">'.$ank[rating].'%</span></div>';}
if ($ank['rating']>='101' && $ank['rating']<='200'){
$z='100';
$s=$ank['rating'] - $z;
echo '<div style="border-top:1px solid #ccccaa;background-color:#cccccc;height:17px;width:215px"><div style="background-color:#bbbbbb;height:17px;width:'.$s.'%;"></div><span style="position:relative;top:-15px;left:45%;right:57%;color:#777777;">'.$ank[rating].'%</span></div>';}
if ($ank['rating']>='201' && $ank['rating']<='300'){
$z='200';
$s=$ank['rating'] - $z;
echo '<div style="border-top:1px solid #999988;background-color:#bbbbbb;height:17px;width:215px"><div style="background-color:#aaaaaa;height:17px;width:'.$s.'%;"></div><span style="position:relative;top:-15px;left:45%;right:57%;color:#666666;">'.$ank[rating].'%</span></div>';}
if ($ank['rating']>='301' && $ank['rating']<='400'){
$z='300';
$s=$ank['rating'] - $z;
echo '<div style="border-top:1px solid #888877;background-color:#aaaaaa;height:17px;width:215px"><div style="background-color:#999999;height:17px;width:'.$s.'%;"></div><span style="position:relative;top:-15px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}
if ($ank['rating']>='401' && $ank['rating']<='500'){
$z='400';
$s=$ank['rating'] - $z;
echo '<div style="border-top:1px solid #777766;background-color:#999999;height:17px;width:215px"><div style="background-color:#888888;height:17px;width:'.$s.'%;"></div><span style="position:relative;top:-15px;left:45%;right:57%;color:#444444;">'.$ank[rating].'%</span></div>';}
if ($ank['rating']>='501' && $ank['rating']<='600'){
$z='500';
$s=$ank['rating'] - $z;
echo '<div style="border-top:1px solid #666655;background-color:#888888;height:17px;width:215px"><div style="background-color:#777777;height:17px;width:'.$s.'%;"></div><span style="position:relative;top:-15px;left:45%;right:57%;color:#333333;div class= Зодиак:border-top:1px solid #777766;background-color:#999999;h=1999)echo \\ni br /\nmg src=n i br /\nmg src=eight:17px;width:2br /15px">'.$ank[rating].'%</span></div>';}
if ($ank['rating']>='601' && $ank['rating']<='700'){
$z='600';
$s=$ank['rating'] - $z;
echo '<div style="border-top:1px solid #555544;background-color:#777777;height:17px;width:215px"><div style="background-color:#666666;height:17px;width:'.$s.'%;"></div><span style="position:relative;top:-15px;left:45%;right:57%;color:#222222;">'.$ank[rating].'%</span></div>';}

if (isset($user) && $user['id']==$ank['id'])
{
if($ank['ves_statys']=='')
{
echo'<a href="/ves_statys.php"><img src="/style/vstatys/0.png"></a><br />';
}
else
{
echo '<a href="/ves_statys.php">'.$ank['ves_statys'].'</a><br />';
}
}
if (isset($user) && $user['id']!=$ank['id'])
{
if($ank['ves_statys']=='')
{
echo'<img src="/style/vstatys/0.png"><br />';
}
else
{
echo ''.$ank['ves_statys'].'<br />';
}
}
################################################################################

$checkmcrbl=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog` WHERE `uid` = $ank[id]"),0);

if ($checkmcrbl!=0)
{
$mcrbl=mysql_fetch_array(mysql_query("SELECT * FROM `microblog` WHERE `uid` = '$ank[id]' ORDER BY `time` DESC LIMIT 1"));
if(isset($user))
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_see` WHERE `id_blog` = '$mcrbl[id]' AND `uid`='$user[id]' LIMIT 1"),0)==0)
{
mysql_query("INSERT INTO `microblog_see` (`id_blog`, `uid`, `time_last`) VALUES ('$mcrbl[id]', '$user[id]', '$time')");
}
else
{
$guest=mysql_fetch_array(mysql_query("SELECT * FROM `microblog_see` WHERE `id_blog` = '$mcrbl[id]' AND `uid`='$user[id]' LIMIT 1"));
mysql_query("UPDATE `microblog_see` SET `times` = '".($guest['times']+1)."', `time_last`='$time' WHERE `id` = '$guest[id]' LIMIT 1");
}
}


$komall=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_komm` WHERE `id_blog` = '$mcrbl[id]'"),0);

echo "<div class='triangle2'></div><a href='/microblog/all.php?id=$ank[id]'><div class='trianglerect2'>";
echo "<span style='color:$ank[prcolor]'>".esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($mcrbl['text']))))))))."</span></div></a>";
$komms=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_komm` WHERE `id_blog` = '$mcrbl[id]'"),0);
$superall=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_klass` WHERE `id_blog` = '$mcrbl[id]'"),0);
$superyou=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_klass` WHERE `id_blog` = '$mcrbl[id]' AND `uid` = '$user[id]'"),0);
$see=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_see` WHERE `id_blog` = '$mcrbl[id]'"),0);
$superother=$superall-$superyou;
echo "<img src='/img/microblog/bubl.png' alt='' /> <a href='/microblog/microblog.php?id=$mcrbl[id]'>$komms</a> &bull; ";
if ($superyou!=0)
{
echo "<img src='/img/microblog/cls.png' alt='' /> Вы <span style='text-decoration:underline'>и ещё <a href='microblog/klasslist.php?id=$mcrbl[id]'>$superother чел.</a></span>";
}
if ($superyou==0)
{
echo "<img src='/img/microblog/cls.png' alt='' /> <a href='/microblog/klass.php?id=$mcrbl[id]'>Kласс!</a> <span style='text-decoration:underline'><a href='microblog/klasslist.php?id=$mcrbl[id]'>$superother чел.</a></span>";
}
echo " &bull; <span style='color:red'>".vremja($mcrbl['time'])."</span>";
echo " &bull; <img src='/img/microblog/eye.png' alt='' /> <a href='microblog/see.php?id=$mcrbl[id]'>$see</a><br/>";
$allmcrbl=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog` WHERE `uid` = '$ank[id]'"),0);
if ($allmcrbl>1)
{
echo " &bull; <span style='text-decoration:underline'><a href='microblog/all.php?id=$ank[id]'>Все микроблоги</span> $allmcrbl</a>";
}
echo "</div>";
}
if ($checkmcrbl==0)
{
echo "<div class='triangle2'></div><a href='/microblog/all.php?id=$ank[id]'><div class='trianglerect2'>";
echo "<span style='color:$ank[prcolor]'>Я люблю MAxSoC.Ru !</span></div></a>";
}


if (isset($user) && $user['id']==$ank['id'])

{

echo "<div class='page_foot'> \n";

echo "<img src='/img/img/ava.png' alt='' class='icon'/> <a href='settings.php?p=avatar'>Изменить аватар</a></div>";
echo "<div class='guser_aut'>";

include_once 'pod/inc.php';

echo "<img src='/img/tabor/settings.gif' alt='' class='icon'/> \n";

echo "<a href='settings.php?id=$user[id]'>Настройки страницы</a><br />";


echo'<img src="/img/tabor/news.gif" alt="" class="icon"/> <a href="/news/">Новости</a>';
include "news/count.php";
echo "<br/><img src='/img/vote_yes.gif' alt=''> <a href='/money/uslugi.php?p=rating/'>Повысить рейтинг</a>\n";
echo "<br/><img src='/imag/info/vip.gif' alt=''> <a href='/status_vip/'>Управление VIP</a>\n";


echo "<br/><img src='/img/tabor/zver.png' alt='' class='icon'/> \n";
echo "<a href='/pets/pet.php'>Изменить зверька</a>\n";
echo '<br /><img src="/img/tabor/frends.gif" alt="" class="icon"/> <a href="/my_guest.php">Мои гости</a><br/>';

echo "<img src='/img/tabor/4gif.gif' alt='' class='icon'/> \n";

echo "<a href='lenta.php?id=$user[id]'>Лента друзей </a><br />";


$k_bl = mysql_result(mysql_query("SELECT COUNT(*) FROM `blacklist` WHERE `user` = '$ank[id]'"), 0);
echo '<img src="img/img/chs.png" alt="" class="icon"/> <a href="blacklist.php?id='.$ank['id'].'">Черный список</a> ('.$k_bl.')';$d2sql = mysql_query("SELECT COUNT(*) FROM `blacklist` WHERE (`user` = '$user[id]' AND `lol` = '$ank[id]') LIMIT 1");
if (isset($user) && $user['id']!=$ank['id'] && mysql_result($d2sql, 0)==0)


echo "</div>";
echo "</div>";

}

if(mysql_result(mysql_query("SELECT COUNT(*) FROM `garem` WHERE `id_user`='".$ank['id']."'"),0)==1){
$garem=mysql_fetch_assoc(mysql_query("SELECT * FROM `garem` WHERE `id_user` = $ank[id] LIMIT 1"));
$us = get_user($garem['id_garem']);
echo'В гареме у <a href="info.php?id='.$us['id'].'"><b>'.$us['nick'].'</b></a><br/>';
}




if (isset($user) && $user['id']!=$ank['id']){

echo "<div class='guser_aut'>";
include_once 'pod/inc.php';

echo "<img src='img/tabor/inbox.png' alt='' class='icon'/> <a href=\"/mail.php?id=$ank[id]\"> Написать в приват</a><br />\n";

if (isset($user) && $user['id']!=$ank['id'])echo "<img src='/pages/add.png'> <a href=\"/pages/snejok.php?id=$ank[id]\">Кинуть снежок</a> (100б.)<br />\n";

if(mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_new` WHERE `id_user`='$user[id]' AND `id_opponent`='$ank[id]'"),0)==0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `duel` WHERE (`id_user`='$ank[id]' OR `id_opponent`='$ank[id]')"),0)==0 && $ank['id']!=$user['id'] && $user){

}



$mod_dei=mysql_result(mysql_query("SELECT COUNT(*) FROM `mod_dei_go` WHERE `uid` = '$ank[id]'"),0);
echo "<span class=\"ank_n\"><img src='img/dei.png' alt='' class='icon'/> <a href='de/dei.php?uid=$ank[id]'>Совершить действие</a></span> <span class=\"ank_d\">$mod_dei</span><br />\n";


if($ank['time_status_vip'] < time()){
echo "<img src='/status_vip/img/vip3.gif' alt=''> <a href='/status_vip/opvip.php?to=$ank[id]'>Подарить VIP</a><br/>";}

echo "<img src='img/tabor/duels.gif' alt='' class='icon'/> <a href=\"/duels.php?act=inser&id=$ank[id]\"> Вызвать на дуэль</a><br />\n";


if (isset($user) && $user['id']!=$ank['id'] && mysql_result($d1sql, 0)==0 && mysql_result($d2sql, 0)==0)
{

if (isset($user) && $user['id']!=$ank['id']) echo '<div class="row4"><img src="/img/tabor/add_frends.gif" alt="" class="icon"/> <a href="/frend_add.php?id='.$ank[id].'">Предложить дружбу</a></div>';

}
else
{
if (isset($user) && $user['id']!=$ank['id']) echo '<div class="row4"><img src="img/error.gif" alt="" class="icon"/> <a href="info.php?id='.$ank['id'].'&frend=del">Удалить из друзей</a></div>';
}

if($ank['aa1'] != $user['id'] && $ank['pol'] != $user['pol']) 
echo "<img src='/img/tabor/home.png' alt='' class='icon'/><a href=\"/garem.php?act=kraz&id=$ank[id]\"> Украсть к себе в гарем</a><br />\n";



{echo '<img src="img/img/chs.png" alt="" class="icon"/> <a href="blacklist_add.php?id='.$ank['id'].'">Добавить в черный список</a><br/>';


}

}

if (isset($user) && $user['id']!=$ank['id'] && mysql_result($d1sql, 0)==0 && mysql_result($d2sql, 0)==0) 

{



echo "</div>";
}

else

{


if ($user['pol'] != $ank['pol'] && $user['gorod_brak'] == null && $ank['gorod_brak'] == null)print '<img src="/img/img/rings.gif" alt="" class="icon"/>  <a href="zags.php?id='.$ank['id'].'">Сделать предложение</a><br/>';


}
}
echo "</div>";

echo "<div class='menu'>";
$clan=mysql_fetch_assoc(mysql_query("SELECT * FROM `clan_user` WHERE  `id_user` = '$ank[id]' AND `activaty` = '0' LIMIT 1"));
$clan_name=mysql_fetch_assoc(mysql_query("SELECT * FROM `clan` WHERE `id`= '$clan[id_clan]' LIMIT 1"));
echo 'В клане: '.$clan_name['name'].'<br/>';


echo "</div>";

if($user[id]==$ank[id]) {

echo "<div class='str'>";



$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `clan_user` WHERE `id_clan` = '$clan[id]' AND `activaty` = '0'"),0);
echo "<img src='/style/themes/green/graph/3gif.gif' alt='' class='icon'/> <a href='/klan/myklan.php'>Мой клан</a><font color='#6f9500'> $count чел.</font><br/>\n";


}

//=======================

echo "<img src='img/tabor/ank.gif' alt='' class='icon'/> \n";

echo "<a href='ank.php?id=$ank[id]'> Анкета</a><br/>\n";

echo "<img src='img/tabor/friends.gif' alt='' class='icon'/> \n";

$k_fr = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$ank[id]' AND `i` = '1'"), 0);


echo '<a href="frend.php?id='.$ank['id'].'">Друзья</a><font color="#FF0000"> ('.$k_fr.')</font><br>';

if ($ank['gorod_brak']!=NULL){
$an=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ank[gorod_brak] LIMIT 1"));


if ($ank['id'] == $user['id']){
if ($ank['pol'] == 1)echo 'Женат на: <a href="info.php?id='.$an['id'].'">'.$an['nick'].'</a> | <a href="zags.php?r&id='.$user['gorod_brak'].'">Развод!</a><br/>';
if ($ank['pol'] == 0)echo 'Замужем за: <a href="info.php?id='.$an['id'].'">'.$an['nick'].'</a> | <a href="zags.php?r&id='.$user['gorod_brak'].'">Развод</a><br/>';
}else
{
if ($ank['pol'] == 1)echo 'Женат на: <a href="info.php?id='.$an['id'].'">'.$an['nick'].'</a><br/>';
if ($ank['pol'] == 0)echo 'Замужем за: <a href="info.php?id='.$an['id'].'">'.$an['nick'].'</a><br/>';


}

}
echo'<img src="/img/tabor/home.png" alt="!"> ';
echo "<a href='/garem.php?act=garem&id=$ank[id]/'>Гарем</a> <font color='#FF0000'>($ank[aa2])</font><br/>";

if(intval($ank['aa1']) != 0)
{
   $cena = ((($ank['aa3']-1)*100)+250);
   if(isset($_GET['garemout']))
   {
         if($user['balls'] < $cena)
            echo "<font color='red'><b>Недостаточно балов</b></font><br/>";
         else
         {
            $etr = 1;
            echo "<font color='red'><b>Вы выкупили себя из гарема.</b></font><br/>";
            $msgno = ''.$user['nick'].' выкупил себя из вашего гарема';
            mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '".$ank['aa1']."', '".$msgno."', '".$time."')");
            mysql_query("UPDATE `user` SET `balls` = `balls`-$cena, `aa1` = '' WHERE `id` = '".$user['id']."';");
         }
   }
   if(!$etr)
   {
   echo "<img src='img/tabor/home.png' alt='' class='icon'/> \n";
      $anker = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".$ank['aa1']."' LIMIT 1"));   
      echo "В гареме у <a href='info.php?id=".$ank['aa1']."'><strong>".$anker['nick']."</strong></a><br />";
      if($ank['id'] == $user['id'])
      {
         echo "<a href='?id=$user[id]&garemout'>Выкупить себя</a> [$cena баллов]<br/>";
      }
   }
}
echo "<img src='img/tabor/home.png' alt='' class='icon'/> \n";
$pol = ($ank['pol']==1) ? '' : 'а';
echo "Украден$pol : <strong>".$ank['aa3']."</strong> раз.<br />\n";



$foto = mysql_num_rows(mysql_query("SELECT `id` FROM `gallery` WHERE `id_user` = '$ank[id]'"));

echo "<img src='img/tabor/2foto.png' alt='' class='icon'/> \n";

echo "<a href='/foto/$ank[id]/'>Aльбомы</a> <font color='#FF0000'>($foto)</font><br/>";

echo "<img src='/img/tabor/files.gif' alt='' /> <a href='/my/files.php?id=$ank[id]'>Залитые файлы</a> \n";
echo "(".mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `id_user` = '$ank[id]'"),0).")<br/>"; 

echo "<img src='/img/tabor/25444.png' alt='' class='icon'/>\n";

echo "<a href=\"/us_guest/index.php?id=$ank[id]\">Гостевая</a>";

$k_p_g=mysql_result(mysql_query("SELECT COUNT(*) FROM `us_guest` WHERE `id_user_adm` = $ank[id] ",$db), 0);

echo " <font color='#FF0000'>$k_p_g</font><br />";

echo "<img src='/img/tabor/054.png' alt='' class='icon'/>\n";

echo "<a href=\"/us_mnenija/index.php?id=$ank[id]\">Мнения</a>";

$k_p_g=mysql_result(mysql_query("SELECT COUNT(*) FROM `us_mnenija` WHERE `id_user_adm` = $ank[id] ",$db), 0);

echo " <font color='#FF0000'>$k_p_g</font><br />";
echo "<img src='/img/make.png' alt='' class='icon'/> <a href='/dei/index.php?id=$ank[id]'>Действия";
echo "</a>\n";
include_once 'dei/count.php';
echo "<br/></div>\n";

echo "<img src='img/tabor/7gif.gif' alt='' class='icon'/> \n";
echo "<a href=\"/blog/user.php?id=$ank[id]\">Дневники</a>";

include_once 'blog/count.php';




if (isset($user) && $user['id']==$ank['id'])

{
echo "<img src='img/tabor/inbox.png' alt='' class='icon'/>  <a href=\"/mail.php\">Контакты</a><br />\n";


$jn=mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
echo "<img src='img/tabor/avacom.gif' alt='' class='icon'/>  <a href=\"/jurnal.php\" title=\"Журнал\">Журнал</a>\n";
if ($jn>0) echo "(+$jn)\n";
echo "<br/>\n";

$fobian = mysql_fetch_array(mysql_query("SELECT * FROM `pets` WHERE `user_id` = '".$ank['id']."'"));
if (isset($fobian['user_id']) AND $fobian['pet_id'] >= 1) {
$ost = $realtime - $fobian['time'];
if ($ost > 604800) mysql_query("UPDATE `pets` SET `pet_id` = '0', `time` = '0' WHERE `user_id` = '".$ank['id']."'");
echo '<span style="float : right;"><img src="/pets/img/' . $fobian['pet_id'] . '.png" alt="" border="0"/></span>';
}





$forum_zakl=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_zakl` WHERE `id_user` = '$ank[id]'"),0);
echo "<img src='img/tabor/pushpin.gif' alt='' class='icon'/>   <a href='/zakl.php'>Закладки</a> ($forum_zakl)<br />";



echo "<img src='img/tabor/home.png' alt='' class='icon'/>  <a href='/gorod/index.php'>Город</a> ";
include 'gorod/count.php';

}

if (isset($user) && $user['id']==$ank['id'])

{
echo "<img src='img/tabor/ico_rati.png' alt='' class='icon'/> \n";

echo '<a href="/my_rating.php">Рейтинг:</a>';

echo "<font color='#FF0000'> $ank[rating]</font>";

}

if (isset($user) && $user['id']!=$ank['id'])

{

echo "<img src='img/tabor/ico_rati.png' alt='' class='icon'/> \n";

echo 'Рейтинг:';

echo "<font color='#FF0000'> $ank[rating]</font>";

}

echo "<br />\n";

echo "<img src='img/tabor/zone_money.png' alt='' class='icon'/> \n";

echo "Баллы:\n";

echo "<font color='#FF0000'>$ank[balls]</font>";

echo "<br/>\n";


$pol = ($ank['pol']==1) ? '' : 'а';
echo "<img src='sneg.png' alt='' class='icon'/> \n";
echo "Кинул$pol снежков: $ank[s_kinyl]<br />\n";
echo "<img src='sneg.png' alt='' class='icon'/> \n";
echo "Кинули <b>$ank[s_kinyli]</b> снежков<br />\n";
#########

echo "<img src='img/tabor/um.png' alt='' class='icon'/> \n";

echo "IQ-баллы:\n";

echo "<font color='#FF0000'>$ank[iq]</font>";

echo "<br/>\n";
if($user['balls']>0 AND $ank['id']<>$user['id'])
{
echo "<img src='img/tabor/084.png' alt='' class='icon'/> <a href='give_balls.php?id=".$ank['id']."'>Поделиться баллами</a><br />\n";
}


$kule1=mysql_result(mysql_query("SELECT COUNT(*) FROM `duels` WHERE `idur` = '$ank[id]' AND `kolur` > `koler` AND `act` = '2'"),0);$kule2=mysql_result(mysql_query("SELECT COUNT(*) FROM `duels` WHERE `ider` = '$ank[id]' AND `koler` > `kolur` AND `act` = '2'"),0); $obshij = ($kule1+$kule2);  echo "<img src='img/tabor/duels.gif' alt='' class='icon'/>  Выигранных дуэлей:\n";echo"<fontcolor='#FF0000'>$obshij</font><br/>";$kuleq1=mysql_result(mysql_query("SELECT COUNT(*) FROM `duels` WHERE `idur` = '$ank[id]' AND `kolur` < `koler` AND `act` = '2'"),0);$kuleq2=mysql_result(mysql_query("SELECT COUNT(*) FROM `duels` WHERE `ider` = '$ank[id]' AND `koler` < `kolur` AND `act` = '2'"),0); $obshijq = ($kuleq1+$kuleq2);  echo "<img src='img/tabor/duels.gif' alt='' class='icon'/> Проигранных дуэлей:\n"; echo"<font color='#FF0000'>$obshijq</font><br/>"; 
echo "</div>\n";

echo "<div class='page_foot'> \n";

if ($ank['status_vip'] > 0) print '<img src="/status_vip/img/vip1.gif">VIP житель<br />';
if ($ank['ank_enter'] == '2' && !isset($user))


$user_id = $ank['id'];

if(!isset($_GET['wall']))
{
	echo '<div class="menu"><b><img src="img/tabor/wall.gif" alt="" class="icon"/><a href="info.php?id='.$user_id.'&wall"> [+] Стена</a></b></div>';
}
else
{
	echo '<div class="menu"><b><img src="img/tabor/wall.gif" alt="" class="icon"/> <a href="info.php?id='.$user_id.'"> [-] Стена</a></b></div>';

	# Удаление сообщений:
	if(isset($_GET['delete']) AND !empty($_GET['delete']))
	{
		$delete = (int)$_GET['delete'];

		if($user['level'] > 3 OR $ank['id'] == $user['id'])
		{
			$query = @mysql_query("SELECT `id` FROM `wall` WHERE `user_id` = '$user_id' AND `id` = '$delete';");

			if(@mysql_affected_rows() > 0)
			{
				@mysql_query("DELETE FROM `wall` WHERE `user_id` = '$user_id' AND `id` = '$delete' LIMIT 1;");

				echo '<div class="news">Сообщение успешно удалено!</div>';
			}
			else
				echo '<div class="news">Сообщение не найдено!</div>';
		}
		else
			echo '<div class="news">У Вас нет прав для удаления этого сообщения!</div>';
	}

	# Добавление сообщений:
	if(isset($_POST['message']) AND isset($user))
	{
		$message = $_POST['message'];

		if(isset($_POST['translit']) AND $_POST['translit']) $message = translit($message);

		$err = '';

		if(strlen2($message) > 512) $err .= '��сообщение слишком длинное;<br/>';
		if(strlen2($message) < 2) $err .= '��короткое сообщение;<br/>';
		if(@mysql_result(@mysql_query("SELECT COUNT(*) FROM `wall` WHERE `user_id` = '$user_id' AND `message` = '".@mysql_escape_string($message)."' AND `time` > '".($time - 300)."' LIMIT 1"), 0) != 0) $err .= '��ваше сообщение повторяет предыдущее;<br/>';
		if(time() - @mysql_result(@mysql_query("SELECT `time` FROM `wall` WHERE `user_id` = '$user_id' ORDER BY `id` DESC LIMIT 1;"), 0) < 30) $err .= '��не стоит писать сообщения так часто..<br/>';

		if($err != '')
		{
			echo '<div class="news">При добавление сообщения произошли следующие ошибки:<br/>'.$err.'</div>';
		}
		else
		{
			$message = @mysql_escape_string($message);

			@mysql_query("INSERT INTO `wall` (`user_id`, `who`, `time`, `message`) values('$user_id', '".$user['id']."', '".time()."', '$message')");
			@mysql_query("UPDATE `user` SET `msg_on_wall` = `msg_on_wall` + 1 WHERE `id` = '".$user['id']."' LIMIT 1");

			if($user['id']!=$user_id){
            $msg = 'на Вашей стене появилась новая запись';
            mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '".$user_id."', '".$msg."', '".$time."')");
}
			echo '<div class="news">Сообщение успешно добавлено!</div>';
		}
	}

	# Вывод сообщений:
	echo '<div class="rekl_main">';

	$k_post = @mysql_result(@mysql_query("SELECT COUNT(*) FROM `wall` WHERE `user_id` = '$user_id'"), 0);
	$k_page = k_page($k_post, $set['p_str']);
	$page = page($k_page);
	$start = $set['p_str'] * $page - $set['p_str'];

	echo '<table class="post">';

	if(!$k_post)
	{
		echo '<tr><td class="p_t">Нет сообщений...</td></tr>';
	}

	function getAvatar($id)
	{
		global $set;

		if(is_file(H."sys/avatar/$id.gif"))
			return "<img src='/sys/avatar/$id.gif' alt='' />\n";
		elseif (is_file(H."sys/avatar/$id.jpg"))
			return "<img src='/sys/avatar/$id.jpg' alt='' />\n";
		elseif (is_file(H."sys/avatar/$id.png"))
			return "<img src='/sys/avatar/$id.png' alt='' />\n";
		else
			return "<img src='/style/themes/$set[set_them]/user.png' alt='' />\n";
	}


	$query = @mysql_query("SELECT * FROM `wall` WHERE `user_id` = '$user_id' ORDER BY `time` DESC LIMIT $start, $set[p_str];");
	while ($array = mysql_fetch_array($query))
	{
		$user_nick = @mysql_result(@mysql_query("SELECT `nick` FROM `user` WHERE `id` = '".$array['who']."';"), 0);

		echo '<tr>';

		if($set['set_show_icon'] == 2)
		{
			echo '<td class="icon48" rowspan="2">'.getAvatar($array['who']).'</td>';
		}
		if($set['set_show_icon'] == 1)
		{
			echo '<td class="icon14"><img src="/style/themes/'.$set['set_them'].'/user/'.$ank['pol'].'.png" alt=""/></td>';
		}

		echo
		'
				<td class="p_t">
					<a href="info.php?id='.$array['who'].'">'.$user_nick.'</a> '.online($array['who']).' ('.vremja($array['time']).')
				</td>
			</tr>
			<tr>
				<td class="p_m" colspan="2">
					'.esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($array['message'])))))))).'<br/>
		';

		if($user['level'] > 3 OR $ank['id'] == $user['id'])
		{
			echo '[<a href="info.php?id='.$user_id.'&wall&delete='.$array['id'].'">удалить</a>]';
		}

		echo
		'
				</td>
			</tr>
		';
	}

	echo '</table>';

	if($k_page > 1) str('info.php?id='.$user_id.'&wall&'.rand(1000, 9999).'&', $k_page, $page);

	echo '<div>';

	echo
	'
		<form method="post" action="info.php?id='.$user_id.'&wall">
			Сообщение?<br/>
			<textarea name="message"></textarea><br/>
	';

	if($user['set_translit']) echo '<label><input type="checkbox" name="translit" value="1"/>Транслит</label><br/>';

	echo
	'
			<input type="submit" value="Написать на стене"/>
		</form>
	';

	echo '</div>';
	echo '</div>';

	echo '<div class="menu"><b><a href="info.php?id='.$user_id.'">[-] Стена</a></b></div>';

	echo '<!-- (C)oded by i0n1x -->';
}



if (isset($user) && isset($access['user_voice']) && $user['id']!=$ank['id'] && $user['balls']>=0 && $user['rating']>=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `user_voice` WHERE `id_user` = '$user[id]' AND `id_kont` = '$ank[id]'"), 0)==0)

{
echo "<div class='guser_aut'>";
echo "Проголосовать за страничку:</br>";

echo " <a href=\"/info.php?id=$ank[id]&rating=1\"><img src='/img/irisha/1.png' alt='' class='icon'/></a> ";

echo "<a href=\"/info.php?id=$ank[id]&rating=2\" ><img src='/img/irisha/2.png' alt='' class='icon'/></a> ";

echo "<a href=\"/info.php?id=$ank[id]&rating=3\" ><img src='/img/irisha/3.png' alt='' class='icon'/></a> ";

echo "<a href=\"/info.php?id=$ank[id]&rating=4\"><img src='/img/irisha/4.png' alt='' class='icon'/></a> ";

echo "<a href=\"/info.php?id=$ank[id]&rating=5\" ><img src='/img/irisha/5.png' alt='' class='icon'/></a> <br/>";


echo "</div>\n";
}
echo "<div class='gend'>";

echo "Посл. посещение: ".vremja($ank['date_last'])."<br />\n";

echo "Регистрация: ".vremja($ank['date_reg'])."<br />\n";
$timediff=mysql_result(mysql_query("SELECT `time` FROM `user` WHERE `id` = '$ank[id]' LIMIT 1",$db), 0);

$oneMinute=60; 
$oneHour=60*60; 
$oneDay=60*60*24; 
$dayfield=floor($timediff/$oneDay); 
$hourfield=floor(($timediff-$dayfield*$oneDay)/$oneHour); 
$minutefield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour)/$oneMinute); 
$secondfield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour-$minutefield*$oneMinute)); 

$sDaysLeft=$dayfield; 
$sDaysText = "дней"; 
$nDaysLeftLength =strlen($sDaysLeft); 
$d_1=substr($sDaysLeft,-1,1); 

if (substr($sDaysLeft,-2,1) != 1 && $nDaysLeftLength>1) 
{ 
    if ($d_1 == 2 || $d_1== 3 || $d_1== 4) 
    { 
        $sDaysText = "дня"; 
    } 
    elseif ($d_1== 1) 
    { 
        $sDaysText = "день"; 
    } 
} 
if ($nDaysLeftLength==1) 
{ 
    if ($d_1==2 || $d_1== 3 || $d_1== 4) 
    { 
        $sDaysText = "дня"; 
    } 
    elseif ($d_1== 1) 
    { 
        $sDaysText = "день"; 
    } 
} 

$sHoursLeft=$hourfield; 
$sHoursText = "часов"; 
$nHoursLeftLength = strlen($sHoursLeft); 
$h_1=substr($sHoursLeft,-1,1); 
if (substr($sHoursLeft,-2,1) != 1 && $nHoursLeftLength>1) 
{ 
    if ($h_1== 2 || $h_1== 3 || $h_1== 4) 
    { 
        $sHoursText = "часа"; 
    } 
    elseif ($h_1== 1) 
    { 
        $sHoursText = "час"; 
    } 
} 

if ($nHoursLeftLength==1) 
{ 
    if ($h_1== 2 || $h_1== 3 || $h_1== 4) 
    { 
        $sHoursText = "часа"; 
    } 
    elseif ($h_1== 1) 
    { 
        $sHoursText = "час"; 
    } 
} 

$sMinsLeft =$minutefield; 
$sMinsText = "минут"; 
$nMinsLeftLength = strlen($sMinsLeft); 
$m_1=substr($sMinsLeft,-1,1); 

if ($nMinsLeftLength>1 && substr($sMinsLeft,-2,1) != 1) 
{ 
    if ($m_1== 2 || $m_1== 3 || $m_1== 4) 
    { 
        $sMinsText = "минуты"; 
    } 
    else if ($m_1== 1) 
    { 
        $sMinsText = "минута"; 
    } 
} 

if ($nMinsLeftLength==1) 
{ 
    if ($m_1== 2 || $m_1==3 || $m_1== 4) 
    { 
        $sMinsText = "минуты"; 
    } 
    elseif ($m_1== "1") 
    { 
        $sMinsText = "минута"; 
    } 
} 

$sSecsLeft = $secondfield; 
$sSecsText = "секунд"; 
$s_1=substr($sSecsLeft,-1,1); 
$nSecsLeftLength = strlen($sSecsLeft); 
if (substr($sSecsLeft,-2,1)!= 1 && $nSecsLeftLength>1) 
{ 
    if ($s_1== 2 || $s_1== 3 || $s_1== 4) 
    { 
        $sSecsText = "секунды"; 
    } 
    elseif ($s_1== 1) 
    { 
        $sSecsText = "секунда"; 
    } 
} 

if ($nSecsLeftLength==1) 
{ 
    if ($s_1== 2 || $s_1== 3 || $s_1== 4) 
    { 
        $sSecsText = "секунды"; 
    } 
    elseif ($sSecsLeft== "1") 
    { 
        $sSecsText = "секунда"; 
    } 
} $displaystring="". 
$sDaysLeft." ". 
$sDaysText." ". 
$sHoursLeft." ". 
$sHoursText." ". 
$sMinsLeft." ". 
$sMinsText." ". 
$sSecsLeft." ". 
$sSecsText; 

echo "На сайте провел:<font color='#FF0000'>$displaystring</font><br />\n";
$perehodu=mysql_result(mysql_query("SELECT `perehodu` FROM `user` WHERE `id` = '$ank[id]' LIMIT 1",$db), 0);
echo "Переходов по сайту:<font color='#FF0000'>$perehodu</font><br />\n";
echo "</div>\n";
if($user['level']==2){
if (otkuda($ank['url'])){echo "Где: <a href='$ank[url]'>".otkuda($ank['url'])."</a><br />\n";
}else{echo "Где: Не определено<br />\n";}
}
if($user['level']==3){
if (otkuda($ank['url'])){echo "Где: <a href='$ank[url]'>".otkuda($ank['url'])."</a><br />\n";
}else{echo "Где: Не определено<br />\n";}
}
if($user['level']==4){
if (otkuda($ank['url'])){echo "Где: <a href='$ank[url]'>".otkuda($ank['url'])."</a><br />\n";
}else{echo "Где: Не определено<br />\n";}
}
////////////////////////

echo "<div class='page_foot'>";



echo '<img src="/img/ico_mone.png" alt=""/> Деньги города:'.$ank['gorod_money'].'</span><br/>';


$ismobi=mysql_query("SELECT * FROM `gorod_invent` WHERE `uid`='".$ank['id']."' AND `type`='mobi'");
if(mysql_num_rows($ismobi)>0){
$ismobi=mysql_fetch_assoc($ismobi);

echo ' - <a href="/gorod/mobi.php">Мобила города:</a>  <font color="#FF0000">'.$ismobi['name'].'</font><br />';
};
$isdom=mysql_query("SELECT * FROM `gorod_invent` WHERE `uid`='".$ank['id']."' AND `type`='dom'");
if(mysql_num_rows($isdom)>0){
$isdom=mysql_fetch_assoc($isdom);
echo ' - <a href="/gorod/rieltor.php">Дом в городе:</a> <font color="#FF0000"> '.$isdom['name'].'</font><br />';
};
$isavto=mysql_query("SELECT * FROM `gorod_invent` WHERE `uid`='".$ank['id']."' AND `type`='avto'");
if(mysql_num_rows($isavto)>0){
$isavto=mysql_fetch_assoc($isavto);
echo ' - <a href="/gorod/avto.php">Автомобиль города:</a>  <font color="#FF0000">'.$isavto['name'].'</font><br />';
};
$ispu=mysql_query("SELECT * FROM `gorod_invent` WHERE `uid`='".$ank['id']."' AND `type`='pushka'");
if(mysql_num_rows($ispu)>0){
$ispu=mysql_fetch_assoc($ispu);
echo ' - <a href="/gorod/magazin.php">Оружие города:</a>  <font color="#FF0000">'.$ispu['name'].'</font><br />';
};

if ($ank['gorod_security']!=NULL)echo ' - <a href="/gorod/security.php">Охрана города:</a>  <font color="#FF0000">'.$ank['gorod_security'].'</font><br />';
if ($ank['gorod_para']!=NULL)echo ' - <a href="/gorod/ree.php">Спутница города: </a> <font color="#FF0000">'.$ank['gorod_para'].'</font><br />';
if ($ank['gorod_tur']!=NULL)echo ' - <a href="/gorod/tur.php">Ездил в путешествие:</a> <font color="#FF0000"> '.$ank['gorod_tur'].'</font><br />';
if ($ank['gorod_firm']!=NULL)echo ' - <a href="/gorod/firma.php">Фирма города:</a> <font color="#FF0000"> '.$ank['gorod_firm'].'</font><br />';
if ($ank['gorod_band']!=NULL)echo ' - <a href="/gorod/grup.php">В банде города:</a> <font color="#FF0000">'.$ank['gorod_band'].'</font><br />';


echo'</div>';


///////////////////////

if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
{

echo "<div class='p_t'>Админ-панелька</div>\n";
if (isset($user) && $user['level'] > 0)
{
echo "<div class='str'>";
echo "<img src='img/tabor/bullet.png' alt=''> <a href='/adm_panel/user.php?id=$ank[id]'>Редактировать профиль</a><br />\n";
}
if ($user['id']!=$ank['id']){
if ($ank['ban']>$time)
{
if (isset($access['ban_unset']))
echo "<img src='img/bullet.png' alt=''> <a href='adm_panel/ban.php?id=$ank[id]&act=del'>Снять бан</a><br />\n";
}
else 
{
if (isset($access['ban_set']))
echo "<img src='img/tabor/bullet.png' alt=''> <a href='adm_panel/ban.php?id=$ank[id]'>Забанить пользователя</a><br />\n";
}
if (isset($access['user_delete'])){
echo "<img src='img/tabor/bullet.png' alt=''> <a href='adm_panel/delete_user.php?id=$ank[id]'>Удалить пользователя</a><br />";
mysql_query("OPTIMIZE TABLE `users`");
}}

if ($user['group_access']>=8 && $user['group_access']<=15){
if ($ank['ip']!=NULL){
if ($user['group_access']>=8 && $ank['ip']!=0){
echo "IP: ".long2ip($ank['ip'])." ";
if ($user['group_access']>=8)echo " [<a href='adm_panel/ban_ip.php?min=$ank[ip]'>Бан</a>]";
echo "<br />\n";}}
if ($ank['ip_cl']!=NULL){
if (isset($access['show_ip']) && $ank['ip_cl']!=0){
echo "IP (CLIENT): ".long2ip($ank['ip_cl'])."";
if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
///if ($user['group_access']>=8 && $user['group_access']<=15)
echo " [<a href='adm_panel/ban_ip.php?min=$ank[ip_cl]'>Бан</a>]";
echo "<br />\n";}}
if ($ank['ip_xff']!=NULL){
if (isset($access['show_ip']) && $ank['ip_xff']!=0){
echo "IP (XFF): ".long2ip($ank['ip_xff'])."";
if ($user['group_access']>=8 && $user['group_access']<=15)
echo " [<a href='adm_panel/ban_ip.php?min=$ank[ip_xff]'>Бан</a>]";
echo "<br />\n";}}
if (isset($access['show_brows']) && $ank['ua']!=NULL)
echo "UA: $ank[ua]<br />\n";
if (isset($access['show_ip']) && opsos($ank['ip']))
echo "Пров: ".opsos($ank['ip'])."<br />\n";
if (isset($access['show_ip']) && opsos($ank['ip_cl']))
echo "Пров (CL): ".opsos($ank['ip_cl'])."<br />\n";
if (isset($access['show_ip']) && opsos($ank['ip_xff']))
echo "Пров (XFF): ".opsos($ank['ip_xff'])."<br />\n";}

}
echo "</div>\n";

include_once 'sys/inc/tfoot.php';

?>));
if(isset($user))
{
if(mysql_result(mysql_query(/font$user['id'])
{
echo a href=\; 
$nMinsLeftLength = strlen($sMinsLeft); 
$m_1=substr($sMinsLeft,-1,1); 

if ($nMinsLeftLengtha href='100monet.php'br /);
}
else
{
$guest=mysql_fetch_array(mysql_query(\nSELECT COUNT(*) FROM `clan_user` WHERE `id_clan` = '$clan[id]' AND `activaty` = '0'),0)./divbr/
	';

	if($user['set_translit']) echo '1) 
{ 
    if ($s_1== 2 || $s_1== 3 || $s_1== 4) 
    { 
        $sSecsText = /gorod/grup.php \n `kolur` AND `act` = '2'p_t/aa href=/a/div';
}else
{
if ($ank['pol'] == 1)echo 'Женат на: #FF0000 ;

echo ;
echo a href=\IQ-баллы:\n/divimg src= br/Охрана города:frend=del;



echo sys/avatar/$id.jpg
		';

		if($user['level'] час. 
$sHoursLeft./span