<?
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); // Уведомления
/*
=================================
Страничка
=================================
*/
if (isset($user))
{ ?>
<style>
#blink7 {
color: rgb(245,245,245);
text-shadow: 0 -1px rgba(0,0,0,.1);
-webkit-animation: pulsate 1.2s linear infinite;
animation: pulsate 1.2s linear infinite;
}
.glavcount2 {
padding: 0px 3px 2px 2px;
border-radius:50px;
-moz-border-radius:50px;
-webkit-border-radius:50px;
-khtml-border-radius:50px;
background-color: #60DA65;
text-align:center;
position: relative;
left: -12px;
bottom: 8px;
}
#bar {
background: #4d7199;
border-right: 1px inset #d0d0d0;
padding: 9px 0px 10px 2px;
border: 1px solid #7495dc;
width: 1%;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
}
#bar:hover {
width: 1%;
background: #4d7199;
}
#menu {
border-right: 1px inset #d0d0d0;
text-transform: uppercase;
text-align: center;
line-height: 40px;
background: #69c;
}
#menu ul {
padding:0;
margin:0;
}
#menu li{
display: inline;
list-style:none;
margin: -1px;
}
#menu li a {
padding: 0px 6px;
color:#fff;
text-decoration: none;
}
#menu.default {margin: auto;
}
#menu.fixed {list-style: none;
z-index: 9999;
position:fixed;
top:0; left:0;width:100%;
}
#info-block { /* блок, который служит оберткой для логотипа и контактов */
float:left;
width:15%;
border-right: 1px inset #d0d0d0;
}
#logo {
font-size:12px;
color:#fff;
}
#contacts {
display:none; /* блок контактов изначально скрыт и появится только при прокрутке */
font-size:12px;
color:#fff;
}
.f-nav{ list-style: none;
z-index: 9999; position: fixed; left: 0; top: 0; width: 100%;
float: left;
}
</style><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script>
$(document).ready(function () {
var $menu = $("#menu,#bar");
$(window).scroll(function () {
if ($(this).scrollTop() > 100 && $menu.hasClass("default")) {
$menu.removeClass("default").addClass("fixed");
$('#logo').fadeOut(0,function(){
$('#contacts').fadeIn() //показываем контакты, уже после того, как скрыли логотип
}) //скрываем логотип
} else if ($(this).scrollTop() <= 100 && $menu.hasClass("fixed")) {
$menu.removeClass("fixed").addClass("default");
$('#contacts').fadeOut(0,function(){
$('#logo').fadeIn()
//показываем логотип, уже после того, как скрыли контакты
}) //скрываем контакты
}
}); //scroll
});
</script>
<div id="menu" class="default"><?
?><div id="info-block">
<div id="logo"><center>Logo</center> </div>
<div id="contacts"><?=$set['title']?></div>
</div>
<ul>
<?
?>
<li align='right' id ='bar'>
<a href="/info.php?id=<?=$user['id']?>"><img src="/style/icons/nav_stranica.gif" alt="DS" /></a>
</li>
<?
/*
=================================
Почта
=================================
*/
?><?
if ($k_new != 0 && $k_new_fav == 0)
{
?><li align='right' id='bar'><a href="/new_mess.php"><img src="/style/icons/icon_pochta22.gif" alt="DS" /><span class='glavcount1'><span class='glavcount2' id='blink7'><font size='-2'><?=$k_new?></font></span></span></a></li><?
}
else
{
?><li align='right' id='bar'><a href="/konts.php"><img src="/style/icons/nav_pochta.gif" alt="S" /></a></li><?
}
?><?
/*
=================================
Лента
=================================
*/
?>
<li align='right' id ='bar'><?
if ($lenta > 0)
{
$j2 = 'tape';
}
elseif ($discuss > 0)
{
$j2 = 'discussions';
}
elseif ($k_notif > 0)
{
$j2 = 'notification';
}
else
{
$j2 = 'tape';
}
?>
<a href="/user/<?=$j2?>/index.php"><img src="/style/icons/nav_lenta.gif" alt="DS" />
<?
// Cкладываем сумму счетчиков
$k_l = $lenta + $k_notif + $discuss;
if($k_l > 0)
{
?>
<span class='glavcount1'><span class='glavcount2' id='blink7'><font size='-2'><?=$k_l?></font></span></span>
<?
}
?>
</a>
</li>
<?
/*
=================================
Друзья
=================================
*/
if ($k_frend > 0)
{
?>
<li align='right' id ='bar'>
<a href="/user/frends/new.php"><img src="/style/icons/icon_druzya.gif" alt="DS" /><span class='glavcount1'><span class='glavcount2' id='blink7'><font size='-2'><?=$k_frend?></font></span></span></a>
</li>
<?
}
/*
=================================
Обновить
=================================
*/
?>
<li align='right' id ='bar'>
<a href="<?=text($_SERVER['REQUEST_URI'])?>"><img src="/style/icons/nav_obnovit.gif" alt="DS" /></a>
</ul>
</li></div></div>
<?
}
else
{
?>
<div align="right"class="bar">
<a href="/aut.php">Вход</a> | <a href="/reg.php">Регистрация</a>
</div>
<?
}
}
}
}
?>