Файл: mob-lave.ru/core/panel.php
Строк: 114
<?php
// =========== Кнопки =========== //
if (isset($user)){
if($user['color_count_top_panel'] == NULL) $user[color_count_top_panel] = 'red';
$k_new=mysql_result(mysql_query("SELECT COUNT(`$system[perfix]_mail`.`id`) FROM `$system[perfix]_mail`
LEFT JOIN `$system[perfix]_users_konts` ON `$system[perfix]_mail`.`id_user` = `$system[perfix]_users_konts`.`id_kont` AND `$system[perfix]_users_konts`.`id_user` = '$user[id]'
WHERE `$system[perfix]_mail`.`id_kont` = '$user[id]' AND `$system[perfix]_mail`.`read` = '0'"),0);
$k_new_fav=mysql_result(mysql_query("SELECT COUNT(`$system[perfix]_mail`.`id`) FROM `$system[perfix]_mail`
LEFT JOIN `$system[perfix]_users_konts` ON `$system[perfix]_mail`.`id_user` = `$system[perfix]_users_konts`.`id_kont` AND `$system[perfix]_users_konts`.`id_user` = '$user[id]'
WHERE `$system[perfix]_mail`.`id_kont` = '$user[id]' AND (`$system[perfix]_users_konts`.`type` = 'favorite') AND `$system[perfix]_mail`.`read` = '0'"),0); // Почта
$jurnal = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_jurnal` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0); // Журнал
$lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_lenta` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0); // Лента
echo '<table width="100%" cellspacing="0" cellpadding="0" class="auts">
<tr>
<td class="aut" style="border-left:#526794 solid 1px;"><a href="/?login='.$user['login'].'"><center><div id="darks" class="icon-user2"></div></center></a></td>';
if ($k_new!=0 && $k_new_fav==0){
$k_new = '<font color="'.$user['color_count_top_panel'].'"><b>+'.$k_new .'</b></font>';
if ($k_new==0) $k_new_fav = NULL;
echo '<td class="aut"><a href="/user/mail/new_mess.php"><center><div id="darks" class="icon-mail2"></div> <font color="red"><b>'.$k_new.'</b></font></center></a></td> ';
}else{
echo '<td class="aut"><a href="/user/mail/konts.php"><center><div id="darks" class="icon-mail2"></div></center></a></td> ';
}
if($jurnal != 0) $jur = '<font color="'.$user['color_count_top_panel'].'"><b>+'.$jurnal.'</b></font>';
else $jur = NULL;
echo '<td class="aut"><a href="/user/profile/jurnal.php"><center><div id="darks" class="icon-bubble2"></div> '.$jur.'</center></a></td> ';
if($lenta != 0) $lenta = '<font color="'.$user['color_count_top_panel'].'"><b>+'.$lenta.'</b></font>';
else $lenta = NULL;
echo '<td class="aut"><a href="/user/profile/lenta.php"><center><div id="darks" class="icon-bullhorn"></div> '.$lenta.'</center></a></td> ';
echo '<td class="aut"><a href="/exit.php"><center><div id="darks" class="icon-exit"></div></center></a></td>
</tr>
</table>';
}else{
echo '<table width="100%" cellspacing="0" cellpadding="0" class="auts">
<tr>
<td class="aut"><a href="/auth.php"><center><div id="darks" class="icon-key2"></div></center></a></td>
<td class="aut"><a href="/reg.php"><center><div id="darks" class="icon-lock"></div></center></a></td>
<td class="aut"><a href="/moduls/info/"><center><div id="darks" class="icon-info"></div></center></a></td>
</tr>
</table>';
}
// ------- Титл -------- //
if ($_SERVER['PHP_SELF'] == '/index.php'){
if ($title==NULL)$title=$set['title'];
echo '<div class="title_g">
<span style="float:left;"><a href="/user/people.php?act=online"><font color="#f0f0f0">Онлайн: '.mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_users` WHERE `online` > ".(time()-$system['online']).""),0).'</font></a></span>'.htmlspecialchars($title).'</div>';
}
// ------------ Ув о смене ip --------- //
if(isset($_GET['close_ip']) && isset($user['id'])){
mysql_query("UPDATE `$system[perfix]_users` SET `close_ip` = '1' WHERE `id` = '$user[id]'");
header("Location: /?login=$user[login]");
$_SESSION['message'] = 'Уведомление скрыто';
}
$ip = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_ip` WHERE `id_user` = '$user[id]' ORDER BY `id` DESC"));
if(isset($user['id']) && $ip['ip'] != $_SERVER['REMOTE_ADDR'] && $user['close_ip'] == 0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_ip` WHERE `id_user` = '$user[id]'"),0) == true){
$sys = mysql_fetch_assoc(mysql_query("SELECT `id`,`login` FROM `$system[perfix]_users` WHERE `id` = '3'"));
echo '<div class="news">';
echo online($sys['id']).'<b>'.$sys['login'].'</b><br />';
echo 'Ваш IP изменился! Не стоит паниковать, возможно у вашего устройства несколько IP адресов.
Зайдите в <a href="/user/profile/statistic.php?u='.$user['id'].'">историю входов</a> и сравните старые IP с вашим устройством.
Если один из IP адресов в истории не принадлежит вам, срочно поменяйте пароль.<br /><div style="text-align:right"><a href="/?login='.$user['login'].'&close_ip"><div id="dark" class="icon-cancel"></div> Скрыть уведомление</a></div></div>';
}
if (isset($_SESSION['message'])){ echo "<div class='msg'>$_SESSION[message]</div>"; $_SESSION['message']=NULL;}
if (isset($_SESSION['err'])){ echo "<div class='err'>$_SESSION[err]</div>"; $_SESSION['err']=NULL;}
?>