Просмотр файла modules/news/index.php

Размер файла: 1.2Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_news';
  9. $title = $lang->word('news');
  10. require_once(SYS.'/view/header.php');
  11. $tpl->div('title', $lang->word('news'));
  12. $news_n = $db->query("SELECT * FROM `news`")->rowCount();
  13. $pages = new Paginator($news_n, $ames);
  14. if($news_n == 0)
  15. {
  16. $tpl->div('menu', $lang->word('no_news'));
  17. }
  18. else {
  19. $news_q = $db->query("SELECT * FROM `news` ORDER by name DESC LIMIT $start, $ames");
  20. while($news = $news_q->fetch()) {
  21. $tpl->div('menu', img('news.png') .'<a href="/news/article/'. $news['id'] .'/">'. $news['name'] .'</a> '.($user['level'] >= 6 ? '<a href="/news/del_news/?news_id='. $news['id'] .'">'. img('delete.png') .'</a> <a href="/news/edit_news/?news_id='. $news['id'] .'">'. img('edit.png') .'</a>' : NULL) .'');
  22. }
  23. $pages->view('/news/?');
  24. }
  25. $add_news = ''.(isset($user) && $user['level'] >= '6' ? NAV .'<a href="/news/add_news/">'. $lang->word('add_news') .'</a><br/>' : NULL).'';
  26. $tpl->div('block', $add_news . HICO .'<a href="/">'. $lang->word('home').'</a>');
  27. require_once(SYS.'/view/footer.php');
  28. ?>