mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 12:09:02 -05:00
(Update) Forum View
Change default ordering of topics/posts.
This commit is contained in:
@@ -164,15 +164,15 @@ class ForumController extends Controller
|
||||
$order = 'asc';
|
||||
}
|
||||
if ($request->has('body') && $request->input('body') != '') {
|
||||
$sorting = 'posts.created_at';
|
||||
if ($request->has('sorting') && $request->input('sorting') == 'updated_at') {
|
||||
$sorting = 'posts.updated_at';
|
||||
$sorting = 'posts.updated_at';
|
||||
if ($request->has('sorting') && $request->input('sorting') == 'created_at') {
|
||||
$sorting = 'posts.created_at';
|
||||
}
|
||||
$results = $result->orderBy($sorting, $direction)->paginate(25);
|
||||
} else {
|
||||
$sorting = 'topics.created_at';
|
||||
if ($request->has('sorting') && $request->input('sorting') == 'updated_at') {
|
||||
$sorting = 'topics.updated_at';
|
||||
$sorting = 'topics.updated_at';
|
||||
if ($request->has('sorting') && $request->input('sorting') == 'created_at') {
|
||||
$sorting = 'topics.created_at';
|
||||
}
|
||||
$results = $result->orderBy($sorting, $order)->paginate(25);
|
||||
}
|
||||
|
||||
@@ -197,8 +197,8 @@
|
||||
<label for="sort" class="mt-5 col-sm-1 label label-default fatten-me">@lang('common.sort')</label>
|
||||
<div class="col-sm-2">
|
||||
<select id="sorting" name="sorting" class="form-control">
|
||||
<option value="created_at" {{ (isset($params) && is_array($params) && array_key_exists('sorting',$params) && $params['sorting'] == 'created_at' ? 'SELECTED' : '') }}>Created At</option>
|
||||
<option value="updated_at" {{ (isset($params) && is_array($params) && array_key_exists('sorting',$params) && $params['sorting'] == 'updated_at' ? 'SELECTED' : '') }}>Updated At</option>
|
||||
<option value="created_at" {{ (isset($params) && is_array($params) && array_key_exists('sorting',$params) && $params['sorting'] == 'created_at' ? 'SELECTED' : '') }}>Created At</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -197,8 +197,8 @@
|
||||
<label for="sort" class="mt-5 col-sm-1 label label-default fatten-me">@lang('common.sort')</label>
|
||||
<div class="col-sm-2">
|
||||
<select id="sorting" name="sorting" class="form-control">
|
||||
<option value="created_at" {{ (isset($params) && is_array($params) && array_key_exists('sorting',$params) && $params['sorting'] == 'created_at' ? 'SELECTED' : '') }}>Created At</option>
|
||||
<option value="updated_at" {{ (isset($params) && is_array($params) && array_key_exists('sorting',$params) && $params['sorting'] == 'updated_at' ? 'SELECTED' : '') }}>Updated At</option>
|
||||
<option value="created_at" {{ (isset($params) && is_array($params) && array_key_exists('sorting',$params) && $params['sorting'] == 'created_at' ? 'SELECTED' : '') }}>Created At</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user