Файл: style/themes/web/navigation.php
Строк: 140
<?
if (isset($user)){
/*
=================================
Страничка
=================================
*/
echo '<span class="link_header">';
echo '<a href="/info.php?"><img src="/style/themes/web/user.png" alt=""></a>';
echo "</span>";
/*
=================================
Почта
=================================
*/
$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);
echo '<span class="link_header">';
if ($k_new!=0 && $k_new_fav==0){
echo "<a href='/new_mess.php'><img src='/style/themes/web/mail.png' alt=''> <span class='count'>$k_new</span></a>";
}else{
echo "<a href='/konts.php'><img src='/style/themes/web/mail.png' alt=''></a>";
}
echo "</span>";
/*
=================================
Лента
=================================
*/
$lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `tape` WHERE `id_user` = '$user[id]' AND `read` = '0' "),0);
$k_l = $lenta;
echo '<span class="link_header">';
echo "<a href='/user/tape/index.php'><img src='/style/themes/web/lenta.png' alt=''>";
if($k_l>0)echo " <span class='count'>$k_l</span>";
echo "</a>";
echo "</span>";
/*
=================================
Обсуждения
=================================
*/
$discuss = mysql_result(mysql_query("SELECT COUNT(`count`) FROM `discussions` WHERE `id_user` = '$user[id]' AND `count` > '0' "),0); // Обсуждения
$k_l = $discuss;
echo '<span class="link_header">';
echo "<a href='/user/discussions/index.php'><img src='/style/themes/web/discus.png' alt=''>";
if($k_l>0)echo " <span class='count'>$k_l</span>";
echo "</a>";
echo "</span>";
/*
=================================
Уведомления
=================================
*/
$k_notif = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notification` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0); // Уведомления
$k_l = $k_notif;
echo '<span class="link_header">';
echo "<a href='/user/notification/index.php'><img src='/style/themes/web/notif.png' alt=''>";
if($k_l>0){
echo " <span class='count'>$k_l</span>";
}
echo "</a>";
echo "</span>";
/*
=================================
Друзья
=================================
*/
$k_f = mysql_result(mysql_query("SELECT COUNT(id) FROM `frends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0);
echo '<span class="link_header">';
if ($k_f>0)
echo "<a href='/user/frends/new.php'><img src='/style/themes/web/icon_druzya.png' alt=''> <span class='count'>$k_f</span></span></a>";
echo "</span>";
/*
=================================
Гости
=================================
*/
$new_g=mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guests` WHERE `id_ank` = '$user[id]' AND `read`='1'"),0);
echo '<span class="link_header">';
echo "<a href='/user/myguest/index.php'><img src='/style/themes/web/guest.png' alt=''>";
if($new_g!=0)echo " <span class='count'>$new_g</span>";
echo "</a>";
echo "</span>";
/*
=================================
Оценки
=================================
*/
$ocenky = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_rating` WHERE `avtor` = '$user[id]' AND `read`='1'"),0);
echo '<span class="link_header">';
echo "<a href='/user/info/ocenky.php'><img src='/style/themes/web/ocenki.png' alt=''>";
if($ocenky != 0){
echo " <span class='count'>$ocenky</span>";
}
echo "</a>";
echo "</span>";
}
elseif ($_SERVER['PHP_SELF'] != '/aut.php' && $_SERVER['PHP_SELF'] != '/reg.php')
{
echo '<div class="link_vh"><a href="#user" rel="facebox">Войти</a>';
echo '<a href="#user" rel="facebox">Регистрация</a></div>';
echo '<div id="user" style="display:none;">';
echo "<div class = 'foot'>Авторизация</div>";
echo "<form class='mess' method='post' action='/login.php'>
Логин:<br /><input type='text' name='nick' maxlength='32' /><br />
Пароль:<br /><input type='password' name='pass' maxlength='32' /><br />
<label><input type='checkbox' name='aut_save' value='1' /> Запомнить меня</label><br />
<input type='submit' value='Войти' /> <a href='/pass.php'>Забыли пароль?</a> <br />
</form><br />";
echo "<div class = 'foot'>Регистрация</div>";
echo "<form class='mess' method='post' action='/reg.php?$passgen'>n";
echo "Выберите ник [A-zА-я0-9 -_]:<br /><input type='text' name='nick' maxlength='32' /><br />n";
echo "Регистрируясь, Вы автоматически соглашаетесь с <a href='/rules.php'>правилами</a> сайта<br />n";
echo "<input type='submit' value='Продолжить' />n";
echo "</form><br />n";
echo'</div>';
}