diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 22d0cc9..fd34cdf 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -48,18 +48,18 @@ class HomeController extends Controller { return $r->add($rr); } - public function addContent ($bdl) { + public function addContent (Request $rr) { $r = new Content($this->valid, $this->menu, $this->user); - return $r->add($bdl); + return $r->add($rr); } - public function editContent ($bdl) { + public function editContent (Request $rr) { $r = new Content($this->valid, $this->menu, $this->user); - return $r->edit($bdl); + return $r->edit($rr); } - public function delContent ($bdl) { + public function delContent (Request $rr) { $r = new Content($this->valid, $this->menu, $this->user); - return $r->delete($bdl); + return $r->delete($rr); } } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index ee41d3e..a73fa20 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -106,8 +106,23 @@ class UserController extends Controller { $get = DB::table('users')->where('id', $id)->first(); $get->profile = DB::table('usr_profile')->where('user_id', $id)->first(); $get->profile->showname = (!empty($get->profile->display_name) && !is_null($get->profile->display_name) ? $get->profile->display_name : $get->username); + $perm_id = DB::table('usr_perm_id')->select('perm_id')->where('user_id', $get->id)->first()->perm_id; + $ucol = DB::table('usr_perm_module')->select('id', 'colour_m', 'colour_f', 'colour_u')->get(); + + if (!empty($get->profile->name_style)) $get->profile->name_style = $get->profile->name_style; + else { + foreach ($ucol as $j3) { + if ($j3->id == $perm_id) { + if ($get->profile->gender == 1) $get->profile->name_style = $j3->colour_m; + else if ($get->profile->gender == 2) $get->profile->name_style = $j3->colour_f; + else $get->profile->name_style = $j3->colour_u; + } + } + } + $get->perm = $valid; - if (empty($get->avatar) || $get->avatar == '') $get->avatar = '/img/noicon.webp'; + if (empty($get->profile->avatar) || $get->profile->avatar == '') $get->profile->avatar = 'img/noicon.webp'; + $get->profile->avatar = '/'.$get->profile->avatar; return $get; } diff --git a/app/helpers.php b/app/helpers.php index 6cc2ab1..995e73e 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -40,6 +40,7 @@ function userDetail ($id, $kero=null) { $log_username = $log_username->username; $showname = ''; $showcol = ''; + $ucol = DB::table('usr_perm_module')->select('id', 'colour_m', 'colour_f', 'colour_u')->get(); if (!empty($p3->display_name)) $showname = $p3->display_name; else $showname = $log_username; diff --git a/resources/views/layouts/site.blade.php b/resources/views/layouts/site.blade.php index 36457ce..bd1d053 100644 --- a/resources/views/layouts/site.blade.php +++ b/resources/views/layouts/site.blade.php @@ -54,7 +54,7 @@