File size: 1.47Kb
<?php
if (!type_version() && user('ID') > 0 && url_request_validate('/account/mail') == false) {
$cntdlg = 1;
if (defined('ATTACHMENTS_TESTING')) {
$cntdlg = 0;
}
?>
<?php if ($cntdlg == 1) : ?>
<span style='text-align: left'><?=attachments_result()?></span>
<?php endif ?>
<div class='web-dialog-fixed' style='z-index: 9999'>
<div id='dialog_modal_ajax'>
<?php
$msg_array = db::get_string("SELECT `ID`,`MY_ID` FROM `MAIL_MESSAGE` WHERE `USER_ID` = ? AND `USER` = ? AND `READ` = '0' ORDER BY `TIME` DESC LIMIT 1", [user('ID'), user('ID')]);
$msg_count = db::get_column("SELECT COUNT(*) FROM `MAIL_MESSAGE` WHERE `MY_ID` = ? AND `USER_ID` = ? AND `USER` = ? AND `READ` = '0'", [$msg_array['MY_ID'], user('ID'), user('ID')]);
?>
<?=($msg_count > 0 ? "<div class='web-dialog-notif'>".$msg_count."</div>" : null)?>
<?php if (isset($msg_array['ID'])) : ?>
<button id='dialog_modal_mess_open' count='<?=$cntdlg?>' user='<?=$msg_array['MY_ID']?>' class='web-dialog-button web-dialog-button2' onclick="open_or_close('web-dialog-modal')" style='margin-bottom: 20px'><?=user::avatar($msg_array['MY_ID'], 53)?></button>
<?php endif ?>
</div>
<button id='dialog_modal_content_open' count='<?=$cntdlg?>' class='web-dialog-button' onclick="open_or_close('web-dialog-modal')"><?=icons('envelope', 23)?></button>
</div>
</div>
<div id='web-dialog-modal' style='display: none'>
<div id='dialog_modal_result'></div>
</div>
<?
}