Файл: public_html/modules/library/cat.php
Строк: 53
<?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_library';
$id = abs(intval($_GET['id']));
if($db->query("SELECT * FROM `library_cats` WHERE `id` = '". $id ."'")->rowCount() == 0) {
$title = $lang->word('library');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('library'));
$tpl->div('menu', $lang->word('not_cat'));
$tpl->div('block', NAV.' <a href="/library/">'. $lang->word('library') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}
$lib_c = $db->query("SELECT * FROM `library` WHERE `id_cat` = '".$id ."'")->rowCount();
$lib_cat = $db->query("SELECT * FROM `library_cats` WHERE `id` = '".$id ."'")->fetch();
$title = $lang->word('library').' | '.$lib_cat['title'];
require_once(SYS.'/view/header.php');
$pages = new Paginator($lib_c, $ames);
$tpl->div('title', $lang->word('library').' | '.$lib_cat['title']);
if($lib_c == 0)
{
$tpl->div('menu', $lang->word('no_cat'));
} else {
$note_sql = $db->query("SELECT * FROM `library` ORDER by id DESC LIMIT $start, $ames");
while($note = $note_sql->fetch()) {
$tpl->div('menu', img('post_lib.png') .' <a href="/library/article/'.$note['id'] .'/">'. $note['title'] .'</a> '.($user['level'] >= 6 ? '<span style="float:right">( <a href="/library/del_note/?id='. $note['id'] .'">'. img('delete_11.png') .'</a> | <a href="/library/edit_note/?id='. $note['id'] .'">'. img('edit_11.png') .'</a> )</span> ' : NULL) .'<br/><a href="/library/article/'.$note['id'] .'/"><a href="/library/'.$note['id'].'/comments/">'. $lang->word('comments').'</a> ['.$db->query("SELECT * FROM `library_comms` WHERE `id_note` = '".$note['id']."' ")->rowCount().']');
}
$pages->view('/library/cat/'.$id.'/?');
}
$add_lib = ''.(isset($user) && $user['level'] >= '5' ? NAV .'<a href="/library/add/?id='.$lib_cat['id'].'">'. $lang->word('add_lib') .'</a><br/>' : NULL).'';
$tpl->div('block', $add_lib . NAV.' <a href="/library/">'. $lang->word('library').'</a><br/>'. HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
?>