Файл: sys/fnc/aut.php
Строк: 114
<?
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']?>"><img src="/style/icons/people.gif" alt="DS" /></a>
</td>
<?
/*
=================================
Почта
=================================
*/
?><td class="auts"><?
if ($k_new != 0 && $k_new_fav == 0)
{
?><a href="/new_mess.php"><img src="/style/icons/pochta.png" alt="DS" /><font color="#ff0000">(<?=$k_new?>)</font></a><?
}
else
{
?><a href="/konts.php"><img src="/style/icons/pochta.png" alt="S" /></a><?
}
?></td><?
$discuss = mysql_result(mysql_query("SELECT COUNT(`count`) FROM `discussions` WHERE `id_user` = '$user[id]' AND `count` > '0' "),0); // Обсуждения
if ($discuss > 0)$discuss = '<font color=red>('.$discuss.')</font>';
else $discuss = null;
$lenta = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `tape` WHERE `id_user` = '$user[id]' AND `read` = '0' "),0); // Лента
if ($lenta > 0)$lenta = '<font color=red>('.$lenta.')</font>';
else $lenta = null;
//Обсуждения
echo "<td class='auts'><a href='/user/discussions/'><img src='/style/icons/jurnal.png'> $discuss</a></td>";
//Лента
echo "<td class='auts'><a href='/user/tape/'><img src='/style/icons/lenta.png'> $lenta</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>
<?
}
//Гости
$new_g = mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guests` WHERE `id_ank` = '$user[id]' AND `read`='1'"),0);
echo '<td class="auts">';
if($new_g != 0){
echo "<a href='/user/myguest/index.php'><img src='/style/icons/guests.gif'> <font color='red'>+$new_g</font></a> ";
}else{
echo "<a href='/user/myguest/index.php'><img src='/style/icons/guests.gif'></a> ";
}
echo '</td>';
echo '</tr>';
echo '</table>';
//Прямой эфир из гостевой
if (isset($_GET['off_besedka']))
$_SESSION['on_besedka'] = null;
if (isset($user) && mysql_result(mysql_query("SELECT COUNT(*) FROM `guest`"), 0) > 0 && $_SERVER['PHP_SELF'] != '/guest/index.php' && !isset($_SESSION['on_besedka']))
{
if (isset($_GET['on_besedka']))
{
$_SESSION['on_besedka'] = true;
header('Location: /index.php');
exit;
}
echo '<div class="gmenu"><b>Прямой эфир из <a href="/guest/">чата</a></b> <span style="float:right;"><a href="/index.php?on_besedka">[Вкл]</a></span></div>';
}
else if (isset($user) && mysql_result(mysql_query("SELECT COUNT(*) FROM `guest`"), 0) > 0 && $_SERVER['PHP_SELF'] != '/guest/index.php' )
{
$s_post = mysql_fetch_assoc(mysql_query("SELECT * FROM `guest` WHERE time ORDER by id DESC limit 1"));
echo '<div class="gmenu"><b>Прямой эфир из <a href="/guest/">чата</a></b> <span style="float:right;"><a href="/index.php?off_besedka">[Откл]</a></span></div>';
echo " <div class='nav2'>";
echo group($s_post['id_user']) . user::nick($s_post['id_user']) .online($s_post['id_user']);
echo medal($s_post['id_user']);
if (isset($user) && $user['id']!=$s_post['id_user'] && $s_post['id_user']!=5)
echo '[<a href="/guest/?response=' . $s_post['id_user'] . '">ответ</a>]';
echo '<font color="#999999"><small>' . vremja($s_post['time']) . '</small></font></br>';
echo "<span class='text'>";
echo output_text($s_post['msg']);
echo "</span></div>";
echo "</td>";
echo "</tr></table>";
}
//---------------------
}
}
}
?>