Файл: public_html/sys/fnc/aut.php
Строк: 51
<?
function aut()
{
global $set;
if ($set['web']==false)
{
global $user;
if (isset($user))
{
$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);
echo "<div class='aut'>";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0) > 0) { echo '<a href="/pages/frend_new.php">Предложение дружбы</a><br />'; }
$k_n_s_zak=mysql_result(mysql_query("SELECT COUNT(`forum_zakl`.`id_them`) FROM `forum_zakl` LEFT JOIN `forum_p` ON `forum_zakl`.`id_them` = `forum_p`.`id_them` AND `forum_p`.`time` > `forum_zakl`.`time` WHERE `forum_zakl`.`id_user` = '$user[id]' AND `forum_p`.`id` IS NOT NULL"),0);
if ($k_n_s_zak>0)
echo "<a href='/zakl.php'>$k_n_s_zak <img src='/style/my_menu/zakl.png'></a>n";
if ($k_new!=0 && $k_new_fav==0)
echo "<a href='/new_mess.php'>$k_new <img src='/style/icons/mess0.png' alt='$k_new' /></a>n";
echo "<a href='/info.php'>$user[nick]</a> | <a href='/umenu.php'>Кабинет<br /></a>n";
if ($k_new_fav!=0)
echo "<b><a href='/new_mess.php'><img src='/style/icons/mess_fav.png' alt='$k_new_fav' /> Сообщени".($k_new_fav==1?'е':'я')."</a></b><br />n";
echo "</div>n";
}else{
echo "<div class='aut'><a href='/aut.php'>Войти</a> | <a href='/reg.php'>Создать профиль</a></div>n";
}}}
?>