Файл: sys/fnc/aut.php
Строк: 165
<?
function aut()
{
global $set;
echo "<style type='text/css'>
.aut3 {background: #5c74a9 url(foot.png);font-size: 9px;color: #000;padding: 6px;}
.aut3 a {display:block;color: #fff;padding: 6px;}
.aut3 a:hover {color: #000000;padding: 6px;background:#ffffff;}
.up_panel {color: #ffffff;padding: 2px;margin: 0px;line-height: 17px;}
.up_panel a {color: #ffffff;}
.event {color: #ffffff;}
</style>";
if ($set['web']==false)
{echo "<div class='aut3'>";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);
$jn=mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
$lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `lenta` WHERE `id_kont` = '$user[id]' AND `read` = '0' "),0);
$zoz = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE `to` = '$user[id]'"), 0);
echo "<div class='up_panel'>";
echo "<table style='width:100%' cellspacing='0' cellpadding='0'><tbody><tr>";
echo "<td style='vertical-align:top;width:20%;border-right: 1px solid #9c9aff;white-space:nowrap;'>";
echo "<a href='/umenu.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/umenu.png'></a>";
echo "</td>";
echo "<td style='vertical-align:top;width:20%;border-right: 1px solid #9c9aff;white-space:nowrap;'>";
if ($user['pol'] == 1) {
echo "<a href='/info.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/man.png' alt='Я' /></a>";
} else {
echo "<a href='/info.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/woman.png' alt='Я' /></a>";
}
echo "</td>";
echo "<td style='vertical-align:top;width:20%;border-right: 1px solid #9c9aff;white-space:nowrap;'>";
if ($k_new!=0 && $k_new_fav==0) {
echo "<a href='/new_mess.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/mail.png'> <span class='event'>$k_new</span></a>n";
} else {
echo "<a href='/konts.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/mail.png'></a>n";
}
echo "</td>";
echo "<td style='vertical-align:top;width:20%;border-right: 1px solid #9c9aff;white-space:nowrap;'>";
if ($jn>0) {
echo "<a href='/jurnal.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/zyrnal.png'> <span class='event'>$jn</span></a>n";
} else {
echo "<a href='/jurnal.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/zyrnal.png'></a>n";
}
echo "</td>";
echo "<td style='vertical-align:top;width:20%;white-space:nowrap;'>";
if ($lenta>0) {
echo "<a href='/lenta.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/lenta.png'> <span class='event'>$lenta</span></a>n";
} else {
echo "<a href='/lenta.php' style='text-align:center;display:block;padding:1px;font-size:small;'><img src='/style/images/lenta.png'></a>n";
}
echo "</td>";
echo "</tr></tbody></table>";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0) > 0)
{
echo "<div style='padding-top:2px;padding-left:2px;padding-bottom:0px;border-top:solid #9c9aff;border-width:1px;'>";
echo "<a href='/frend_new.php'>Предложение дружбы <span class='event'>
$zoz</span>
</a>n";
echo "</div>";
}
echo "</div>";
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 "<table style='width:100%' cellspacing='0' cellpadding='0'><tbody><tr>";
echo "<td class='aut3'><center><a href='/aut.php'>Вход</a></center></td> <td class='aut3'><center><a href='/reg.php'>Регистрация</a></center></td>";
echo "</tr></tbody></table>";
}
echo "</div>";
}
}
?>