@@ -11,9 +11,9 @@ |
||
| 11 | 11 | ->where('comments.user_id', '=', $user_id) |
| 12 | 12 | ->first(); |
| 13 | 13 | |
| 14 | - if($comments->up > 0 || $comments->down > 0){ |
|
| 14 | + if ($comments->up > 0 || $comments->down > 0) { |
|
| 15 | 15 | return false; |
| 16 | - } else{ |
|
| 16 | + }else { |
|
| 17 | 17 | return true; |
| 18 | 18 | } |
| 19 | 19 | } |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | /** |
| 84 | 84 | * @param string $type |
| 85 | 85 | */ |
| 86 | - public static function getCommentsMax($type){ |
|
| 86 | + public static function getCommentsMax($type) { |
|
| 87 | 87 | $v = \DB::table('comments') |
| 88 | 88 | ->selectRaw('count(id) as maxviews') |
| 89 | 89 | ->where('content_type', '=', \DB::raw("'".$type."'")) |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | - public static function getPopularity($views, $max){ |
|
| 26 | + public static function getPopularity($views, $max) { |
|
| 27 | 27 | |
| 28 | 28 | $ret = 0; |
| 29 | 29 | |
| 30 | - if($max == 0 || $views == 0){ |
|
| 30 | + if ($max == 0 || $views == 0) { |
|
| 31 | 31 | $ret = 0; |
| 32 | - } else{ |
|
| 32 | + }else { |
|
| 33 | 33 | $ret = ($views / $max) * 100; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * @param integer $size |
| 41 | 41 | */ |
| 42 | - public static function getReadableBytes($size){ |
|
| 42 | + public static function getReadableBytes($size) { |
|
| 43 | 43 | $bytes = $size; |
| 44 | 44 | |
| 45 | 45 | if ($bytes == 0) { |
@@ -83,11 +83,11 @@ |
||
| 83 | 83 | return redirect()->action('BoardController@create_cat'); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - public function show_thread($threadid){ |
|
| 86 | + public function show_thread($threadid) { |
|
| 87 | 87 | $posts = BoardPost::with('user', 'thread', 'cat')->whereThreadId($threadid)->orderBy('id')->paginate(25); |
| 88 | - if(!Input::get('page')){ |
|
| 88 | + if (!Input::get('page')) { |
|
| 89 | 89 | return redirect('board/thread/'.$threadid.'?page='.$posts->lastPage()); |
| 90 | - }else{ |
|
| 90 | + }else { |
|
| 91 | 91 | return view('board.threads.show', [ |
| 92 | 92 | 'posts' => $posts, |
| 93 | 93 | ]); |