SITE.'category/'.$book['categoryslug'], 'page' => $book['pricename'] ]; $title = $book['pricename'].' - Аргументы Недели'; $description = 'Читайте и покупайте '.$book['pricename'].'. Издательский дом "Аргументы Недели"'; $maintitle = 'Книги Аргументы Недели'; $subtitle = $book['pricename']; $buy_status = False; # книга входит в состав подписки if ($book['sub'] == 1 && SUBSTATUS == 1){ $buy_status = True; } else { # купил ли эту книжку $buy_status = client_status_book($books['book_id'], CLIENT_ID); } # линки на оформление заказа $link_online = SITE.'checkout/'.$book['priceslug'].'/1'; $link_offline = SITE.'checkout/'.$book['priceslug'].'/2'; $link_subscript = SITE.'checkout/podpiska-na-elektronnuyu-versiyu-gazety-argumenty-nedeli-na-god/1'; $tempcontent = VIEWPATH.'book.phtml'; include VIEWPATH.'layout.phtml'; } /** * категории товаров */ function category_kuri($category = '', $filter = 'all', $page = 1){ if ($category == ''){ if (SUBSTATUS == 1){ // категория по умолчанию $category = 'gazeta'; $filter = "category_id = 1"; } else { $category = 'knigi'; $filter = "category_id = 3"; } } elseif ($category == 'gazeta') { $filter = "category_id = 1"; } elseif ($category == 'knigi') { if (SUBSTATUS == 1) { $filter = "category_id = 3 AND sub = 1"; } else { $filter = "category_id = 3"; } } elseif($category == 'soon'){ $filter = "sub = 0"; } $cats = api_cats(); $parts = api_parts(); $books = api_books_kuri($filter, $page); $baseurl = SITE."category/$category/$filter/"; if ($books['pages'] > 1){ $endurl = $baseurl.$books['pages']; } if ($page > 1) { $pagetitle = $cats[$category]['categoryname']." - страница $page"; $prevpage = $page - 1 ; $prevurl = $baseurl.$prevpage; } else { $pagetitle = $cats[$category]['categoryname']; } if ($page < $books['pages']){ $nextpage = $page+1; $nexturl = $baseurl.$nextpage; } if (isset($cats[$category])){ $breadcrumbs['page'] = $pagetitle; } else { $pagetitle = 'Скоро в подписке'; $breadcrumbs['page'] = $pagetitle; } $tempcontent = VIEWPATH.'books.phtml'; include VIEWPATH.'layout.phtml'; } /** * книги авторов */ function author_kuri($slug, $page = 1){ $find_author_sql = "SELECT * FROM `price_authors` WHERE `authorslug` = '$slug' LIMIT 1"; $find_author = db_get($find_author_sql); if (!isset($find_author['author_id'])){ # 404 echo 'not fount'; exit; } $filter = "`priceauthor_id` = ".$find_author['author_id']; $books = api_books_kuri($filter, $page); $baseurl = SITE."author/$slug/"; if ($books['pages'] > 1){ $endurl = $baseurl.$books['pages']; } if ($page > 1) { $pagetitle = $find_author['author'].". Книги - страница $page"; $prevpage = $page - 1 ; $prevurl = $baseurl.$prevpage; } else { $pagetitle = $find_author['author'].". Книги"; } if ($page < $books['pages']){ $nextpage = $page+1; $nexturl = $baseurl.$nextpage; } $breadcrumbs['page'] = $pagetitle; $title = $pagetitle.' - КЛАН'; $tempcontent = VIEWPATH.'books.phtml'; include VIEWPATH.'layout.phtml'; } /** * книги авторов */ 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); $parts = api_parts(); $category = 'knigi'; $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; $title = $pagetitle.' - КЛАН'; $tempcontent = VIEWPATH.'books.phtml'; include VIEWPATH.'layout.phtml'; }