Add GamesController, adjust themes and classes

This commit is contained in:
DariusIII
2018-04-11 13:31:41 +02:00
parent 9a5df20a8a
commit c9cdc3f065
17 changed files with 1672 additions and 1571 deletions
+4 -21
View File
@@ -32,12 +32,10 @@ class ConsoleController extends BasePageController
$this->smarty->assign('catlist', $ctmp);
$this->smarty->assign('category', $category->title);
$offset = ($request->has('offset') && ctype_digit($request->input('offset'))) ? $request->input('offset') : 0;
$ordering = $console->getConsoleOrdering();
$orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : '';
$page = \request()->has('page') ? \request()->input('page') : 1;
$consoles = [];
$results = $console->getConsoleRange($catarray, $orderby, $this->userdata['categoryexclusions']);
$results = $console->getConsoleRange($page, $catarray, $this->userdata['categoryexclusions']);
$maxwords = 50;
foreach ($results as $result) {
@@ -66,32 +64,17 @@ class ConsoleController extends BasePageController
$this->smarty->assign('genres', $genres);
$this->smarty->assign('genre', $genre);
$browseby_link = '&title='.$title.'&platform='.$platform;
$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.'/console?t='.$category.$browseby_link.'&ob='.$orderby.'&offset=');
$this->smarty->assign('pagerquerysuffix', '#results');
$thisr = $this->smarty->fetch('pager.tpl');
$this->smarty->assign('pager', $thisr);
if ((int) $category === -1) {
if ($category === -1) {
$this->smarty->assign('catname', 'All');
} else {
$cdata = Category::find($category);
if ($cdata) {
$this->smarty->assign('catname', $cdata->parent !== null ? $cdata->parent->title.' > '.$cdata->title : $cdata->title);
$this->smarty->assign('catname', array_first($cdata)->parent !== null ? array_first($cdata)->parent->title.' > '.array_first($cdata)->title : array_first($cdata)->title);
} else {
$this->show404();
}
}
foreach ($ordering as $ordertype) {
$this->smarty->assign('orderby'.$ordertype, WWW_TOP.'/console?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0');
}
$this->smarty->assign('results', $consoles);
$meta_title = 'Browse Console';