File size: 2.27Kb
<?
/**
* [shapka_VK функция вывода верха как в вк]
* @param integer $id [id пользователя]
* @param boolean $avatar [принимает true/false, если true то добавляет еще аватар к выводу, а если false то пропускает]
*/
function shapka_VK($link = false, $url = "/", $text = '')
{
global $user, $set;
if(isset($user)){
$count_notific = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notifi` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0);
$count_mail = mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` AS m,
(SELECT MAX(id) AS id FROM `mail` WHERE `unlink` != '".$user['id']."' AND (`id_kont` = '".$user['id']."') GROUP BY IF(`id_user` = '".$user['id']."', `id_kont`, `id_user`)) as max
WHERE m.id = max.id AND m.read = '0' AND (m.id_kont = '".$user['id']."') AND m.unlink != '".$user['id']."'"), 0);
?>
<div class="lolo" id="m">
<div class="basis">
<div class="basis__header mhead" id="mhead">
<a id="_l_open" href="/feed" onclick="UI.sidebarToggle(); return false;" class="header__left hb_wrap mhb_home" accesskey="*">
<div class="hb_btn mhi_home"> </div>
</a>
<h1 class="header__center hb_wrap mhb_back al_back" style="right: unset;">
<?
if($link){
?>
<a class="header__back al_back" href="<?= $url?>" accesskey="0" aria-label="Назад"></a>
<?
}
?>
<span class="header__title hb_btn mh_header mhi_back"><tit_one><?= $text?></tit_one></span>
</h1>
<div class="header__right">
<a class="Bell Bell_empty" href="<?= ($count_notific == 0 ? '/notifi/' : '/notifi/?act=new')?>" aria-label="Уведомления" data-notifi="">
<div class="Bell__icon Icon Icon_bell"></div>
<em class="mh_notify_counter<?= ($count_notific == 0 ? ' countHide' : '')?>" data-count=""><?= $count_notific?></em>
</a>
<a class="hb_wrap mhb_notify mhb_no_notify" id="header_msgs" href="/mail" aria-label="Сообщения" accesskey="#" data-mail="">
<div class="hb_btn mhi_notify">
<em class="mh_notify_counter<?= ($count_mail == 0 ? ' countHide' : '')?>" data-count=""><?= $count_mail?></em>
</div>
</a>
</div>
</div>
<div id="al_loading" class="al_loading" style="background-color: #fff;border: 1px solid #e4e5e6;"></div>
<div class="basis__content mcont" id="mcont">
<?
}
}
?>