diff --git a/Changelog b/Changelog index d2a597290..93917abcc 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-05-16 DariusIII + * Fix: Fix category filter when searching for releases * Chg: Update release edit links in all themes * Fix: Fix movie view link from details page * Chg: Fix release details display error diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php index 70ffd1318..89b8dec2f 100644 --- a/app/Http/Controllers/Api/ApiController.php +++ b/app/Http/Controllers/Api/ApiController.php @@ -107,12 +107,12 @@ class ApiController extends BasePageController // Set Query Parameters based on Request objects $outputXML = ! ($request->has('o') && $request->input('o') === 'json'); - $minSize = ($request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0); + $minSize = $request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0; $offset = $api->offset(); // Set API Parameters based on Request objects - $params['extended'] = ($request->has('extended') && (int) $request->input('extended') === 1 ? '1' : '0'); - $params['del'] = ($request->has('del') && (int) $request->input('del') === 1 ? '1' : '0'); + $params['extended'] = $request->has('extended') && (int) $request->input('extended') === 1 ? '1' : '0'; + $params['del'] = $request->has('del') && (int) $request->input('del') === 1 ? '1' : '0'; $params['uid'] = $uid; $params['token'] = $apiKey; @@ -220,7 +220,7 @@ class ApiController extends BasePageController $maxAge = $api->maxAge(); UserRequest::addApiRequest($uid, $request->getRequestUri()); - $imdbId = ($request->input('imdbid') ?? -1); + $imdbId = $request->input('imdbid') ?? -1; $relData = $releases->moviesSearch( $imdbId, diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 1e06183fc..7620141ee 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -61,7 +61,7 @@ class SearchController extends BasePageController foreach ($releases->getBrowseOrdering() as $orderType) { $this->smarty->assign( 'orderby'.$orderType, - WWW_TOP.'/search?id='.htmlentities($searchString, ENT_QUOTES | ENT_HTML5).'?t='.implode(',', $categoryID).'&ob='.$orderType + WWW_TOP.'/search?id='.htmlentities($searchString, ENT_QUOTES | ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType ); } @@ -86,7 +86,7 @@ class SearchController extends BasePageController $categoryID ); - $results = $this->paginate($rslt, $rslt['_totalrows'], config('nntmux.items_per_page'), $page, $request->url(), $request->query()); + $results = $this->paginate($rslt ?? [], $rslt['_totalrows'] ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query()); $this->smarty->assign( [ diff --git a/public/assets/Gamma/scripts/utils.js b/public/assets/Gamma/scripts/utils.js index a91def20c..97f9fe38d 100755 --- a/public/assets/Gamma/scripts/utils.js +++ b/public/assets/Gamma/scripts/utils.js @@ -563,7 +563,7 @@ jQuery(function($){ // search.tpl $('#search_search_button').click(function(){ if ($('#search').val()) - document.location=WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val()!=-1 ? "?t="+$("#search_cat").val() : ""); + document.location=WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val()!=-1 ? "&t="+$("#search_cat").val() : ""); return false; }); diff --git a/public/assets/js/functions.js b/public/assets/js/functions.js index 2aa53d3db..b84028c34 100755 --- a/public/assets/js/functions.js +++ b/public/assets/js/functions.js @@ -751,7 +751,7 @@ jQuery(function($){ // search.tpl $('#search_search_button').click(function(){ if ($('#search').val()) - document.location=WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val()!=-1 ? "?t="+$("#search_cat").val() : ""); + document.location=WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val()!=-1 ? "&t="+$("#search_cat").val() : ""); return false; }); diff --git a/public/assets/js/utils.js b/public/assets/js/utils.js index 7cb1ee7ae..12c23689c 100644 --- a/public/assets/js/utils.js +++ b/public/assets/js/utils.js @@ -294,14 +294,14 @@ jQuery(function ($) { }); $('#headsearch_go').click(function () { if ($('#headsearch').val() && $('#headsearch').val() != 'Enter keywords') { - document.location = WWW_TOP + "/search?id=" + $('#headsearch').val() + ($("#headcat").val() != -1 ? "?t=" + $("#headcat").val() : ""); + document.location = WWW_TOP + "/search?id=" + $('#headsearch').val() + ($("#headcat").val() != -1 ? "&t=" + $("#headcat").val() : ""); } }); // search.tpl $('#search_search_button').click(function () { if ($('#search').val()) - document.location = WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val() != -1 ? "?t=" + $("#search_cat").val() : ""); + document.location = WWW_TOP + "/search?id=" + $('#search').val() + ($("#search_cat").val() != -1 ? "&t=" + $("#search_cat").val() : ""); return false; });