Файл: sys/fnc/aut.php
Строк: 92
<?
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(*) FROM `mail` WHERE `id_kont` = '$user[id]' AND `read` = '0' AND `deleted` != '$user[id]' AND `deleted` != '-1' AND `flaggedTo` = 'inbox'"), 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.png" 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/nav_pochta.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.png" alt="DS" /></center></a>
</td>
</tr></table>
<?
}
if ($user['group_access'] > '0'){
echo "<div class='nav1'>";
if($user['group_access']>'14')echo "<a href='/guard/'>Защита</a>";
?> </div> <?
}
if (isset($_GET['lim1']) && $user['lim_guest']!='1'){mysql_query("UPDATE `user` SET `lim_guest` = '1' WHERE `id` = '".$user['id']."' LIMIT 1");
$_SESSION['message'] = 'Успешно сохранено';
header("Location: ?");
}
if (isset($_GET['lim2']) && $user['lim_guest']!='2'){mysql_query("UPDATE `user` SET `lim_guest` = '2' WHERE `id` = '".$user['id']."' LIMIT 1");
$_SESSION['message'] = 'Успешно сохранено';
header("Location: ?");
}
if (isset($_GET['lim3']) && $user['lim_guest']!='3'){mysql_query("UPDATE `user` SET `lim_guest` = '3' WHERE `id` = '".$user['id']."' LIMIT 1");
$_SESSION['message'] = 'Успешно сохранено';
header("Location: &");
}
if (isset($_GET['lim4']) && $user['lim_guest']!='4'){mysql_query("UPDATE `user` SET `lim_guest` = '4' WHERE `id` = '".$user['id']."' LIMIT 1");
$_SESSION['message'] = 'Успешно сохранено';
header("Location: ?");
}
if (isset($_GET['show_guest'])){
if ($user['show_guest']=='0'){
mysql_query("UPDATE `user` SET `show_guest` = '1' WHERE `id` = '".$user['id']."' LIMIT 1");
}else{
mysql_query("UPDATE `user` SET `show_guest` = '0' WHERE `id` = '".$user['id']."' LIMIT 1");
}
}
if ($user['show_guest']=='0'){
$g=mysql_query("SELECT * FROM `guest` ORDER BY id DESC LIMIT $user[lim_guest]");
echo "<div class='foot'> <a href='/guest/'>Гостевая</a> || ";
if ($user['lim_guest'] != '1'){echo "<a href='?lim1'>[1]</a>";}else{echo "[1<img src='/img/button_ok.png'>]";}
if ($user['lim_guest']!='2'){echo "<a href='?lim2'>[2]</a>";}else{echo "[2<img src='/img/button_ok.png'>]";}
if ($user['lim_guest']!='3'){echo "<a href='?lim3'>[3]</a>";}else{echo "[3<img src='/img/button_ok.png'>]";}
if ($user['lim_guest']!='4'){echo "<a href='?lim4'>[4]</a>";}else{echo "[4<img src='/img/button_ok.png'>]";}
echo " || <a href='?show_guest'>Скрыть</a></div>";
while ($guest = mysql_fetch_assoc($g)){
$g_a = get_user($guest['id_user']);
echo "<div class='nav1'>";
echo "<table style='width:100%;'><td style='width:53px;'>";
echo avatar($g_a['id'], true, 50, false);
echo "</td> <td style='text-decoration:none;'>";
echo "".nick($g_a['id'])."<br />";
?> </td> </table> <?
echo ' '.output_text(cuttext($guest['msg'],150)).' <br />';
if ($guest['id_user']!=$user['id']){echo " <a href='/guest/index.php?response=$g_a[id]'>[Ответ]</a> "; echo "<a href="/guest/index.php?cit=$guest[id]">[Цитата]</a> "; }
echo "</div>";
}
}else{echo "<div class='foot'><a href='?show_guest'>Открыть прямой эфир → </a></div>";}
}
}
?>