@@ -15,11 +15,13 @@ discard block |
||
| 15 | 15 | <?php $__db_h = new db_helper(); ?> |
| 16 | 16 | <?php $__time_h = new time_helper(); ?> |
| 17 | 17 | <?php |
| 18 | - if(isset($_SESSION['siteusername'])) |
|
| 19 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 18 | + if(isset($_SESSION['siteusername'])) { |
|
| 19 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 20 | + } |
|
| 20 | 21 | |
| 21 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 22 | - header("Location: /?userdoesntexist"); |
|
| 22 | + if(!$__user_h->user_exists($_GET['n'])) { |
|
| 23 | + header("Location: /?userdoesntexist"); |
|
| 24 | + } |
|
| 23 | 25 | |
| 24 | 26 | $_user = $__user_h->fetch_user_username($_GET['n']); |
| 25 | 27 | |
@@ -42,10 +44,11 @@ discard block |
||
| 42 | 44 | |
| 43 | 45 | if ( |
| 44 | 46 | ctype_xdigit($colorCode) && |
| 45 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
| 46 | - return true; |
|
| 47 | - |
|
| 48 | - else return false; |
|
| 47 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
| 48 | + return true; |
|
| 49 | + } else { |
|
| 50 | + return false; |
|
| 51 | + } |
|
| 49 | 52 | } |
| 50 | 53 | |
| 51 | 54 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
@@ -77,8 +80,9 @@ discard block |
||
| 77 | 80 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 78 | 81 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 79 | 82 | |
| 80 | - if(isset($_SESSION['siteusername'])) |
|
| 81 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 83 | + if(isset($_SESSION['siteusername'])) { |
|
| 84 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 85 | + } |
|
| 82 | 86 | |
| 83 | 87 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 84 | 88 | $error = array(); |
@@ -85,10 +85,11 @@ |
||
| 85 | 85 | $status = "Unknown"; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if($video['commenting'] == "a") |
|
| 89 | - $video['commentstatus'] = "Commenting allowed"; |
|
| 90 | - else |
|
| 91 | - $video['commentstatus'] = "Commenting disallowed"; |
|
| 88 | + if($video['commenting'] == "a") { |
|
| 89 | + $video['commentstatus'] = "Commenting allowed"; |
|
| 90 | + } else { |
|
| 91 | + $video['commentstatus'] = "Commenting disallowed"; |
|
| 92 | + } |
|
| 92 | 93 | ?> |
| 93 | 94 | <tr style="margin-top: 5px;" id="videoslist"> |
| 94 | 95 | <td class="video-manager-left"> |
@@ -224,10 +224,11 @@ |
||
| 224 | 224 | $status = "Unknown"; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - if($video['commenting'] == "a") |
|
| 228 | - $video['commentstatus'] = "Commenting allowed"; |
|
| 229 | - else |
|
| 230 | - $video['commentstatus'] = "Commenting disallowed"; |
|
| 227 | + if($video['commenting'] == "a") { |
|
| 228 | + $video['commentstatus'] = "Commenting allowed"; |
|
| 229 | + } else { |
|
| 230 | + $video['commentstatus'] = "Commenting disallowed"; |
|
| 231 | + } |
|
| 231 | 232 | ?> |
| 232 | 233 | <tr style="margin-top: 5px;" id="videoslist"> |
| 233 | 234 | <td class="video-manager-left"> |
@@ -83,10 +83,11 @@ |
||
| 83 | 83 | $status = "Unknown"; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if($_video['commenting'] == "a") |
|
| 87 | - $_video['commentstatus'] = "Commenting allowed"; |
|
| 88 | - else |
|
| 89 | - $_video['commentstatus'] = "Commenting disallowed"; |
|
| 86 | + if($_video['commenting'] == "a") { |
|
| 87 | + $_video['commentstatus'] = "Commenting allowed"; |
|
| 88 | + } else { |
|
| 89 | + $_video['commentstatus'] = "Commenting disallowed"; |
|
| 90 | + } |
|
| 90 | 91 | ?> |
| 91 | 92 | <tr style="margin-top: 5px;" id="videoslist"> |
| 92 | 93 | <td class="video-manager-left"> |
@@ -23,8 +23,9 @@ |
||
| 23 | 23 | $stmt->bind_param("ssss", $_POST['title'], $_POST['comment'], $rid, $_SESSION['siteusername']); |
| 24 | 24 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; |
| 25 | 25 | $result = ''; |
| 26 | - for ($i = 0; $i < 11; $i++) |
|
| 27 | - $rid .= $characters[mt_rand(0, 63)]; |
|
| 26 | + for ($i = 0; $i < 11; $i++) { |
|
| 27 | + $rid .= $characters[mt_rand(0, 63)]; |
|
| 28 | + } |
|
| 28 | 29 | $text = htmlspecialchars($_POST['comment']); |
| 29 | 30 | $stmt->execute(); |
| 30 | 31 | $stmt->close(); |
@@ -34,8 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | $row = $result->fetch_assoc(); |
| 36 | 36 | if(!isset($row['password'])) |
| 37 | - { $request->error->message = "Incorrect username or password!"; $request->error->status = ""; } |
|
| 38 | - else |
|
| 37 | + { $request->error->message = "Incorrect username or password!"; $request->error->status = ""; } else |
|
| 39 | 38 | { $request->returned_password = $row['password']; } |
| 40 | 39 | |
| 41 | 40 | if(!password_verify($request->password, $request->returned_password)) |
@@ -23,8 +23,9 @@ |
||
| 23 | 23 | ?> |
| 24 | 24 | <?php |
| 25 | 25 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; |
| 26 | - for ($i = 0; $i < 11; $i++) |
|
| 27 | - $rid .= $characters[mt_rand(0, 63)]; |
|
| 26 | + for ($i = 0; $i < 11; $i++) { |
|
| 27 | + $rid .= $characters[mt_rand(0, 63)]; |
|
| 28 | + } |
|
| 28 | 29 | |
| 29 | 30 | $video_properties = (object) [ |
| 30 | 31 | 'video_rid' => $rid, |
@@ -24,10 +24,11 @@ discard block |
||
| 24 | 24 | $pfp = $row['pfp']; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - if(!isset($pfp)) |
|
| 28 | - return "default.png"; |
|
| 29 | - else |
|
| 30 | - return $pfp; |
|
| 27 | + if(!isset($pfp)) { |
|
| 28 | + return "default.png"; |
|
| 29 | + } else { |
|
| 30 | + return $pfp; |
|
| 31 | + } |
|
| 31 | 32 | |
| 32 | 33 | $stmt->close(); |
| 33 | 34 | } |
@@ -87,10 +88,11 @@ discard block |
||
| 87 | 88 | $result = $stmt->get_result(); |
| 88 | 89 | $user = $result->fetch_assoc(); |
| 89 | 90 | |
| 90 | - if($result->num_rows === 0) |
|
| 91 | - return 0; |
|
| 92 | - else |
|
| 93 | - return $user; |
|
| 91 | + if($result->num_rows === 0) { |
|
| 92 | + return 0; |
|
| 93 | + } else { |
|
| 94 | + return $user; |
|
| 95 | + } |
|
| 94 | 96 | |
| 95 | 97 | $stmt->close(); |
| 96 | 98 | } |
@@ -58,10 +58,14 @@ |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | if(!isset($cLang)) { |
| 61 | - if (!$full) $string = array_slice($string, 0, 1); |
|
| 61 | + if (!$full) { |
|
| 62 | + $string = array_slice($string, 0, 1); |
|
| 63 | + } |
|
| 62 | 64 | return $string ? implode(', ', $string) . ' ago' : 'just now'; |
| 63 | 65 | } else { |
| 64 | - if (!$full) $string = array_slice($string, 0, 1); |
|
| 66 | + if (!$full) { |
|
| 67 | + $string = array_slice($string, 0, 1); |
|
| 68 | + } |
|
| 65 | 69 | return $string ? implode($cLang['agoLeft'], $string) . " " . " " . $cLang['agoRight'] : $cLang['justNow']; |
| 66 | 70 | } |
| 67 | 71 | } |