@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | <?php $__db_h = new db_helper(); ?> |
13 | 13 | <?php $__time_h = new time_helper(); ?> |
14 | 14 | <?php |
15 | - if(isset($_SESSION['siteusername'])) |
|
15 | + if (isset($_SESSION['siteusername'])) |
|
16 | 16 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
17 | 17 | |
18 | - if(!$__user_h->user_exists($_GET['n'])) |
|
18 | + if (!$__user_h->user_exists($_GET['n'])) |
|
19 | 19 | header("Location: /?userdoesntexist"); |
20 | 20 | |
21 | 21 | $_user = $__user_h->fetch_user_username($_GET['n']); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $stmt->bindParam(":username", $_user['username']); |
25 | 25 | $stmt->execute(); |
26 | 26 | |
27 | - while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
27 | + while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
28 | 28 | header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines."); |
29 | 29 | } |
30 | 30 | |
@@ -76,28 +76,28 @@ discard block |
||
76 | 76 | $_user['genre'] = strtolower($_user['genre']); |
77 | 77 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
78 | 78 | |
79 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
80 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
81 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
82 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
83 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
84 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
79 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
80 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
81 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
82 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
83 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
84 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
85 | 85 | |
86 | - if(isset($_SESSION['siteusername'])) |
|
86 | + if (isset($_SESSION['siteusername'])) |
|
87 | 87 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
88 | 88 | |
89 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
89 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
90 | 90 | $error = array(); |
91 | 91 | |
92 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
93 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
94 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
92 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
93 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
94 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
95 | 95 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
96 | 96 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
97 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
97 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
98 | 98 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
99 | 99 | |
100 | - if(!isset($error['message'])) { |
|
100 | + if (!isset($error['message'])) { |
|
101 | 101 | $text = $_POST['comment']; |
102 | 102 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
103 | 103 | $stmt->bindParam(":id", $_user['username']); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
109 | 109 | |
110 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
110 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
111 | 111 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
112 | 112 | } |
113 | 113 | } |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
142 | 142 | <style> |
143 | 143 | #content-container { |
144 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
144 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
145 | 145 | background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>); |
146 | 146 | background-repeat: repeat; |
147 | 147 | <?php |
148 | - switch($_user['2012_bgoption']) { |
|
148 | + switch ($_user['2012_bgoption']) { |
|
149 | 149 | case "stretch": |
150 | 150 | echo "background-size: cover;"; |
151 | 151 | break; |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
179 | 179 | <div id="content-container"> |
180 | 180 | <!-- begin content --> |
181 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
181 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
182 | 182 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
183 | 183 | <?php } ?> |
184 | 184 | <?php |
185 | - if(empty(trim($_user['bio']))) |
|
185 | + if (empty(trim($_user['bio']))) |
|
186 | 186 | $_user['bio'] = "This user has no description."; |
187 | 187 | ?> |
188 | 188 | <div id="content"> |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
238 | 238 | </div> |
239 | 239 | <div class="upper-left-section enable-fancy-subscribe-button"> |
240 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
240 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
241 | 241 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
242 | 242 | <button |
243 | 243 | href="#" |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | title="" |
246 | 246 | id="subscribe-button" |
247 | 247 | type="button" |
248 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
248 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
249 | 249 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
250 | 250 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
251 | 251 | <span class="subscribed-label">Subscribed</span> |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | <?php } else { ?> |
262 | 262 | |
263 | 263 | <?php } ?> |
264 | - <?php if($__user_h->if_partner($_user['username'])) { ?> |
|
264 | + <?php if ($__user_h->if_partner($_user['username'])) { ?> |
|
265 | 265 | <img style="width: 29px;vertical-align: middle;margin-left: 10px;" title="This user is a SubRocks partner" src="/yt/imgbin/RenderedImage.png"> |
266 | 266 | <?php } ?> |
267 | 267 | </div> |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | </div> |
315 | 315 | </div> |
316 | 316 | </div> |
317 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
317 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
318 | 318 | <div id="branded-page-body"> |
319 | 319 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_feed.php"); ?></div> |
320 | 320 | </div> |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | <?php $__db_h = new db_helper(); ?> |
13 | 13 | <?php $__time_h = new time_helper(); ?> |
14 | 14 | <?php |
15 | - if(isset($_SESSION['siteusername'])) |
|
15 | + if (isset($_SESSION['siteusername'])) |
|
16 | 16 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
17 | 17 | |
18 | - if(!$__user_h->user_exists($_GET['n'])) |
|
18 | + if (!$__user_h->user_exists($_GET['n'])) |
|
19 | 19 | header("Location: /?userdoesntexist"); |
20 | 20 | |
21 | 21 | $_user = $__user_h->fetch_user_username($_GET['n']); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $stmt->bindParam(":username", $_user['username']); |
25 | 25 | $stmt->execute(); |
26 | 26 | |
27 | - while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
27 | + while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
28 | 28 | header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines."); |
29 | 29 | } |
30 | 30 | |
@@ -76,28 +76,28 @@ discard block |
||
76 | 76 | $_user['genre'] = strtolower($_user['genre']); |
77 | 77 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
78 | 78 | |
79 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
80 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
81 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
82 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
83 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
84 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
79 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
80 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
81 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
82 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
83 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
84 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
85 | 85 | |
86 | - if(isset($_SESSION['siteusername'])) |
|
86 | + if (isset($_SESSION['siteusername'])) |
|
87 | 87 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
88 | 88 | |
89 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
89 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
90 | 90 | $error = array(); |
91 | 91 | |
92 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
93 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
94 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
92 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
93 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
94 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
95 | 95 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
96 | 96 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
97 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
97 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
98 | 98 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
99 | 99 | |
100 | - if(!isset($error['message'])) { |
|
100 | + if (!isset($error['message'])) { |
|
101 | 101 | $text = $_POST['comment']; |
102 | 102 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
103 | 103 | $stmt->bindParam(":id", $_user['username']); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
109 | 109 | |
110 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
110 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
111 | 111 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
112 | 112 | } |
113 | 113 | } |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
142 | 142 | <style> |
143 | 143 | #content-container { |
144 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
144 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
145 | 145 | background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>); |
146 | 146 | background-repeat: repeat; |
147 | 147 | <?php |
148 | - switch($_user['2012_bgoption']) { |
|
148 | + switch ($_user['2012_bgoption']) { |
|
149 | 149 | case "stretch": |
150 | 150 | echo "background-size: cover;"; |
151 | 151 | break; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
179 | 179 | <div id="content-container"> |
180 | 180 | <!-- begin content --> |
181 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
181 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
182 | 182 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
183 | 183 | <?php } ?> |
184 | 184 | <div id="content"> |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
234 | 234 | </div> |
235 | 235 | <div class="upper-left-section enable-fancy-subscribe-button"> |
236 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
236 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
237 | 237 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
238 | 238 | <button |
239 | 239 | href="#" |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | title="" |
242 | 242 | id="subscribe-button" |
243 | 243 | type="button" |
244 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
244 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
245 | 245 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
246 | 246 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
247 | 247 | <span class="subscribed-label">Subscribed</span> |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | <?php } else { ?> |
258 | 258 | |
259 | 259 | <?php } ?> |
260 | - <?php if($__user_h->if_partner($_user['username'])) { ?> |
|
260 | + <?php if ($__user_h->if_partner($_user['username'])) { ?> |
|
261 | 261 | <img style="width: 29px;vertical-align: middle;margin-left: 10px;" title="This user is a SubRocks partner" src="/yt/imgbin/RenderedImage.png"> |
262 | 262 | <?php } ?> |
263 | 263 | </div> |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | </div> |
311 | 311 | </div> |
312 | 312 | </div> |
313 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
313 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
314 | 314 | <div id="branded-page-body"> |
315 | 315 | <div class="channel-tab-content channel-layout-full-width"> |
316 | 316 | <div class="tab-content-body"> |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC"); |
345 | 345 | $stmt->bindParam(":username", $_user['username']); |
346 | 346 | $stmt->execute(); |
347 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
347 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
348 | 348 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
349 | 349 | $video['duration'] = $__time_h->timestamp($video['duration']); |
350 | 350 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | - if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_GET['n']) { |
|
20 | - if(!empty($_GET["n"]) && $_GET['n'] == "pfp") { |
|
19 | + if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_GET['n']) { |
|
20 | + if (!empty($_GET["n"]) && $_GET['n'] == "pfp") { |
|
21 | 21 | $target_dir = "../dynamic/pfp/"; |
22 | 22 | $imageFileType = strtolower(pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION)); |
23 | 23 | $target_name = md5_file($_FILES["file"]["tmp_name"]) . "." . $imageFileType; |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | $uploadOk = true; |
28 | 28 | $movedFile = false; |
29 | 29 | |
30 | - if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
31 | - && $imageFileType != "gif" ) { |
|
30 | + if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
31 | + && $imageFileType != "gif") { |
|
32 | 32 | $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif'; |
33 | 33 | $uploadOk = false; |
34 | 34 | goto skip; |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
54 | - } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['backgroundbgset']) { |
|
55 | - if(!empty($_FILES["backgroundbgset"]["name"])) { |
|
54 | + } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['backgroundbgset']) { |
|
55 | + if (!empty($_FILES["backgroundbgset"]["name"])) { |
|
56 | 56 | $target_dir = "../dynamic/banners/"; |
57 | 57 | $imageFileType = strtolower(pathinfo($_FILES["backgroundbgset"]["name"], PATHINFO_EXTENSION)); |
58 | 58 | $target_name = md5_file($_FILES["backgroundbgset"]["tmp_name"]) . "." . $imageFileType; |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | $uploadOk = true; |
63 | 63 | $movedFile = false; |
64 | 64 | |
65 | - if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
66 | - && $imageFileType != "gif" ) { |
|
65 | + if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
66 | + && $imageFileType != "gif") { |
|
67 | 67 | $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif'; |
68 | 68 | $uploadOk = false; |
69 | 69 | goto skip; |
70 | 70 | } |
71 | 71 | |
72 | - if($uploadOk) { |
|
72 | + if ($uploadOk) { |
|
73 | 73 | if (file_exists($target_file)) { |
74 | 74 | $movedFile = true; |
75 | 75 | } else { |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | } |
88 | - } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['watchsubset']) { |
|
88 | + } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['watchsubset']) { |
|
89 | 89 | echo "asdas"; |
90 | - if(!empty($_FILES["watchsubset"]["name"])) { |
|
90 | + if (!empty($_FILES["watchsubset"]["name"])) { |
|
91 | 91 | echo "asdas"; |
92 | 92 | |
93 | 93 | $target_dir = "../dynamic/banners/"; |
@@ -99,14 +99,14 @@ discard block |
||
99 | 99 | $uploadOk = true; |
100 | 100 | $movedFile = false; |
101 | 101 | |
102 | - if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
103 | - && $imageFileType != "gif" ) { |
|
102 | + if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
103 | + && $imageFileType != "gif") { |
|
104 | 104 | $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif'; |
105 | 105 | $uploadOk = false; |
106 | 106 | goto skip; |
107 | 107 | } |
108 | 108 | |
109 | - if($uploadOk) { |
|
109 | + if ($uploadOk) { |
|
110 | 110 | if (file_exists($target_file)) { |
111 | 111 | $movedFile = true; |
112 | 112 | } else { |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
125 | - } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['bannerset']) { |
|
126 | - if(!empty($_FILES["file"]["name"])) { |
|
125 | + } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['bannerset']) { |
|
126 | + if (!empty($_FILES["file"]["name"])) { |
|
127 | 127 | $target_dir = "../dynamic/banners/"; |
128 | 128 | $imageFileType = strtolower(pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION)); |
129 | 129 | $target_name = md5_file($_FILES["file"]["tmp_name"]) . "." . $imageFileType; |
@@ -133,14 +133,14 @@ discard block |
||
133 | 133 | $uploadOk = true; |
134 | 134 | $movedFile = false; |
135 | 135 | |
136 | - if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
137 | - && $imageFileType != "gif" ) { |
|
136 | + if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
137 | + && $imageFileType != "gif") { |
|
138 | 138 | $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif'; |
139 | 139 | $uploadOk = false; |
140 | 140 | goto skip; |
141 | 141 | } |
142 | 142 | |
143 | - if($uploadOk) { |
|
143 | + if ($uploadOk) { |
|
144 | 144 | if (file_exists($target_file)) { |
145 | 145 | $movedFile = true; |
146 | 146 | } else { |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | } |
159 | - } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['videopagebanner']) { |
|
160 | - if(!empty($_FILES["videopagebanner"]["name"])) { |
|
159 | + } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['videopagebanner']) { |
|
160 | + if (!empty($_FILES["videopagebanner"]["name"])) { |
|
161 | 161 | $target_dir = "/dynamic/subscribe/"; |
162 | 162 | $imageFileType = strtolower(pathinfo($_FILES["videopagebanner"]["name"], PATHINFO_EXTENSION)); |
163 | 163 | $target_name = md5_file($_FILES["videopagebanner"]["tmp_name"]) . "." . $imageFileType; |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | $uploadOk = true; |
168 | 168 | $movedFile = false; |
169 | 169 | |
170 | - if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
171 | - && $imageFileType != "gif" ) { |
|
170 | + if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
171 | + && $imageFileType != "gif") { |
|
172 | 172 | $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif'; |
173 | 173 | $uploadOk = false; |
174 | 174 | goto skip; |
175 | 175 | } |
176 | 176 | |
177 | - if($uploadOk) { |
|
177 | + if ($uploadOk) { |
|
178 | 178 | if (file_exists($target_file)) { |
179 | 179 | $movedFile = true; |
180 | 180 | } else { |
@@ -192,81 +192,81 @@ discard block |
||
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | - if(!empty($_POST['bio'])) { |
|
195 | + if (!empty($_POST['bio'])) { |
|
196 | 196 | $__user_u->update_row($_SESSION['siteusername'], "bio", $_POST['bio']); |
197 | 197 | } |
198 | 198 | |
199 | - if(!empty($_POST['featuredchannels'])) { |
|
199 | + if (!empty($_POST['featuredchannels'])) { |
|
200 | 200 | $__user_u->update_row($_SESSION['siteusername'], "featured_channels", $_POST['featuredchannels']); |
201 | 201 | } |
202 | 202 | |
203 | - if(!empty($_POST['css'])) { |
|
203 | + if (!empty($_POST['css'])) { |
|
204 | 204 | $__user_u->update_row($_SESSION['siteusername'], "css", $_POST['css']); |
205 | 205 | } |
206 | 206 | |
207 | - if(!empty($_POST['videoid'])) { |
|
207 | + if (!empty($_POST['videoid'])) { |
|
208 | 208 | $__user_u->update_row($_SESSION['siteusername'], "featured", $_POST['videoid']); |
209 | 209 | } |
210 | 210 | |
211 | - if(!empty($_POST['solidcolor'])) { |
|
211 | + if (!empty($_POST['solidcolor'])) { |
|
212 | 212 | $__user_u->update_row($_SESSION['siteusername'], "2012_bgoption", $_POST['bgoption']); |
213 | 213 | |
214 | - if($_POST['bgoption'] == "solid") |
|
214 | + if ($_POST['bgoption'] == "solid") |
|
215 | 215 | $__user_u->update_row($_SESSION['siteusername'], "2012_bg", ""); |
216 | 216 | |
217 | 217 | $__user_u->update_row($_SESSION['siteusername'], "primary_color", $_POST['solidcolor']); |
218 | 218 | } |
219 | 219 | |
220 | - if(!empty($_POST['transparency'])) { |
|
220 | + if (!empty($_POST['transparency'])) { |
|
221 | 221 | $__user_u->update_row($_SESSION['siteusername'], "transparency", $_POST['transparency']); |
222 | 222 | } |
223 | 223 | |
224 | - if(!empty($_POST['genre'])) { |
|
224 | + if (!empty($_POST['genre'])) { |
|
225 | 225 | $__user_u->update_row($_SESSION['siteusername'], "genre", $_POST['genre']); |
226 | 226 | } |
227 | 227 | |
228 | - if(!empty($_POST['bordercolor'])) { |
|
228 | + if (!empty($_POST['bordercolor'])) { |
|
229 | 229 | $__user_u->update_row($_SESSION['siteusername'], "border_color", $_POST['bordercolor']); |
230 | 230 | } |
231 | 231 | |
232 | - if(!empty($_POST['country'])) { |
|
232 | + if (!empty($_POST['country'])) { |
|
233 | 233 | $__user_u->update_row($_SESSION['siteusername'], "country", $_POST['country']); |
234 | 234 | } // duplicate? |
235 | 235 | |
236 | - if(!empty($_POST['header'])) { |
|
236 | + if (!empty($_POST['header'])) { |
|
237 | 237 | $__user_u->update_row($_SESSION['siteusername'], "custom_header", $_POST['header']); |
238 | 238 | } |
239 | 239 | |
240 | - if(!empty($_POST['customtext'])) { |
|
240 | + if (!empty($_POST['customtext'])) { |
|
241 | 241 | $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['customtext']); |
242 | 242 | } |
243 | 243 | |
244 | - if(!empty($_POST['country'])) { |
|
244 | + if (!empty($_POST['country'])) { |
|
245 | 245 | $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['country']); |
246 | 246 | } // duplicate? |
247 | 247 | |
248 | - if(!empty($_POST['website'])) { |
|
248 | + if (!empty($_POST['website'])) { |
|
249 | 249 | $__user_u->update_row($_SESSION['siteusername'], "website", $_POST['website']); |
250 | 250 | } |
251 | 251 | |
252 | - if(!empty($_POST['channelboxcolor'])) { |
|
252 | + if (!empty($_POST['channelboxcolor'])) { |
|
253 | 253 | $__user_u->update_row($_SESSION['siteusername'], "secondary_color", $_POST['channelboxcolor']); |
254 | 254 | } |
255 | 255 | |
256 | - if(!empty($_POST['backgroundcolor'])) { |
|
256 | + if (!empty($_POST['backgroundcolor'])) { |
|
257 | 257 | $__user_u->update_row($_SESSION['siteusername'], "third_color", $_POST['backgroundcolor']); |
258 | 258 | } |
259 | 259 | |
260 | - if(!empty($_POST['textmaincolor'])) { |
|
260 | + if (!empty($_POST['textmaincolor'])) { |
|
261 | 261 | $__user_u->update_row($_SESSION['siteusername'], "primary_color_text", $_POST['textmaincolor']); |
262 | 262 | } |
263 | 263 | |
264 | - if(!empty($_POST['layout_channel'])) { |
|
265 | - if($_POST['layout_channel'] == "feed" || $_POST['layout_channel'] == "featured" || $_POST['layout_channel'] == "playlists") |
|
264 | + if (!empty($_POST['layout_channel'])) { |
|
265 | + if ($_POST['layout_channel'] == "feed" || $_POST['layout_channel'] == "featured" || $_POST['layout_channel'] == "playlists") |
|
266 | 266 | $__user_u->update_row($_SESSION['siteusername'], "layout", $_POST['layout_channel']); |
267 | 267 | } |
268 | 268 | |
269 | - if(!empty($_POST['bgoptionset'])) { |
|
269 | + if (!empty($_POST['bgoptionset'])) { |
|
270 | 270 | $bgoption = $_POST['bgoption']; |
271 | 271 | $bgcolor = $_POST['solidcolor']; |
272 | 272 | $default = "default.png"; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | |
276 | 276 | $__user_u->update_row($_SESSION['siteusername'], "2012_bgcolor", $bgcolor); |
277 | 277 | |
278 | - if($bgoption == "solid") { |
|
278 | + if ($bgoption == "solid") { |
|
279 | 279 | $__user_u->update_row($_SESSION['siteusername'], "2012_bg ", $default); |
280 | 280 | } |
281 | 281 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | <?php $__time_h = new time_helper(); ?> |
13 | 13 | <?php |
14 | 14 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
15 | - if($_video['author'] != @$_SESSION['siteusername']) { |
|
15 | + if ($_video['author'] != @$_SESSION['siteusername']) { |
|
16 | 16 | die(); |
17 | 17 | } |
18 | 18 | |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | // $__video_u->update_row($_GET['v'], "thumbnail", $request->thumbnail); |
45 | 45 | $__video_u->update_row($_GET['v'], "category", $request->category); |
46 | 46 | |
47 | - if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) { |
|
48 | - if(!empty($_FILES["thumbnail"]["name"])) { |
|
47 | + if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) { |
|
48 | + if (!empty($_FILES["thumbnail"]["name"])) { |
|
49 | 49 | $target_dir = "../dynamic/thumbs/"; |
50 | 50 | $imageFileType = strtolower(pathinfo($_FILES["thumbnail"]["name"], PATHINFO_EXTENSION)); |
51 | 51 | $target_name = md5_file($_FILES["thumbnail"]["tmp_name"]) . "." . $imageFileType; |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | $uploadOk = true; |
56 | 56 | $movedFile = false; |
57 | 57 | |
58 | - if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
59 | - && $imageFileType != "gif" ) { |
|
58 | + if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
59 | + && $imageFileType != "gif") { |
|
60 | 60 | $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif'; |
61 | 61 | $uploadOk = false; |
62 | 62 | goto skip; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | - if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) { |
|
39 | + if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) { |
|
40 | 40 | $request = (object) [ |
41 | 41 | "username" => $_POST['username'], |
42 | 42 | "password" => $_POST['password'], |
@@ -52,27 +52,27 @@ discard block |
||
52 | 52 | $request->username = remove_emoji($request->username); |
53 | 53 | |
54 | 54 | if (!filter_var($request->email, FILTER_VALIDATE_EMAIL)) |
55 | - { $request->error->message = "Your email is invalid!"; $request->error->status = ""; } |
|
56 | - if(strlen($request->username) > 21) |
|
55 | + { $request->error->message = "Your email is invalid!"; $request->error->status = ""; } |
|
56 | + if (strlen($request->username) > 21) |
|
57 | 57 | { $request->error->message = "Your username must be shorter than 20 characters."; $request->error->status = ""; } |
58 | - if(strlen($request->password) < 8) |
|
58 | + if (strlen($request->password) < 8) |
|
59 | 59 | { $request->error->message = "Your password must at least be 8 characters long."; $request->error->status = ""; } |
60 | - if(!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) |
|
60 | + if (!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) |
|
61 | 61 | { $request->error->message = "Include numbers and letters in your password!"; $request->error->status = ""; } |
62 | - if(preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $request->username)) |
|
62 | + if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $request->username)) |
|
63 | 63 | { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; } |
64 | - if(!preg_match('/^\S+\w\S{1,}/', $request->username)) |
|
64 | + if (!preg_match('/^\S+\w\S{1,}/', $request->username)) |
|
65 | 65 | { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; } |
66 | - if(empty(trim($request->username))) |
|
66 | + if (empty(trim($request->username))) |
|
67 | 67 | { $request->error->message = "Your username cannot be empty!"; $request->error->status = ""; } |
68 | 68 | |
69 | 69 | $stmt = $__db->prepare("SELECT username FROM users WHERE username = lower(:username)"); |
70 | 70 | $stmt->bindParam(":username", $request->username); |
71 | 71 | $stmt->execute(); |
72 | - if($stmt->rowCount()) |
|
72 | + if ($stmt->rowCount()) |
|
73 | 73 | { $request->error->message = "There's already a user with that same username!"; $request->error->status = ""; } |
74 | 74 | |
75 | - if($request->error->status == "OK") { |
|
75 | + if ($request->error->status == "OK") { |
|
76 | 76 | $stmt = $__db->prepare("INSERT INTO users (username, email, password) VALUES (:username, :email, :password)"); |
77 | 77 | $stmt->bindParam(":username", $request->username); |
78 | 78 | $stmt->bindParam(":email", $request->email); |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | <?php $__db_h = new db_helper(); ?> |
13 | 13 | <?php $__time_h = new time_helper(); ?> |
14 | 14 | <?php |
15 | - if(isset($_SESSION['siteusername'])) |
|
15 | + if (isset($_SESSION['siteusername'])) |
|
16 | 16 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
17 | 17 | |
18 | - if(!$__user_h->user_exists($_GET['n'])) |
|
18 | + if (!$__user_h->user_exists($_GET['n'])) |
|
19 | 19 | header("Location: /?userdoesntexist"); |
20 | 20 | |
21 | 21 | $_user = $__user_h->fetch_user_username($_GET['n']); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $stmt->bindParam(":username", $_user['username']); |
25 | 25 | $stmt->execute(); |
26 | 26 | |
27 | - while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
27 | + while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
28 | 28 | header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines."); |
29 | 29 | } |
30 | 30 | |
@@ -75,28 +75,28 @@ discard block |
||
75 | 75 | $_user['genre'] = strtolower($_user['genre']); |
76 | 76 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
77 | 77 | |
78 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
79 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
80 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
81 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
82 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
83 | - if(!check_valid_colorhex($_user['2012_bgcolor']) && strlen($_user['2012_bgcolor']) != 6) { $_user['2012_bgcolor'] = ""; } |
|
78 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
79 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
80 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
81 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
82 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
83 | + if (!check_valid_colorhex($_user['2012_bgcolor']) && strlen($_user['2012_bgcolor']) != 6) { $_user['2012_bgcolor'] = ""; } |
|
84 | 84 | |
85 | - if(isset($_SESSION['siteusername'])) |
|
85 | + if (isset($_SESSION['siteusername'])) |
|
86 | 86 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
87 | 87 | |
88 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
88 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
89 | 89 | $error = array(); |
90 | 90 | |
91 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
92 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
93 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
91 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
92 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
93 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
94 | 94 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
95 | 95 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
96 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
96 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
97 | 97 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
98 | 98 | |
99 | - if(!isset($error['message'])) { |
|
99 | + if (!isset($error['message'])) { |
|
100 | 100 | $text = $_POST['comment']; |
101 | 101 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
102 | 102 | $stmt->bindParam(":id", $_user['username']); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
108 | 108 | |
109 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
109 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
110 | 110 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
111 | 111 | } |
112 | 112 | } |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
145 | 145 | <style> |
146 | 146 | #content-container { |
147 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
147 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
148 | 148 | background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>); |
149 | 149 | background-repeat: repeat; |
150 | 150 | <?php |
151 | - switch($_user['2012_bgoption']) { |
|
151 | + switch ($_user['2012_bgoption']) { |
|
152 | 152 | case "stretch": |
153 | 153 | echo "background-size: cover;"; |
154 | 154 | break; |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
193 | 193 | <div id="content-container"> |
194 | 194 | <!-- begin content --> |
195 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
195 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
196 | 196 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
197 | 197 | <?php } ?> |
198 | 198 | <?php |
199 | - if(empty(trim($_user['bio']))) |
|
199 | + if (empty(trim($_user['bio']))) |
|
200 | 200 | $_user['bio'] = "This user has no description."; |
201 | 201 | ?> |
202 | 202 | <div id="content"> |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
252 | 252 | </div> |
253 | 253 | <div class="upper-left-section enable-fancy-subscribe-button"> |
254 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
254 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
255 | 255 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
256 | 256 | <button |
257 | 257 | href="#" |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | title="" |
260 | 260 | id="subscribe-button" |
261 | 261 | type="button" |
262 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
262 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
263 | 263 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
264 | 264 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
265 | 265 | <span class="subscribed-label">Subscribed</span> |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | <?php } else { ?> |
276 | 276 | |
277 | 277 | <?php } ?> |
278 | - <?php if($__user_h->if_partner($_user['username'])) { ?> |
|
278 | + <?php if ($__user_h->if_partner($_user['username'])) { ?> |
|
279 | 279 | <img style="width: 29px;vertical-align: middle;margin-left: 10px;" title="This user is a SubRocks partner" src="/yt/imgbin/RenderedImage.png"> |
280 | 280 | <?php } ?> |
281 | 281 | </div> |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | <div class="header-stats"> |
284 | 284 | <div class="stat-entry"> |
285 | 285 | <span class="stat-value"><?php echo $_user['subscribers']; ?></span> |
286 | - <span class="stat-name"><?php if($_user['subscribers'] == 1){ ?>subscriber<?php }else{ ?>subscribers<?php } ?></span> |
|
286 | + <span class="stat-name"><?php if ($_user['subscribers'] == 1) { ?>subscriber<?php } else { ?>subscribers<?php } ?></span> |
|
287 | 287 | </div> |
288 | 288 | <div class="stat-entry"> |
289 | 289 | <span class="stat-value"><?php echo $_user['views']; ?></span> |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | </div> |
329 | 329 | </div> |
330 | 330 | </div> |
331 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
331 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
332 | 332 | <div id="branded-page-body"> |
333 | 333 | <?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_" . $_user['layout'] . ".php"); ?> |
334 | 334 | </div> |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | "db_connected" => false, |
24 | 24 | ], |
25 | 25 | |
26 | - "video_properties" => (object) [ "status" => "unloaded" ], |
|
27 | - "user_properties" => (object) [ "status" => "unloaded" ], |
|
28 | - "group_properties" => (object) [ "status" => "unloaded" ], |
|
29 | - "forum_properties" => (object) [ "status" => "unloaded" ], |
|
26 | + "video_properties" => (object) ["status" => "unloaded"], |
|
27 | + "user_properties" => (object) ["status" => "unloaded"], |
|
28 | + "group_properties" => (object) ["status" => "unloaded"], |
|
29 | + "forum_properties" => (object) ["status" => "unloaded"], |
|
30 | 30 | ]; |
31 | 31 | |
32 | 32 | try |
33 | 33 | { |
34 | - $__db = new PDO("mysql:host=".$__server->db_properties->db_host.";dbname=".$__server->db_properties->db_database.";charset=utf8mb4", |
|
34 | + $__db = new PDO("mysql:host=" . $__server->db_properties->db_host . ";dbname=" . $__server->db_properties->db_database . ";charset=utf8mb4", |
|
35 | 35 | $__server->db_properties->db_user, |
36 | 36 | $__server->db_properties->db_password, |
37 | 37 | [ |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | ); |
42 | 42 | $__server->db_properties->db_connected = true; |
43 | 43 | } |
44 | - catch(PDOException $e) |
|
44 | + catch (PDOException $e) |
|
45 | 45 | { |
46 | - die("An error occured connecting to the database: ".$e->getMessage()); |
|
46 | + die("An error occured connecting to the database: " . $e->getMessage()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | session_start(); |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
54 | 54 | $stmt->execute(); |
55 | 55 | |
56 | - while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
56 | + while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
57 | 57 | $ban_info = $ban; |
58 | - if($_SERVER['REQUEST_URI'] != "/ban") |
|
58 | + if ($_SERVER['REQUEST_URI'] != "/ban") |
|
59 | 59 | header("Location: /ban"); |
60 | 60 | } |
61 | 61 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | $stmt->bindParam(":username", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
65 | 65 | $stmt->execute(); |
66 | 66 | |
67 | - while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
67 | + while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
68 | 68 | $ban_info = $ban; |
69 | - if($_SERVER['REQUEST_URI'] != "/ip_ban") |
|
69 | + if ($_SERVER['REQUEST_URI'] != "/ip_ban") |
|
70 | 70 | header("Location: /ip_ban"); |
71 | 71 | } |
72 | 72 | |
73 | 73 | /* NOT RUNNING UNDER CF CHECK */ |
74 | - if(!isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { |
|
74 | + if (!isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { |
|
75 | 75 | $_SERVER["HTTP_CF_CONNECTING_IP"] = $_SERVER['REMOTE_ADDR']; |
76 | 76 | } |
77 | 77 | ?> |
78 | 78 | \ No newline at end of file |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | ] |
41 | 41 | ); |
42 | 42 | $__server->db_properties->db_connected = true; |
43 | - } |
|
44 | - catch(PDOException $e) |
|
43 | + } catch(PDOException $e) |
|
45 | 44 | { |
46 | 45 | die("An error occured connecting to the database: ".$e->getMessage()); |
47 | 46 | } |
@@ -55,8 +54,9 @@ discard block |
||
55 | 54 | |
56 | 55 | while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
57 | 56 | $ban_info = $ban; |
58 | - if($_SERVER['REQUEST_URI'] != "/ban") |
|
59 | - header("Location: /ban"); |
|
57 | + if($_SERVER['REQUEST_URI'] != "/ban") { |
|
58 | + header("Location: /ban"); |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /* IP BANS */ |
@@ -66,8 +66,9 @@ discard block |
||
66 | 66 | |
67 | 67 | while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
68 | 68 | $ban_info = $ban; |
69 | - if($_SERVER['REQUEST_URI'] != "/ip_ban") |
|
70 | - header("Location: /ip_ban"); |
|
69 | + if($_SERVER['REQUEST_URI'] != "/ip_ban") { |
|
70 | + header("Location: /ip_ban"); |
|
71 | + } |
|
71 | 72 | } |
72 | 73 | |
73 | 74 | /* NOT RUNNING UNDER CF CHECK */ |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | class user_helper { |
12 | 12 | public $__db; |
13 | 13 | |
14 | - public function __construct($conn){ |
|
14 | + public function __construct($conn) { |
|
15 | 15 | $this->__db = $conn; |
16 | 16 | } |
17 | 17 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $stmt = $this->__db->prepare("SELECT pfp FROM users WHERE username = :username"); |
20 | 20 | $stmt->bindParam(":username", $username); |
21 | 21 | $stmt->execute(); |
22 | - while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
22 | + while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
23 | 23 | $pfp = $row['pfp']; |
24 | 24 | } // why the while statement? just remove it (i cant be bothered to) |
25 | 25 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | function if_admin($user) { |
48 | 48 | $stmt = $this->__db->prepare("SELECT status FROM users WHERE username = :user AND status = 'admin'"); |
49 | - $stmt->bindParam(":user", $user);; |
|
49 | + $stmt->bindParam(":user", $user); ; |
|
50 | 50 | $stmt->execute(); |
51 | 51 | |
52 | 52 | return $stmt->rowCount() === 1; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | function if_partner($user) { |
56 | 56 | $stmt = $this->__db->prepare("SELECT partner FROM users WHERE username = :user AND partner = 'y'"); |
57 | - $stmt->bindParam(":user", $user);; |
|
57 | + $stmt->bindParam(":user", $user); ; |
|
58 | 58 | $stmt->execute(); |
59 | 59 | |
60 | 60 | return $stmt->rowCount() === 1; |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | - if(isset($_SESSION['siteusername'])) { |
|
2 | + if (isset($_SESSION['siteusername'])) { |
|
3 | 3 | $stmt = $__db->prepare("UPDATE users SET ip = :ip WHERE username = :username"); |
4 | 4 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
5 | - $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
|
5 | + $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
|
6 | 6 | $stmt->execute(); |
7 | 7 | } |
8 | 8 | ?> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | <a id="logo-container" href="/" title="SubRocks home"> |
12 | 12 | <img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="SubRocks home"> |
13 | 13 | </a> |
14 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
14 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
15 | 15 | <div id="yt-masthead-signin"> |
16 | 16 | <div id="masthead-user-display"><span id="masthead-user-wrapper"><button href="/sign_in" type="button" id="masthead-user-button" onclick=";window.location.href=this.getAttribute('href');return false;" class=" yt-uix-button yt-uix-button-text" role="button"><span class="yt-uix-button-content"> <span id="masthead-user-image"> |
17 | 17 | <span class="clip"> |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | <span id="yt-masthead-user-displayname" dir="ltr" class="yt-valign-container" onclick="yt.www.masthead.toggleExpandedMasthead();"> |
30 | 30 | <?php echo htmlspecialchars($_SESSION['siteusername']); ?> |
31 | 31 | </span> |
32 | - <?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?> |
|
32 | + <?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?> |
|
33 | 33 | <a style="border-radius:2px;font-weight:bold;border:1px solid #CE4D34;position:relative;top:1px;color: white;text-decoration: none;background-color: #E26148;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/"> |
34 | 34 | <?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?> |
35 | 35 | </a> |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | </div> |
57 | 57 | |
58 | -<?php if(isset($_SESSION['siteusername'])) { ?> |
|
58 | +<?php if (isset($_SESSION['siteusername'])) { ?> |
|
59 | 59 | <div id="masthead-expanded" class="hid" style="display: none;"> |
60 | 60 | <div id="masthead-expanded-container" class="with-sandbar"> |
61 | 61 | <div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="4" |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
77 | 77 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
78 | 78 | $stmt->execute(); |
79 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
79 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
80 | 80 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
81 | 81 | $video['duration'] = $__time_h->timestamp($video['duration']); |
82 | 82 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | </div> |
220 | 220 | <?php } ?> |
221 | 221 | <div id="alerts"> |
222 | - <?php if(isset($error['status'])) { ?> |
|
222 | + <?php if (isset($error['status'])) { ?> |
|
223 | 223 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error yt-alert-player"> <div class="yt-alert-icon"> |
224 | 224 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
225 | 225 | </div> |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | </div> |
230 | 230 | </div></div></div> |
231 | 231 | <?php } ?> |
232 | - <?php if(isset($_GET['error'])) { ?> |
|
232 | + <?php if (isset($_GET['error'])) { ?> |
|
233 | 233 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error "> <div class="yt-alert-icon"> |
234 | 234 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
235 | 235 | </div> |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | </div> |
240 | 240 | </div></div></div> |
241 | 241 | <?php } ?> |
242 | - <?php if(isset($_GET['success'])) { ?> |
|
242 | + <?php if (isset($_GET['success'])) { ?> |
|
243 | 243 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-success "> <div class="yt-alert-icon"> |
244 | 244 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
245 | 245 | </div> |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | </div> |
250 | 250 | </div></div></div> |
251 | 251 | <?php } ?> |
252 | - <?php if(isset($_SESSION['error'])) { ?> |
|
252 | + <?php if (isset($_SESSION['error'])) { ?> |
|
253 | 253 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error"> <div class="yt-alert-icon"> |
254 | 254 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
255 | 255 | </div> |