mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-31 10:18:55 +00:00
POtential fix for browse page ordering
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
@@ -78,16 +78,31 @@
|
||||
<table class="data table table-striped">
|
||||
<thead class="thead-light">
|
||||
<tr class="headings">
|
||||
<th><input id="check-all" type="checkbox" class="flat-all"/></th>
|
||||
<th>Name
|
||||
<a title="Sort Descending" href="{$orderbyname_desc}"><i
|
||||
class="fa-icon-caret-down text-muted"> </i></a>
|
||||
<a title="Sort Ascending" href="{$orderbyname_asc}"><i
|
||||
class="fa-icon-caret-up text-muted"> </i></a>
|
||||
<th><input id="check-all" type="checkbox" class="flat-all"></th>
|
||||
<th>Name<br>
|
||||
<a title="Sort Descending" href="{$orderbyname_desc}"><i class="fas fa-caret-down"></i></a>
|
||||
<a title="Sort Ascending" href="{$orderbyname_asc}"><i class="fas fa-caret-up"> </i></a>
|
||||
</th>
|
||||
<th class="column-title" style="display: table-cell;">Category</th>
|
||||
<th class="column-title" style="display: table-cell;">Posted</th>
|
||||
<th class="column-title" style="display: table-cell;">Size</th>
|
||||
<th class="column-title" style="display: table-cell;">Category<br>
|
||||
<a title="Sort Descending" href="{$orderbycat_desc}"><i class="fas fa-caret-down"></i></a>
|
||||
<a title="Sort Ascending" href="{$orderbycat_asc}"><i class="fas fa-caret-up"></i></a>
|
||||
</th>
|
||||
<th class="column-title" style="display: table-cell;">Posted<br>
|
||||
<a title="Sort Descending" href="{$orderbyposted_desc}"><i class="fas fa-caret-down"></i></a>
|
||||
<a title="Sort Ascending" href="{$orderbyposted_asc}"><i class="fas fa-caret-up"></i></a>
|
||||
</th>
|
||||
<th style="vertical-align:top;text-align:center;">Size<br>
|
||||
<a title="Sort Descending" href="{$orderbysize_desc}"><i class="fas fa-caret-down"></i></a>
|
||||
<a title="Sort Ascending" href="{$orderbysize_asc}"><i class="fas fa-caret-up"></i></a>
|
||||
</th>
|
||||
<th style="vertical-align:top;text-align:center;">Files<br>
|
||||
<a title="Sort Descending" href="{$orderbyfiles_desc}"><i class="fas fa-caret-down"></i></a>
|
||||
<a title="Sort Ascending" href="{$orderbyfiles_asc}"><i class="fas fa-caret-up"></i></a>
|
||||
</th>
|
||||
<th style="vertical-align:top;text-align:center;">Grabs<br>
|
||||
<a title="Sort Descending" href="{$orderbystats_desc}"><i class="fas fa-caret-down"></i></a>
|
||||
<a title="Sort Ascending" href="{$orderbystats_asc}"><i class="fas fa-caret-up"></i></a>
|
||||
</th>
|
||||
<th class="column-title no-link last" style="display: table-cell;">Action</th>
|
||||
<th class="bulk-actions" colspan="7">
|
||||
<a class="antoo" style="color:#fff; font-weight:500;">Bulk Actions ( <span
|
||||
@@ -151,6 +166,7 @@
|
||||
</td>
|
||||
<td>{Illuminate\Support\Carbon::parse({{Timezone::convertToLocal(Illuminate\Support\Carbon::parse($result->postdate, config('app.timezone')), 'Y-m-d h:i:s')}})->diffForHumans()}</td>
|
||||
<td>{$result->size|filesize}</td>
|
||||
<td>{$result->grabs}</td>
|
||||
<td>
|
||||
<a href="{{url("/getnzb?id={$result->guid}")}}"
|
||||
class="icon_nzb text-muted"><i
|
||||
|
||||
Reference in New Issue
Block a user