Файл: style/themes/web/navigation.php
Строк: 130
<?
if (isset($user)){
/*
=================================
Страничка
=================================
*/
echo '<a href="/info.php?"><span class="link_title"><img src="/style/themes/web/images/user.png" alt=""/>
<br/>Моя стр</span></a>';
/*
=================================
Почта
=================================
*/
$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);
if ($k_new!=0 && $k_new_fav==0){
echo "<a href='/new_mess.php'><span class='link_title'><img src='/style/themes/web/images/mail.png' alt=''/> <b class='count'>+$k_new</b>
<br/> Почта </span></a>";
}else{
echo "<a href='/konts.php'><span class='link_title'><img src='/style/themes/web/images/mail.png' alt=''/>
<br/>Почта</span></a>";
}
/*
=================================
Лента
=================================
*/
$lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `tape` WHERE `id_user` = '$user[id]' AND `read` = '0' "),0);
echo "<a href='/user/tape/index.php'><span class='link_title'><img src='/style/themes/web/images/lenta.png' alt=''/>";
$k_l = $lenta;
if($k_l>0)echo " <b class='count'>+$k_l</b>";
echo "<br/>Лента";
echo "</span></a>";
/*
=================================
Обсуждения
=================================
*/
$discuss = mysql_result(mysql_query("SELECT COUNT(`count`) FROM `discussions` WHERE `id_user` = '$user[id]' AND `count` > '0' "),0); // Обсуждения
$k_l = $discuss;
echo "<a href='/user/discussions/index.php'><span class='link_title'><img src='/style/themes/web/images/disc.png' alt=''/>";
if($k_l>0)echo " <b class='count'>+$k_l</b>";
echo "<br/>Обсуждения";
echo "</span></a>";
/*
=================================
Уведомления
=================================
*/
$k_notif = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notification` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0); // Уведомления
$k_l = $k_notif;
if($k_l>0){
echo "<a href='/user/notification/index.php'><span class='link_title'><img src='/style/themes/web/images/notif2.png' alt=''/><b class='count'>+$k_l</b>
<br/>Уведомления";
echo "</span></a>";
}
/*
=================================
Друзья
=================================
*/
$k_f = mysql_result(mysql_query("SELECT COUNT(id) FROM `frends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0);
if ($k_f>0)
echo "<a href='/user/frends/new.php'><span class='link_title'><img src='/style/themes/web/images/frend.png' alt=''/><b class='count'>+$k_f</b>
<br/>Друзья </span></a>";
else
echo '<a href="/user/frends/?id='.$user['id'].'"><span class="link_title"><img src="/style/themes/web/images/frend.png" alt=""/>
<br/>Друзья</span></a>';
/*
=================================
Обновить
=================================
*/
echo '<a href="'.htmlspecialchars($_SERVER['REQUEST_URI']).'"><span class="link_title"><img src="/style/themes/web/images/refresh.png"/>
<br/>Обновить</span></a>';
}elseif ($_SERVER['PHP_SELF'] != '/aut.php' && $_SERVER['PHP_SELF'] != '/reg.php'){
echo '<a href="#user" rel="facebox"><span class="link_title2"><img src="/style/themes/web/images/key.png" alt=""/><br />Авторизация/Регистрация</span></a>';
echo '<script src="//ulogin.ru/js/ulogin.js"></script><div id="uLogin" data-ulogin="display=small;fields=first_name,last_name;providers=vkontakte,odnoklassniki,mailru,facebook;hidden=other;redirect_uri=http%3A%2F%2F'.$_SERVER['HTTP_HOST'].'/loginAPI.php"></div>';
echo '<div id="user" style="display:none;">';
echo '<div class="mess">
<br />';
echo '</div>';
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-z0-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>';
}