Файл: public_html/modules/news/index.php
Строк: 59
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.net *
* ------------------------------- *
* @package: PerfCMS Ultra *
* @year: 2013 *
* @author: wanya26ua & Tesla *
* @link: http://perfclub.ru *
**********************************/
$locate = 'in_news';
$title = $lang->word('news');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('news'));
$news_n = $db->query("SELECT * FROM `news`")->rowCount();
$pages = new Paginator($news_n, $ames);
if($news_n == 0)
{
$tpl->div('menu', $lang->word('no_news'));
}
else {
$news_q = $db->query("SELECT * FROM `news` ORDER by name DESC LIMIT $start, $ames");
while($news = $news_q->fetch()) {
$tpl->div('menu', img('news.png') .'<a href="/news/article/'. $news['id'] .'/">'. $news['name'] .'</a> '.($user['level'] >= 6 ? '<span style="float:right">( <a href="/news/del_news/?news_id='. $news['id'] .'">'. img('delete_11.png') .'</a> | <a href="/news/edit_news/?news_id='. $news['id'] .'">'. img('edit_11.png') .'</a> )</span>' : NULL) .'');
}
$pages->view('/news/?');
}
$add_news = ''.(isset($user) && $user['level'] >= '6' ? NAV .'<a href="/news/add_news/">'. $lang->word('add_news') .'</a><br/>' : NULL).'';
$tpl->div('block', $add_news . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
?>