add category

This commit is contained in:
Your Name
2021-08-17 00:44:56 +03:00
parent 7ad83909ff
commit 93e8d709ed
4 changed files with 90 additions and 6 deletions

View File

@@ -145,4 +145,53 @@ function author_kuri($slug, $page = 1){
}
/**
* книги авторов
*/
function knigi_kuri($slug, $page = 1){
$find_parts_sql = "SELECT * FROM `priceparts` WHERE `partalias` = '$slug' LIMIT 1";
$find_parts = db_get($find_parts_sql);
if (!isset($find_parts['pricepart_id'])){ # 404
echo 'not fount';
exit;
}
$filter = "`price`.`pricepart_id` = ".$find_parts['pricepart_id'];
$books = api_books_kuri($filter, $page);
$baseurl = SITE."knigi/$slug/";
if ($books['pages'] > 1){
$endurl = $baseurl.$books['pages'];
}
if ($page > 1) {
$pagetitle = $find_parts['partname']." - страница $page";
$prevpage = $page - 1 ;
$prevurl = $baseurl.$prevpage;
}
else {
$pagetitle = $find_parts['partname'];
}
if ($page < $books['pages']){
$nextpage = $page+1;
$nexturl = $baseurl.$nextpage;
}
$breadcrumbs['page'] = $pagetitle;
$tempcontent = VIEWPATH.'books.phtml';
include VIEWPATH.'layout.phtml';
}