Файл: modules/user/notify.php
Строк: 66
<?php
if(!isset($user)) { header('location: /'); exit; }
$locate = 'in_cabinet';
$title = $lang->word('notify');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('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', $lang->word('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())
{
$file = $db->query("SELECT * FROM `magaz_tovar` WHERE `id` = '". $notify['request_id'] ."'")->fetch();
$tema = $db->query("SELECT * FROM `forum_t` WHERE `id` = '". $notify['request_id'] ."'")->fetch();
$db->query("UPDATE `notify` SET `read` = '1' WHERE `id` = '". $notify['id'] ."' AND `type` != 'notify_topic_reply'");
echo '<div class="menu">
'.rtime($notify['time']).'<br/>
'.$lang->word('user').' <a href="/user/'.$notify['from_id'].'?">'. tnick($notify['from_id']) .'</a> '.($notify['type'] != 'notify_topic_plus' ? ''.$lang->word($notify['type']).'' : NULL).'
'.($notify['type'] == 'notify_work_reply' ? '[<a href="/work/file?id='.$notify['request_id'].'">Работа</a>]' : NULL).'
'.($notify['type'] == 'notify_topic_plus' ? 'Поставил вам +1, в теме' : NULL).'
<br/>
'.($notify['type'] == 'notify_topic_reply' ? '[<a href="/forum/topic'.$tema['id'].'?page=end">'.$tema['name'].'</a>]' : NULL).'
'.($notify['type'] == 'notify_topic_plus' ? '[<a href="/forum/topic'.$tema['id'].'?page=end">'.$tema['name'].'</a>]' : NULL).'
'.($notify['type'] == 'magaz_act' ? '[<a href="/magaz/file/'.$file['id'].'/">'.$file['name'].'</a>]' : NULL).'
'.($notify['type'] == 'magaz_adminka' ? '[<a href="/magaz/admin/">Админ-панель</a>]' : NULL).'
</div>';
$db->query("DELETE FROM `notify` WHERE `id` = '". $notify['id'] ."' AND `type` = 'notify_topic_plus'");
}
$pages->view('/user/notify?');
}
echo '<div class="block">
'. NAV .' <a href="/user/panel">'. $lang->word('user_panel') .'</a><br/>
'. HICO .' <a href="/">'. $lang->word('home') .'</a><br/>
</div>';
require_once(SYS.'/view/footer.php');
?>