POtential fix for browse page ordering

This commit is contained in:
DariusIII
2019-12-07 17:52:51 +01:00
parent 9b5dbc5348
commit 2e77ab4266
2 changed files with 29 additions and 13 deletions
+4 -4
View File
@@ -19,11 +19,11 @@ class BrowseController extends BasePageController
$this->smarty->assign('category', -1);
$orderby = '';
$orderBy = request()->has('ob') && ! empty(request()->input('ob')) ? request()->input('ob') : '';
$page = request()->has('page') && is_numeric(request()->input('page')) ? request()->input('page') : 1;
$offset = ($page - 1) * config('nntmux.items_per_page');
$rslt = $releases->getBrowseRange($page, [-1], $offset, config('nntmux.items_per_page'), $orderby, -1, $this->userdata->categoryexclusions, -1);
$rslt = $releases->getBrowseRange($page, [-1], $offset, config('nntmux.items_per_page'), $orderBy, -1, $this->userdata->categoryexclusions, -1);
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_page'), $page, request()->url(), request()->query());
$this->smarty->assign('catname', 'All');
@@ -79,11 +79,11 @@ class BrowseController extends BasePageController
$this->smarty->assign('parentcat', ucfirst($parentCategory));
$this->smarty->assign('category', $category);
$orderby = '';
$orderBy = '';
$page = request()->has('page') && is_numeric(request()->input('page')) ? request()->input('page') : 1;
$offset = ($page - 1) * config('nntmux.items_per_page');
$rslt = $releases->getBrowseRange($page, $catarray, $offset, config('nntmux.items_per_page'), $orderby, -1, $this->userdata->categoryexclusions, $grp);
$rslt = $releases->getBrowseRange($page, $catarray, $offset, config('nntmux.items_per_page'), $orderBy, -1, $this->userdata->categoryexclusions, $grp);
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_page'), $page, request()->url(), request()->query());
$browse = [];