Файл: public_html/sys/fnc/aut.php
Строк: 69
<?
function aut()
{
global $set;
if ($set['web']==false)
{
global $user;
if (isset($user))
{
echo "<div class='auth'>";
echo "<a href='/id$user[id]'>Страничка</a> | <a href='/umenu.php'>Кабинет</a> ";
$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);
if ($k_new!=0 && $k_new_fav==0) {
echo " | <a href='/new_mess.php'><b>Почта <font color='yellow'>+$k_new</font></b></a>n";
}
$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"><b>Друзья <font color="yellow">+'.$zoz.'</font></b></a>';
}
$lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `lenta` WHERE `id_kont` = '$user[id]' AND `read` = '0' "),0);
if($lenta>0) echo " | <a href='/lenta.php'><b>Лента <font color='yellow'>+$lenta</b></font></a>";
$new_g=mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guests` WHERE `id_ank` = '$user[id]' AND `read`='1'"),0);
if($new_g!=0)echo " | <a href='/guests.php'><b>Гости</a> <font color='yellow'>+$new_g</b></font>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";
$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' title='Новые сообщения в закладках'>Сообщения в закладках ($k_n_s_zak)</a><br />n";
echo '</div>';
}
else
{
echo "<div class='auth'><a href='/aut.php'>Вход</a> | <a href='/reg.php'>Регистрация</a> <font color='gray'>[</font> <font color='yellow'>открыта</font><font color='gray'>]</font></div>n";
}
}
}
?>