add category
This commit is contained in:
@@ -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';
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user