Update Books class getBookRange function and BooksController

This commit is contained in:
DariusIII
2018-04-16 09:11:36 +02:00
parent c2b2950e4c
commit e06674e7f7
3 changed files with 57 additions and 107 deletions
+2 -10
View File
@@ -37,7 +37,8 @@ class BooksController extends BasePageController
$orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : '';
$books = [];
$results = $book->getBookRange($catarray, $orderby, $this->userdata['categoryexclusions']);
$page = $request->has('page') ? $request->input('page') : 1;
$results = $book->getBookRange($page, $catarray, $orderby, $this->userdata['categoryexclusions']);
$maxwords = 50;
foreach ($results as $result) {
@@ -59,15 +60,6 @@ class BooksController extends BasePageController
$browseby_link = '&title='.$title.'&author='.$author;
$this->smarty->assign('pagertotalitems', $results[0]['_totalcount'] ?? 0);
$this->smarty->assign('pageroffset', $offset);
$this->smarty->assign('pageritemsperpage', config('nntmux.items_per_cover_page'));
$this->smarty->assign('pagerquerybase', WWW_TOP.'/books?t='.$category.$browseby_link.'&ob='.$orderby.'&offset=');
$this->smarty->assign('pagerquerysuffix', '#results');
$pager = $this->smarty->fetch('pager.tpl');
$this->smarty->assign('pager', $pager);
if ((int) $category === -1) {
$this->smarty->assign('catname', 'All');
} else {