Просмотр файла modules/user/notify.php

Размер файла: 1.37Kb
  1. <?php
  2. if(!isset($user)) { header('location: /'); exit; }
  3. $locate = 'in_cabinet';
  4. $title = $lang->word('notify');
  5. require_once(SYS.'/view/header.php');
  6. $tpl->div('title', $lang->word('notify'));
  7. $notify_r = $db->query("SELECT * FROM `notify` WHERE `user_id` = '". $user['id'] ."' AND `read` = '0'")->rowCount();
  8. $pages = new Paginator($notify_r, $ames);
  9. if($notify_r == 0)
  10. {
  11. $tpl->div('menu', $lang->word('notify_no'));
  12. }
  13. else
  14. {
  15. $notify_q = $db->query("SELECT * FROM `notify` WHERE `user_id` = '". $user['id'] ."' AND `read` = '0' ORDER BY time DESC LIMIT $start, $ames");
  16. while($notify = $notify_q->fetch())
  17. {
  18. $db->query("UPDATE `notify` SET `read` = '1' WHERE `id` = '". $notify['id'] ."' AND `type` != 'notify_topic_reply'");
  19. echo '<div class="menu">
  20. '.rtime($notify['time']).'<br/>
  21. '.$lang->word('user').' <a href="/user/'.$notify['from_id'].'?">'. tnick($notify['from_id']) .'</a> '.$lang->word($notify['type']).' <br/>
  22. '.($notify['type'] == 'notify_topic_reply' ? '[<a href="/forum/topic'.$notify['request_id'].'?page=end">'. $lang->word('read') .'</a>]' : NULL).'
  23. </div>';
  24. }
  25. $pages->view('/user/notify?');
  26. }
  27. echo '<div class="block">
  28. '. NAV .' <a href="/user/panel">'. $lang->word('user_panel') .'</a><br/>
  29. '. HICO .' <a href="/">'. $lang->word('home') .'</a><br/>
  30. </div>';
  31. require_once(SYS.'/view/footer.php');
  32. ?>