mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-22 01:38:49 -05:00
Apply fixes from StyleCI
This commit is contained in:
@@ -83,7 +83,7 @@ class HomeController extends Controller
|
||||
$posts = Post::latest()->take(5)->get();
|
||||
|
||||
// Online Block
|
||||
$users = User::with(['privacy','group' => function ($query) {
|
||||
$users = User::with(['privacy', 'group' => function ($query) {
|
||||
$query->select(['id', 'name', 'color', 'effect', 'icon', 'position']);
|
||||
}])->select(['id', 'username', 'hidden', 'group_id'])->oldest('username')->get();
|
||||
$groups = Group::select(['name', 'color', 'effect', 'icon'])->oldest('position')->get();
|
||||
|
||||
@@ -30,11 +30,11 @@ use App\History;
|
||||
use App\Torrent;
|
||||
use App\Warning;
|
||||
use App\Bookmark;
|
||||
use App\TorrentRequest;
|
||||
use App\Graveyard;
|
||||
use Carbon\Carbon;
|
||||
use App\UserPrivacy;
|
||||
use App\PrivateMessage;
|
||||
use App\TorrentRequest;
|
||||
use App\BonTransactions;
|
||||
use App\Services\Bencode;
|
||||
use App\UserNotification;
|
||||
@@ -113,8 +113,8 @@ class UserController extends Controller
|
||||
$realdownload = $user->downloaded + $bondownload;
|
||||
$invitedBy = Invite::where('accepted_by', '=', $user->id)->first();
|
||||
|
||||
$requested = TorrentRequest::where('user_id','=',$user->id)->count();
|
||||
$filled = TorrentRequest::where('filled_by','=',$user->id)->whereNotNull('approved_by')->count();
|
||||
$requested = TorrentRequest::where('user_id', '=', $user->id)->count();
|
||||
$filled = TorrentRequest::where('filled_by', '=', $user->id)->whereNotNull('approved_by')->count();
|
||||
|
||||
return view('user.profile', [
|
||||
'route' => 'profile',
|
||||
@@ -1540,7 +1540,6 @@ class UserController extends Controller
|
||||
'seeds' => $table,
|
||||
])->render();
|
||||
} elseif ($request->has('view') && $request->input('view') == 'requests') {
|
||||
|
||||
$torrentRequests = TorrentRequest::with(['user', 'category']);
|
||||
|
||||
$order = null;
|
||||
@@ -1564,7 +1563,7 @@ class UserController extends Controller
|
||||
->whereNull('approved_when');
|
||||
}
|
||||
if ($request->has('claimed') && $request->input('claimed') != null) {
|
||||
$torrentRequests->where('claimed','=',1);
|
||||
$torrentRequests->where('claimed', '=', 1);
|
||||
}
|
||||
if ($request->has('unfilled') && $request->input('unfilled') != null) {
|
||||
$torrentRequests->where(function ($query) {
|
||||
@@ -1589,10 +1588,9 @@ class UserController extends Controller
|
||||
$direction = 2;
|
||||
}
|
||||
|
||||
if($sorting == 'date') {
|
||||
if ($sorting == 'date') {
|
||||
$table = $torrentRequests->where('user_id', '=', $user->id)->orderBy('created_at', $order)->paginate(25);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$table = $torrentRequests->where('user_id', '=', $user->id)->orderBy($sorting, $order)->paginate(25);
|
||||
}
|
||||
|
||||
@@ -1600,7 +1598,7 @@ class UserController extends Controller
|
||||
'user' => $user,
|
||||
'torrentRequests' => $table,
|
||||
])->render();
|
||||
} elseif ($request->has('view') && $request->input('view') == 'resurrections') {
|
||||
} elseif ($request->has('view') && $request->input('view') == 'resurrections') {
|
||||
$history = Graveyard::with(['torrent', 'user'])->leftJoin('torrents', 'torrents.id', '=', 'graveyard.torrent_id');
|
||||
|
||||
$order = null;
|
||||
@@ -2099,7 +2097,7 @@ class UserController extends Controller
|
||||
|
||||
$logger = 'user.private.requests';
|
||||
|
||||
$torrentRequests = TorrentRequest::with(['user', 'category'])->where('user_id','=',$user->id)->latest()->paginate(25);
|
||||
$torrentRequests = TorrentRequest::with(['user', 'category'])->where('user_id', '=', $user->id)->latest()->paginate(25);
|
||||
|
||||
return view($logger, [
|
||||
'route' => 'requests',
|
||||
@@ -2113,7 +2111,7 @@ class UserController extends Controller
|
||||
} else {
|
||||
$logger = 'user.requests';
|
||||
|
||||
$torrentRequests = TorrentRequest::with(['user', 'category'])->where('user_id','=',$user->id)->where('anon','!=',1)->latest()->paginate(25);
|
||||
$torrentRequests = TorrentRequest::with(['user', 'category'])->where('user_id', '=', $user->id)->where('anon', '!=', 1)->latest()->paginate(25);
|
||||
|
||||
return view($logger, [
|
||||
'route' => 'requests',
|
||||
|
||||
+4
-2
@@ -579,7 +579,7 @@ class User extends Authenticatable
|
||||
if ($target->hidden && $target->hidden == 1) {
|
||||
return false;
|
||||
}
|
||||
if ($target->privacy && $type && (!$target->privacy->$type || $target->privacy->$type == 0)) {
|
||||
if ($target->privacy && $type && (! $target->privacy->$type || $target->privacy->$type == 0)) {
|
||||
return false;
|
||||
}
|
||||
if ($target->privacy && $target->privacy->$target_group && is_array($target->privacy->$target_group['default_groups'])) {
|
||||
@@ -587,11 +587,13 @@ class User extends Authenticatable
|
||||
if ($target->privacy->$target_group['default_groups'][$sender->group->id] == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -613,7 +615,7 @@ class User extends Authenticatable
|
||||
if ($target->private_profile && $target->private_profile == 1) {
|
||||
return false;
|
||||
}
|
||||
if ($target->privacy && $type && (!$target->privacy->$type || $target->privacy->$type == 0)) {
|
||||
if ($target->privacy && $type && (! $target->privacy->$type || $target->privacy->$type == 0)) {
|
||||
return false;
|
||||
}
|
||||
if ($target->privacy && $target->privacy->$target_group && is_array($target->privacy->$target_group['default_groups'])) {
|
||||
|
||||
Reference in New Issue
Block a user