Файл: _modules/mail/index.php
Строк: 44
<?php
# mark core v1.0
# author Drk in
# date 24.10.19
# core
require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );
# user
system::access(true);
# update user cn_mail
if($user['cn_mail'] > 0):
DB :: $dbh -> query("UPDATE user SET cn_mail = ? WHERE id = ? LIMIT 1;",array(0,$user['id']));
cache_user::save($user['id']);
endif;
# meta
$title = 'Диалоги :: '.domain;
# head
require_once ( head );
$cn = DB :: $dbh -> querySingle("SELECT count(id) FROM mail_con WHERE user = ?;", array($user['id']));
if ($cn == 0)echo '<div class="dialog"><h1 class="pda">КПК</h1><p>› Cписок диалогов пуст<br></p></div>';
$page = new page($cn);
$limit = $cn > $page -> elements ? $page -> limit : null;
$query = DB :: $dbh -> query("SELECT id FROM mail_con WHERE user = ? ORDER BY time DESC {$limit}", array($user['id']));
while ($act = $query -> fetch()):
$act = cache_mail_con::get($act['id']);
$data = cache_user::get($act['data']);
echo '
<div class="fights-link" style="margin: 5px;"><a href="/mail/message/'.$act['data'].'" style="padding: 5px;">
<div style="padding-right: 7px;float: left;margin-top: 5px;">
'.user::min_ava($data['ava']).'
</div><div style="overflow: hidden;">
<h1 class="chat">'.user::mail($act['data']).'</h1></div>
› '.($act['mess'] == null ? 'null<br>':system::text($act['mess']).'<br>').'
Сообщений: '.$act['cn'].' '.($act['cn_new'] > 0 ? '<font color="red">+ '.$act['cn_new'].'</font>':null).'
</a></div>
';
endwhile;
$page -> get('?');
echo '
<div class="fights-link" style="margin: 2px 5px"><a href="/mail/setting">Настройки приватности</a></div>
<div class="line"></div>';
# foot
require_once ( foot );
?>