Файл: putevod/sys/fnc/aut.php
Строк: 90
<?function title()
{
global $user; if (isset($user))
{
global $set;
if ($set['web']==false)
{
echo "<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); // пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ
/*
=================================
Страничка
=================================
*/
echo "<td class='auts'>";
echo "<a href="/info.php?id=$user[id]"><center><img src='/style/icons/nav_stranica.gif' alt='S'/></center></a>";
echo "</td>";
/*
=================================
Почта
=================================
*/
echo "<td class='auts'>";
if ($k_new!=0 && $k_new_fav==0)
{
echo "<a href='/new_mess.php'><center><img src='/style/icons/icon_pochta22.gif' alt='$k_new' />";
echo "<font color="#ff0000">($k_new)</font></center></a>";
}else{
echo "<a href='/konts.php'><center><img src='/style/icons/nav_pochta.gif' alt='S'/></center></a>";
}
echo "</td>";
/*
=================================
Лента
=================================
*/
if ($lenta > 0)
{
$j2 = 'tape';
}
elseif ($discuss > 0)
{
$j2 = 'discussions';
}
elseif ($k_notif > 0)
{
$j2 = 'notification';
}else{
$j2 = 'tape';
}
echo "<td class='auts'>";
echo "<a href='/user/$j2/index.php'><center><img src='/style/icons/nav_lenta.gif' alt='S'/>";
$k_l = $lenta+$k_notif+$discuss;
if($k_l>0)echo "<font color="#ff0000">($k_l)</font>";
echo "</center></a>";
echo "</td>";
/*
=================================
Друзья
=================================
*/
if ($k_frend > 0)
{
echo "<td class='auts'>";
echo "<a href='/user/frends/new.php'><center><img src='/style/icons/icon_druzya.gif' alt='S'/><font color='red'>($k_frend)</font></center></a>";
echo "</td>";
}
/*
=================================
Обновить
=================================
*/
echo "<td class='auts'>";
echo '<a href="'.htmlspecialchars($_SERVER['REQUEST_URI']).'"><center><img src="/style/icons/nav_obnovit.gif" alt="S"></center></a>';
echo "</td>";
echo "</tr></table>";
if (isset($_GET['close_help']) && isset($user) && mysql_result(mysql_query("SELECT COUNT(*) FROM `putevoditel_us` WHERE `id_url` = '".esc($_SERVER['PHP_SELF'])."' AND `id_user` = '".$user['id']."' "), 0) == 0) {
mysql_query("INSERT INTO `putevoditel_us` ( `id_url`, `id_user`, `close`) values('".intval($_GET['close_help'])."', '".$user['id']."', '1') ");
}
$help = mysql_fetch_assoc(mysql_query("SELECT * FROM `putevoditel` WHERE `str_url` = '".esc($_SERVER['PHP_SELF'])."' "));
$off_on = mysql_fetch_assoc(mysql_query("SELECT * FROM `putevoditel_us` WHERE `id_url` = '".$help['id']."' AND `id_user` = '".$user['id']."' "));
if ($user['date_reg']>time()-$help['time'] && $_SERVER['PHP_SELF'] == $help['str_url'] && $off_on['close'] == 0 && isset($user)) {
$help['help_text'] = str_replace('[user_nick]', $user['nick'], $help['help_text']);
echo '<div class = "p_m">';
echo '<img src="/style/user/user.png" width = "50" height = "50"> ';
echo $help['help_text'].'<br />';
echo '<a href="?close_help='.$help['id'].'">Больше не показывать</a>';
echo '</div>';
}
}
}
}
?>