Файл: livemail.ajax.php
Строк: 18
<?
if(!(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) die;
include_once 'api_core/apicms_system.php';
?>
<style>
.arr img {
vertical-align: top;
}
.arr a {
color:#fff;
}
</style>
<?
if (($user['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user_mail` WHERE `id_recipient` = '$user[id]' AND `views` = '0' AND `livemail` = '0'"), 0) > 0){
$q = mysql_query("SELECT * FROM `user_mail` WHERE `id_recipient` = '$user[id]' AND `views` = '0' AND `livemail` = '0' ORDER BY `time` DESC LIMIT 10");
while ($post = mysql_fetch_assoc($q)){
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$post[id_sender]' LIMIT 1"));
echo '<div class="arr" style="background: #24627B; padding: 10px; margin:5px; opacity: 0.9; box-shadow:0 0 11px 1px #4c768e; filter: alpha(Opacity=70);color: #fff; border-radius: 6px; width: 260px;">';
echo '<img src="/images/livemail.gif" alt=""> <b><a style="color:#ffffff;" href="/modules/user_mail.php?id=' . $post['id_sender'] . '">Новое сообщение от ' . $ank['login'] . '</a></b>
<br /><table><tr>
<td style="vertical-align:top; display: block;overflow: hidden; max-height:52px; ">
<a style="color:#ffffff;" href="/modules/user_mail.php?id=' . $post['id_sender'] . '"> ' . htmlspecialchars($post['txt']) . '</a>
</td></tr></table></div>';
}
// помечаем сообщения как прочитанные
mysql_query("UPDATE `user_mail` SET `livemail` = '1' WHERE `id_recipient` = '$user[id]'");
?>
<audio autoplay="autoplay">
<source src="/audio.ogg" type="audio/ogg; codecs=vorbis">
<source src="/audio.mp3" type="audio/mpeg">
</audio>
<?
}
exit;
?>