Файл: modules/user/notify.php
Строк: 86
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
if(!User::logged()) { redirect('/'); }
if($db->query("SELECT * FROM `notify` WHERE `read` = '1'")->rowCount() >= 50)
{
$db->query("DELETE FROM `notify` WHERE `read` = '1'");
}
$locate = 'in_cabinet';
$title = _t('notify');
include_header($title);
$tpl->div('title', _t('notify'));
$notify_r = $db->query("SELECT * FROM `notify` WHERE `user_id` = '". $user['id'] ."' AND `read` = '0'")->rowCount();
$pages = new Paginator($notify_r, $ames);
if($notify_r == 0)
{
$tpl->div('menu', _t('notify_no'));
}
else
{
$notify_q = $db->query("SELECT * FROM `notify` WHERE `user_id` = '". $user['id'] ."' AND `read` = '0' ORDER BY time DESC LIMIT $start, $ames");
while($notify = $notify_q->fetch())
{
// $db->query("UPDATE `notify` SET `read` = '1' WHERE `id` = '". $notify['id'] ."' AND `type` != 'notify_topic_reply'");
if($notify['type'] != 'notify_topic_reply' && $notify['type'] != 'notify_comments_reply' && $notify['type'] != 'notify_file_reply' && $notify['type'] != 'notify_blog_reply' && $notify['type'] != 'notify_photo_reply')
{
$db->query("UPDATE `notify` SET `read` = '1' WHERE `id` = '". $notify['id'] ."'");
}
echo '<div class="menu">
'._t('user').' <a href="/user/profile/'.$notify['from_id'].'?">'. tnick($notify['from_id']) .'</a>
'.(!empty($notify['request_id']) && $notify['type'] != 'notify_balance_transfer' ? '<a href="'.$notify['request_id'].'">'._t($notify['type'], 'notify').'</a>' : _t($notify['type'])).' ('.rtime($notify['time']).')
'.($notify['type'] == 'notify_balance_transfer' ? ' <b>'.$notify['request_value'].'</b> '._t('balance') : NULL).'
</div>';
}
$pages->view();
}
echo '<div class="block">
'. NAV .' <a href="/user/panel">'. _t('user_panel') .'</a><br/>
'. HICO .' <a href="/">'. _t('home') .'</a><br/>
</div>';
include_footer();
?>