View file aut_vxod/sys/fnc/aut.php

File size: 5.27Kb
<?
function title()
{
	global $user;	
	
	if (isset($user))
	{
		global $set;		
		
		if ($set['web'] == false)
		{			
			?><table style="width:100%" cellspacing="0" cellpadding="0"><tr><?
		
			$k_new = mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail`
			 LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]'
			 WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"),0);
			 
			$k_new_fav = mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail`
			 LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]'
			 WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"),0); // Почта			
			 
			 $lenta = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `tape` WHERE `id_user` = '$user[id]' AND `read` = '0' "),0); // Лента			
			 
			 $discuss = mysql_result(mysql_query("SELECT COUNT(`count`) FROM `discussions` WHERE `id_user` = '$user[id]' AND `count` > '0' "),0); // Обсуждения			
			 
			 $k_frend = mysql_result(mysql_query("SELECT COUNT(id) FROM `frends_new` WHERE `to` = '$user[id]'"), 0); // Друзья			
			 
			 $k_notif = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notification` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0); // Уведомления			 
			 
			/*
			=================================
			Страничка
			=================================
			*/			
			
			?>
			<td class="auts">
			<a href="/info.php?id=<?=$user['id']?>"><center><img src="/style/icons/nav_stranica.gif" alt="DS" /></center></a>
			</td>
			<?
			
			/*
			=================================
			Почта
			=================================
			*/			
			
			?><td class="auts"><?
			if ($k_new != 0 && $k_new_fav == 0)
			{				
				?><a href="/new_mess.php"><center><img src="/style/icons/icon_pochta22.gif" alt="DS" /><font color="#ff0000">(<?=$k_new?>)</font></center></a><?
			}
			else
			{
				?><a href="/konts.php"><center><img src="/style/icons/nav_pochta.gif" alt="S" /></center></a><?
			}
			?></td><?
			
			/*
			=================================
			Лента
			=================================
			*/
			
			if ($lenta > 0)
			{
				$j2 = 'tape';
			}
			elseif ($discuss > 0)
			{
				$j2 = 'discussions';
			}
			elseif ($k_notif > 0)
			{
				$j2 = 'notification';
			}
			else
			{
				$j2 = 'tape';
			}
			
			?>
			<td class='auts'>
			<a href="/user/<?=$j2?>/index.php"><center><img src="/style/icons/nav_lenta.gif" alt="DS" />
			<?
			// Cкладываем сумму счетчиков
			$k_l = $lenta + $k_notif + $discuss;
			
			if($k_l > 0)
			{
				?>
				<font color="#ff0000">(<?=$k_l?>)</font>
				<?
			}
			?>
			</center></a>
			</td>
			<?
			/*
			=================================
			Друзья
			=================================
			*/			 
			
			if ($k_frend > 0)
			{
				?>
				<td class='auts'>
				<a href="/user/frends/new.php"><center><img src="/style/icons/icon_druzya.gif" alt="DS" /><font color='red'>(<?=$k_frend?>)</font></center></a>
				</td>
				<?
			}			
			
			/*
			=================================
			Обновить
			=================================
			*/
			
			?>
			<td class='auts'>
			<a href="<?=text($_SERVER['REQUEST_URI'])?>"><center><img src="/style/icons/nav_obnovit.gif" alt="DS" /></center></a>
			</td>		
			</tr></table>
			<?
		}
}else{
echo "<style>
.panelD {
position: relative;
background: #6780b2;
background: -webkit-gradient(linear,left top,left bottom,from(#7c9ad6),to(#52668e));
background: -moz-linear-gradient(top,#7c9ad6,#52668e);
background: -o-linear-gradient(top,#7c9ad6,#52668e);
background: -ms-linear-gradient(top,#7c9ad6,#52668e);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7c9ad6 ',endColorstr='# 52668e');
zoom: 1;}

a.panel_link {
display: block;
text-align: center;
padding: 3px;}

a.panel_link:hover {background: #6780b2;}

.text {
color: #ffffff;
text-decoration: none;
font-size: medium;
}

#panel_n table a{
border-left: 1px solid #869ece;
border-right: 1px solid #6177a3;
border-bottom: 1px solid #6177a3;
border-top: 1px solid #6177a3;}
.ncount {
color: #ffff00;
font-size: medium;
vertical-align: bottom;}
.time {
padding: 3px;
background: #d0d2d6;
border-left: 1px solid #cccaca;
border-right: 1px solid #cccaca;
border-bottom: 1px solid #b3b3b3;
font-size: small;
text-align: right;
color: #000000;
}
</style>";

echo '<div id="panel_n" class=" "><div class="panelD"><table style="width:100%" cellspacing="0" cellpadding="0"><tr>
<td style="vertical-align:top;width:50% ;"><a style="border-left:none !important;" class="panel_link user_color_link" href="/aut.php" title="Вход"><img class="icon" src="/style/icons/login.png" alt="Вход"/></a></td>
<td style="vertical-align:top;width:50% ;border-right:none !important;"><a class="panel_link user_color_link" href="/reg.php" title="Регистрация"><img class="icon" src="/style/icons/reg.png" alt="Регистрация"/></a></td>
</tr></table></div></div>';
}
}
?>