Test Failed
Push — main ( d41f84...e8e3a0 )
by chief
03:50 queued 13s
created
web/public/inbox/markasread.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15 15
     $request = (object) [
16 16
         "username" => $_SESSION['siteusername'],
17 17
 
Please login to merge, or discard this patch.
web/public/inbox/delete_message.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15 15
 
16 16
     $request = (object) [
17 17
         "id" => $_GET['id'],
Please login to merge, or discard this patch.
web/public/channel_discussion.php 3 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@  discard block
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(isset($_SESSION['siteusername']))
16
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
15
+    if(isset($_SESSION['siteusername']))
16
+        $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
17 17
 
18 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']);
22 22
 
23
-	$stmt = $__db->prepare("SELECT * FROM bans WHERE username = :username ORDER BY id DESC");
24
-	$stmt->bindParam(":username", $_user['username']);
25
-	$stmt->execute();
23
+    $stmt = $__db->prepare("SELECT * FROM bans WHERE username = :username ORDER BY id DESC");
24
+    $stmt->bindParam(":username", $_user['username']);
25
+    $stmt->execute();
26 26
 
27
-	while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28
-		header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines.");
29
-	}
27
+    while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28
+        header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines.");
29
+    }
30 30
 
31 31
     function clean($string) {
32 32
         $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
@@ -34,21 +34,21 @@  discard block
 block discarded – undo
34 34
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
35 35
     }
36 36
 
37
-	function addhttp($url) {
38
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
39
-			$url = "http://" . $url;
40
-		}
41
-		return $url;
42
-	}
37
+    function addhttp($url) {
38
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
39
+            $url = "http://" . $url;
40
+        }
41
+        return $url;
42
+    }
43 43
 
44 44
     function check_valid_colorhex($colorCode) {
45 45
         // If user accidentally passed along the # sign, strip it off
46 46
         $colorCode = ltrim($colorCode, '#');
47 47
     
48 48
         if (
49
-              ctype_xdigit($colorCode) &&
49
+                ctype_xdigit($colorCode) &&
50 50
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
51
-                   return true;
51
+                    return true;
52 52
     
53 53
         else return false;
54 54
     }
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
84 84
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
85 85
 
86
-	if(isset($_SESSION['siteusername']))
87
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
86
+    if(isset($_SESSION['siteusername']))
87
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
88 88
 
89 89
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
90 90
         $error = array();
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
99 99
 
100 100
         if(!isset($error['message'])) {
101
-			$text = $_POST['comment'];
101
+            $text = $_POST['comment'];
102 102
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
103
-			$stmt->bindParam(":id", $_user['username']);
104
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
105
-			$stmt->bindParam(":comment", $text);
103
+            $stmt->bindParam(":id", $_user['username']);
104
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
105
+            $stmt->bindParam(":comment", $text);
106 106
             $stmt->execute();
107 107
 
108 108
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
     }
115 115
 ?>
116 116
 <?php
117
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
118
-	$__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
119
-	$__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
120
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
117
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
118
+    $__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
119
+    $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
120
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
121 121
 ?>
122 122
 <!DOCTYPE html>
123 123
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -145,27 +145,27 @@  discard block
 block discarded – undo
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']) {
149
-						case "stretch":
150
-						echo "background-size: cover;";
151
-						break;
152
-						case "solid":
153
-						echo "";
154
-						break;
155
-						case "norepeat":
156
-						echo "background-repeat: no-repeat !important;";
157
-						break;
158
-						case "repeatxy":
159
-						echo "background-repeat: repeat;";
160
-						break;
161
-						case "repeaty":
162
-						echo "background-repeat: repeat-y;";
163
-						break;
164
-						case "repeatx":
165
-						echo "background-repeat: repeat-x;";
166
-						break;
167
-					}
168
-				?>
148
+                    switch($_user['2012_bgoption']) {
149
+                        case "stretch":
150
+                        echo "background-size: cover;";
151
+                        break;
152
+                        case "solid":
153
+                        echo "";
154
+                        break;
155
+                        case "norepeat":
156
+                        echo "background-repeat: no-repeat !important;";
157
+                        break;
158
+                        case "repeatxy":
159
+                        echo "background-repeat: repeat;";
160
+                        break;
161
+                        case "repeaty":
162
+                        echo "background-repeat: repeat-y;";
163
+                        break;
164
+                        case "repeatx":
165
+                        echo "background-repeat: repeat-x;";
166
+                        break;
167
+                    }
168
+                ?>
169 169
 			}
170 170
    		</style>
171 171
 	</head>
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
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'])))
186
-						$_user['bio'] = "This user has no description.";
187
-				?>
185
+                    if(empty(trim($_user['bio'])))
186
+                        $_user['bio'] = "This user has no description.";
187
+                ?>
188 188
 				<div id="content">
189 189
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
190 190
 						<div class="content" id="recommended-channels-list"></div>
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 									</div>
320 320
 								</div>
321 321
 							</div>
322
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
322
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
323 323
 							<div id="branded-page-body">
324 324
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_discussion.php"); ?></div>
325 325
 							</div>
Please login to merge, or discard this patch.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,11 +13,13 @@  discard block
 block discarded – undo
13 13
 <?php $__db_h = new db_helper(); ?>
14 14
 <?php $__time_h = new time_helper(); ?>
15 15
 <?php
16
-	if(isset($_SESSION['siteusername']))
17
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
16
+	if(isset($_SESSION['siteusername'])) {
17
+		    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
18
+	}
18 19
 
19
-    if(!$__user_h->user_exists($_GET['n']))
20
-        header("Location: /?userdoesntexist");
20
+    if(!$__user_h->user_exists($_GET['n'])) {
21
+            header("Location: /?userdoesntexist");
22
+    }
21 23
 
22 24
     $_user = $__user_h->fetch_user_username($_GET['n']);
23 25
 
@@ -40,10 +42,11 @@  discard block
 block discarded – undo
40 42
     
41 43
         if (
42 44
               ctype_xdigit($colorCode) &&
43
-              (strlen($colorCode) == 6 || strlen($colorCode) == 3))
44
-                   return true;
45
-    
46
-        else return false;
45
+              (strlen($colorCode) == 6 || strlen($colorCode) == 3)) {
46
+                           return true;
47
+        } else {
48
+            return false;
49
+        }
47 50
     }
48 51
 
49 52
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
@@ -76,8 +79,9 @@  discard block
 block discarded – undo
76 79
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
77 80
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
78 81
 
79
-	if(isset($_SESSION['siteusername']))
80
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
82
+	if(isset($_SESSION['siteusername'])) {
83
+	    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
84
+	}
81 85
 
82 86
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
83 87
         $error = array();
@@ -146,8 +150,9 @@  discard block
 block discarded – undo
146 150
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
147 151
 				<?php } ?> 
148 152
 				<?php
149
-					if(empty(trim($_user['bio'])))
150
-						$_user['bio'] = "This user has no description.";
153
+					if(empty(trim($_user['bio']))) {
154
+											$_user['bio'] = "This user has no description.";
155
+					}
151 156
 				?>
152 157
 				<div id="content">
153 158
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
Please login to merge, or discard this patch.
web/public/s/mod/channel_discussion.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 												<div class="module-view other-channels-view">
216 216
 													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
217 217
 													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
218
-														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
-													} ?>
218
+                                                        echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
+                                                    } ?>
220 220
 													<ul class="channel-summary-list ">
221 221
 														<?php 
222
-															foreach($_user['featured_channels'] as $user) {
223
-																if($__user_h->user_exists($user)) {
224
-														?>
222
+                                                            foreach($_user['featured_channels'] as $user) {
223
+                                                                if($__user_h->user_exists($user)) {
224
+                                                        ?>
225 225
 															<li class="yt-tile-visible yt-uix-tile">
226 226
 																<div class="channel-summary clearfix channel-summary-compact">
227 227
 																	<div class="channel-summary-thumb">
@@ -245,19 +245,19 @@  discard block
 block discarded – undo
245 245
 											</div>
246 246
 
247 247
 											<?php 
248
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
-												$stmt->bindParam(":search", $_user['username']);
250
-												$stmt->execute();
248
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
+                                                $stmt->bindParam(":search", $_user['username']);
250
+                                                $stmt->execute();
251 251
 
252
-												if($stmt->rowCount() != 0) {
253
-											?>
252
+                                                if($stmt->rowCount() != 0) {
253
+                                            ?>
254 254
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
255 255
 													<div class="module-view gh-featured">
256 256
 														<h2>Featured Playlists</h2>     
257 257
 														<?php
258
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
-															$playlist['videos'] = json_decode($playlist['videos']);
260
-														?> 
258
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
260
+                                                        ?> 
261 261
 															<div class="playlist yt-tile-visible yt-uix-tile">
262 262
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
263 263
 																<span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering">
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
                                                     <div class="activity-feed">
26 26
                                                         <div class="feed-list-container">
27 27
                                                             <div class="feed-item-list">
28
-                                                            <?php if(isset($_SESSION['siteusername'])) { ?>
28
+                                                            <?php if (isset($_SESSION['siteusername'])) { ?>
29 29
                                                             <form method="post" action="/d/comment_profile?u=<?php echo htmlspecialchars($_user['username']); ?>">
30 30
                                                                 <img style="width: 50px;" src="">
31 31
                                                                 <textarea style="resize:none;padding:5px;border-radius:5px;background-color:white;border: 1px solid #d3d3d3; width: 577px; resize: none;"cols="32" id="com" placeholder="Share your thoughts" name="comment"></textarea><br>
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
                                                                 $stmt->execute();
42 42
 
43 43
                                                                 $number_of_result = $stmt->rowCount();
44
-                                                                $number_of_page = ceil ($number_of_result / $results_per_page);  
44
+                                                                $number_of_page = ceil($number_of_result/$results_per_page);  
45 45
 
46
-                                                                if (!isset ($_GET['page']) ) {  
46
+                                                                if (!isset ($_GET['page'])) {  
47 47
                                                                     $page = 1;  
48 48
                                                                 } else {  
49
-                                                                    $page = (int)$_GET['page'];  
49
+                                                                    $page = (int) $_GET['page'];  
50 50
                                                                 }  
51 51
 
52
-                                                                $page_first_result = ($page - 1) * $results_per_page;  
52
+                                                                $page_first_result = ($page - 1)*$results_per_page;  
53 53
 
54 54
                                                                 $stmt = $__db->prepare("SELECT * FROM profile_comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
55 55
                                                                 $stmt->bindParam(":rid", $_user['username']);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                                                                 $stmt->bindParam(":pper", $results_per_page);
58 58
                                                                 $stmt->execute();
59 59
 
60
-                                                                while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
60
+                                                                while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
61 61
 
62 62
                                                             ?>
63 63
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                                                                                     <span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span>
77 77
                                                                                     </span>
78 78
                                                                                     </span></span>
79
-                                                                                    <?php if($comment['likes'] != 0) { ?>
79
+                                                                                    <?php if ($comment['likes'] != 0) { ?>
80 80
                                                                                     <span dir="ltr" class="comments-rating-positive" title="9 up, 1 down">
81 81
                                                                                         <?php echo $comment['likes']; ?>
82 82
                                                                                         <img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif">
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                                                                                     </button>
105 105
                                                                                 </span>
106 106
                                                                             </div>
107
-                                                                        <?php if(isset($_SESSION['siteusername'])) { ?> 
107
+                                                                        <?php if (isset($_SESSION['siteusername'])) { ?> 
108 108
                                                                             <li id="reply_to_<?php echo $comment['id']; ?>" style="display: none;" class="comment yt-tile-default  child" data-tag="O" data-author-viewing="" data-id="iRV7EkT9us81mDLFDSB6FAsB156Fdn13HUmTm26C3PE" data-score="34" data-author="<?php echo htmlspecialchars($row['author']); ?>">
109 109
 
110 110
                                                                             <div class="comment-body">
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 														</div>
180 180
 														<hr class="yt-horizontal-rule ">
181 181
 													</div>
182
-													<?php if(!empty($_user['website'])) { ?>
182
+													<?php if (!empty($_user['website'])) { ?>
183 183
 														<div class="user-profile-item">
184 184
 															<div class="yt-c3-profile-custom-url field-container ">
185 185
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 															<h5>Country</h5>
229 229
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
230 230
 														</div>
231
-														<?php if($_user['genre'] != "none") { ?>
231
+														<?php if ($_user['genre'] != "none") { ?>
232 232
 															<div class="user-profile-item ">
233 233
 																<h5>Channel Genre</h5>
234 234
 																<span class="value"><?php echo htmlspecialchars(ucfirst($_user['genre'])); ?></span>
@@ -240,16 +240,16 @@  discard block
 block discarded – undo
240 240
 											</div>
241 241
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
242 242
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
243
-												<?php if(count($_user['featured_channels']) != 0) { ?>
243
+												<?php if (count($_user['featured_channels']) != 0) { ?>
244 244
 												<div class="module-view other-channels-view">
245
-													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
246
-													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
245
+													<h2 <?php if (@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
246
+													<?php if (@$_SESSION['siteusername'] == $_user['username']) { 
247 247
 														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
248 248
 													} ?>
249 249
 													<ul class="channel-summary-list ">
250 250
 														<?php 
251
-															foreach($_user['featured_channels'] as $user) {
252
-																if($__user_h->user_exists($user)) {
251
+															foreach ($_user['featured_channels'] as $user) {
252
+																if ($__user_h->user_exists($user)) {
253 253
 														?>
254 254
 															<li class="yt-tile-visible yt-uix-tile">
255 255
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -278,13 +278,13 @@  discard block
 block discarded – undo
278 278
 												$stmt->bindParam(":search", $_user['username']);
279 279
 												$stmt->execute();
280 280
 
281
-												if($stmt->rowCount() != 0) {
281
+												if ($stmt->rowCount() != 0) {
282 282
 											?>
283 283
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
284 284
 													<div class="module-view gh-featured">
285 285
 														<h2>Featured Playlists</h2>     
286 286
 														<?php
287
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
287
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
288 288
 															$playlist['videos'] = json_decode($playlist['videos']);
289 289
 														?> 
290 290
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.
web/public/d/comment_profile.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
     ]
26 26
 ]; 
27 27
 
28
-if($_SERVER['REQUEST_METHOD'] == 'POST') {
29
-    if(!isset($request->username)){ $request->error->message = "you are not logged in"; $request->error->status = ""; }
30
-    if(!$request->touser){ $request->error->message = "your comment cannot be blank"; $request->error->status = ""; }
31
-    if(strlen($request->touser) > 1000){ $request->error->message = "your comment must be shorter than 1000 characters"; $request->error->status = ""; }
32
-    if($__user_h->if_cooldown($request->username)) { $request->error->message = "You are on a cooldown! Wait for a minute before posting another comment."; $request->error->status = ""; }
28
+if ($_SERVER['REQUEST_METHOD'] == 'POST') {
29
+    if (!isset($request->username)) { $request->error->message = "you are not logged in"; $request->error->status = ""; }
30
+    if (!$request->touser) { $request->error->message = "your comment cannot be blank"; $request->error->status = ""; }
31
+    if (strlen($request->touser) > 1000) { $request->error->message = "your comment must be shorter than 1000 characters"; $request->error->status = ""; }
32
+    if ($__user_h->if_cooldown($request->username)) { $request->error->message = "You are on a cooldown! Wait for a minute before posting another comment."; $request->error->status = ""; }
33 33
 
34
-    if($request->error->status == "OK") {
34
+    if ($request->error->status == "OK") {
35 35
         $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:username, :from, :comment)");
36 36
         $stmt->bindParam(":username", $request->touser);
37 37
         $stmt->bindParam(":from", $request->username);
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $stmt->execute();
40 40
 
41 41
         $__user_u->update_cooldown_time($request->username, "cooldown_comment");
42
-        if(@$request->username != $_user['author'])
42
+        if (@$request->username != $_user['author'])
43 43
             $__user_i->send_message($request->username, "New profile comment", $_user['username'], "I commented \"" . $request->touser . "\" on your profile!", "", "nt");
44 44
         
45 45
         header("Location: /user/" . $request->touser . "/discussion");
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@
 block discarded – undo
39 39
         $stmt->execute();
40 40
 
41 41
         $__user_u->update_cooldown_time($request->username, "cooldown_comment");
42
-        if(@$request->username != $_user['author'])
43
-            $__user_i->send_message($request->username, "New profile comment", $_user['username'], "I commented \"" . $request->touser . "\" on your profile!", "", "nt");
42
+        if(@$request->username != $_user['author']) {
43
+                    $__user_i->send_message($request->username, "New profile comment", $_user['username'], "I commented \"" . $request->touser . "\" on your profile!", "", "nt");
44
+        }
44 45
         
45 46
         header("Location: /user/" . $request->touser . "/discussion");
46 47
     } else {
Please login to merge, or discard this patch.
web/public/watch.php 3 patches
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -15,28 +15,28 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
-		header("Location: /");
18
+    if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
+        header("Location: /");
20 20
 
21
-	$__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
21
+    $__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
22 22
 
23
-	$_SESSION['current_video'] = $_video['rid'];
23
+    $_SESSION['current_video'] = $_video['rid'];
24 24
 
25
-	/* 
25
+    /* 
26 26
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
27 27
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
28 28
 	Work on this tomorrow or some shit idk lol
29 29
 	*/
30 30
 
31
-	/* 
31
+    /* 
32 32
 	USE THE GOD DAMN __CONFIG MORE -- idiot
33 33
 	Work on this tomorrow or some shit
34 34
 	*/
35 35
 
36
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
37
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
38
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
39
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
36
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
37
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
38
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
39
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
40 40
 ?>
41 41
 <!DOCTYPE html>
42 42
 <html>
@@ -66,29 +66,29 @@  discard block
 block discarded – undo
66 66
          if (window.yt.timing) {yt.timing.tick("ct");}    
67 67
       </script>
68 68
 		<?php
69
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
70
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
69
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
70
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
71 71
 
72
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
73
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
72
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
73
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
74 74
 
75
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
76
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
75
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
76
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
77 77
 
78
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79
-				$_video['likeswidth'] = 0;
80
-				$_video['dislikeswidth'] = 0;
81
-			} else {
82
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
83
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
84
-			}
78
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79
+                $_video['likeswidth'] = 0;
80
+                $_video['dislikeswidth'] = 0;
81
+            } else {
82
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
83
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
84
+            }
85 85
 
86
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
87
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
88
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
89
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
90
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
91
-		?>
86
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
87
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
88
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
89
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
90
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
91
+        ?>
92 92
 	</head>
93 93
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
94 94
 		<form name="logoutForm" method="POST" action="/logout">
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
 
157 157
 									<?php $_user = $__user_h->fetch_user_username($_video['author']); ?>
158 158
 									<?php
159
-										$stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip");
160
-										$stmt->bindParam(":ip", $_user['ip']);
161
-										$stmt->execute();
162
-										$alts = $stmt->rowCount();
159
+                                        $stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip");
160
+                                        $stmt->bindParam(":ip", $_user['ip']);
161
+                                        $stmt->execute();
162
+                                        $alts = $stmt->rowCount();
163 163
 
164
-										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
164
+                                        if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
165 165
 
166
-										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168
-												echo "
166
+                                        while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
+                                            if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168
+                                                echo "
169 169
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
170
-													htmlspecialchars($username['username']) 
171
-												. "</a><br>";
172
-										}
173
-									?>
170
+                                                    htmlspecialchars($username['username']) 
171
+                                                . "</a><br>";
172
+                                        }
173
+                                    ?>
174 174
 									<hr>
175 175
 								<?php } ?>
176 176
 								<h1 id="watch-headline-title">
@@ -384,21 +384,21 @@  discard block
 block discarded – undo
384 384
 													<hr><br>
385 385
 													<h3>Add to a Playlist</h3>
386 386
 													<?php
387
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
388
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
389
-														$stmt->execute();
390
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
-															$buffer = json_decode($playlist['videos']);
392
-															@$rid = $buffer[0];
393
-															if(!empty($rid)) {
394
-																@$video = $__video_h->fetch_video_rid($rid);
395
-															} else {
396
-																$video['thumbnail'] = "";
397
-																$video['duration'] = 0;
398
-															}
387
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
388
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
389
+                                                        $stmt->execute();
390
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
+                                                            $buffer = json_decode($playlist['videos']);
392
+                                                            @$rid = $buffer[0];
393
+                                                            if(!empty($rid)) {
394
+                                                                @$video = $__video_h->fetch_video_rid($rid);
395
+                                                            } else {
396
+                                                                $video['thumbnail'] = "";
397
+                                                                $video['duration'] = 0;
398
+                                                            }
399 399
 
400
-															$videos = count($buffer);
401
-													?>
400
+                                                            $videos = count($buffer);
401
+                                                    ?>
402 402
 														<a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a><br>
403 403
 													<?php } ?>
404 404
 												<?php } ?>
@@ -663,10 +663,10 @@  discard block
 block discarded – undo
663 663
 												</div>
664 664
 											</div>
665 665
 											<?php 
666
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
667
-												$stmt->bindParam(":v", $_GET['v']);
668
-												$stmt->execute();
669
-											?>
666
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
667
+                                                $stmt->bindParam(":v", $_GET['v']);
668
+                                                $stmt->execute();
669
+                                            ?>
670 670
 
671 671
 											<?php if($stmt->rowCount() != 0) { ?>
672 672
 												<div class="comments-section">
@@ -676,16 +676,16 @@  discard block
 block discarded – undo
676 676
 													<h4>Video Responses</h4>
677 677
 													<ul class="video-list">
678 678
 													<?php 
679
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
-															if($__video_h->video_exists($video['video'])) { 
681
-																$video = $__video_h->fetch_video_rid($video['video']);
682
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
683
-																$video['duration'] = $__time_h->timestamp($video['duration']);
684
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
685
-																$video['author'] = htmlspecialchars($video['author']);		
686
-																$video['title'] = htmlspecialchars($video['title']);
687
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
688
-													?>
679
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
+                                                            if($__video_h->video_exists($video['video'])) { 
681
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
682
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
683
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
684
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
685
+                                                                $video['author'] = htmlspecialchars($video['author']);		
686
+                                                                $video['title'] = htmlspecialchars($video['title']);
687
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
688
+                                                    ?>
689 689
 														<li class="video-list-item yt-tile-default">
690 690
 															<a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="<?php echo htmlspecialchars($_video['author']); ?>&amp;feature=watch_response"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
691 691
 															<button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="cjls0QsHOBE" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
@@ -766,38 +766,38 @@  discard block
 block discarded – undo
766 766
 												</div>
767 767
 												<ul class="comment-list" id="live_comments">
768 768
 														<?php
769
-														$results_per_page = 20;
769
+                                                        $results_per_page = 20;
770 770
 
771
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
772
-														$stmt->bindParam(":rid", $_video['rid']);
773
-														$stmt->execute();
771
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
772
+                                                        $stmt->bindParam(":rid", $_video['rid']);
773
+                                                        $stmt->execute();
774 774
 
775
-														$number_of_result = $stmt->rowCount();
776
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
775
+                                                        $number_of_result = $stmt->rowCount();
776
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
777 777
 
778
-														if (!isset ($_GET['page']) ) {  
779
-															$page = 1;  
780
-														} else {  
781
-															$page = (int)$_GET['page'];  
782
-														}  
778
+                                                        if (!isset ($_GET['page']) ) {  
779
+                                                            $page = 1;  
780
+                                                        } else {  
781
+                                                            $page = (int)$_GET['page'];  
782
+                                                        }  
783 783
 
784
-														$page_first_result = ($page - 1) * $results_per_page;  
784
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
785 785
 
786
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
787
-														$stmt->bindParam(":rid", $_video['rid']);
788
-														$stmt->bindParam(":pfirst", $page_first_result);
789
-														$stmt->bindParam(":pper", $results_per_page);
790
-														$stmt->execute();
786
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
787
+                                                        $stmt->bindParam(":rid", $_video['rid']);
788
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
789
+                                                        $stmt->bindParam(":pper", $results_per_page);
790
+                                                        $stmt->execute();
791 791
 
792
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794
-																$comment['liked'] = true;
795
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796
-																$comment['disliked'] = true;
792
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794
+                                                                $comment['liked'] = true;
795
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796
+                                                                $comment['disliked'] = true;
797 797
 																
798
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
799
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
800
-													?>
798
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
799
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
800
+                                                    ?>
801 801
 
802 802
 														<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
803 803
 															<div class="comment-body">
@@ -863,12 +863,12 @@  discard block
 block discarded – undo
863 863
 															</div>
864 864
 														</li>
865 865
 														<?php 
866
-															$stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
867
-															$stmt2->bindParam(":rid", $comment['id']);
868
-															$stmt2->execute();
866
+                                                            $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
867
+                                                            $stmt2->bindParam(":rid", $comment['id']);
868
+                                                            $stmt2->execute();
869 869
 
870
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
871
-														?>
870
+                                                            while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
871
+                                                        ?>
872 872
 															<li class="comment yt-tile-default " style="margin-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0">
873 873
 																<div class="comment-body">
874 874
 																	<div class="content-container">
@@ -948,19 +948,19 @@  discard block
 block discarded – undo
948 948
 										<div id="watch-related-container" class="watch-sidebar-body">
949 949
 											<ul id="watch-related" class="video-list">
950 950
 												<?php
951
-													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
952
-													$stmt->execute();
953
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
954
-														$_playlist['videos'] = json_decode($_playlist['videos']);
955
-														$_playlist['count'] = 1;
951
+                                                    $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
952
+                                                    $stmt->execute();
953
+                                                    while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
954
+                                                        $_playlist['videos'] = json_decode($_playlist['videos']);
955
+                                                        $_playlist['count'] = 1;
956 956
 
957
-														if($__video_h->video_exists($_playlist['videos'][0])) {
958
-															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
959
-														} else {
960
-															$video = [];
961
-															$video['thumbnail'] = "default.jpg";
962
-														}
963
-												?>
957
+                                                        if($__video_h->video_exists($_playlist['videos'][0])) {
958
+                                                            $video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
959
+                                                        } else {
960
+                                                            $video = [];
961
+                                                            $video['thumbnail'] = "default.jpg";
962
+                                                        }
963
+                                                ?>
964 964
 												<li class="video-list-item">
965 965
 													<a href="/view_playlist?v=<?php echo $_playlist['rid']; ?>" class="related-playlist yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="ved=CAMQzhooAA%3D%3D&amp;ei=CKf4md_r7rMCFYMfRAodLGlRiA%3D%3D&amp;feature=list_other">
966 966
 														<span class="ux-thumb-wrap">
@@ -1007,16 +1007,16 @@  discard block
 block discarded – undo
1007 1007
 												<?php } ?>
1008 1008
 												<div id="ppv-container" class="hid"></div>
1009 1009
 												<?php
1010
-													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1011
-													$stmt->execute();
1012
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1013
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1014
-														$video['duration'] = $__time_h->timestamp($video['duration']);
1015
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
1016
-														$video['author'] = htmlspecialchars($video['author']);		
1017
-														$video['title'] = htmlspecialchars($video['title']);
1018
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
1019
-												?>
1010
+                                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1011
+                                                    $stmt->execute();
1012
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1013
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1014
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
1015
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
1016
+                                                        $video['author'] = htmlspecialchars($video['author']);		
1017
+                                                        $video['title'] = htmlspecialchars($video['title']);
1018
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
1019
+                                                ?>
1020 1020
 												<li class="video-list-item"><a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="ved=CAIQzRooAA%3D%3D&amp;<?php echo htmlspecialchars($_video['author']); ?>&amp;feature=relmfu"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" onerror=";this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
1021 1021
 													<button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="gyAaIKF6tSQ" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
1022 1022
 													</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 <?php $__user_u = new user_update($__db); ?>
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
18
+	if ($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19 19
 		header("Location: /");
20 20
 
21 21
 	$__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
@@ -66,20 +66,20 @@  discard block
 block discarded – undo
66 66
          if (window.yt.timing) {yt.timing.tick("ct");}    
67 67
       </script>
68 68
 		<?php
69
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
69
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
70 70
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
71 71
 
72
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
73
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
72
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
73
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
74 74
 
75 75
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
76 76
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
77 77
 
78
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
78
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79 79
 				$_video['likeswidth'] = 0;
80 80
 				$_video['dislikeswidth'] = 0;
81 81
 			} else {
82
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
82
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
83 83
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
84 84
 			}
85 85
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 									</div>
114 114
 									<div id="instream_google_companion_ad_div"></div>
115 115
 								</div>
116
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
116
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
117 117
 									<div id="watch-owner-container">
118 118
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
119 119
 											<ul class="yt-nav-aside">
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 										</div>
133 133
 									</div><br>
134 134
 								<?php } ?>
135
-								<?php if($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?>
135
+								<?php if ($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?>
136 136
 									<div id="watch-owner-container">
137 137
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
138 138
 											<ul class="yt-nav-aside">
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 										$stmt->execute();
162 162
 										$alts = $stmt->rowCount();
163 163
 
164
-										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
164
+										if ($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
165 165
 
166
-										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
166
+										while ($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
+											if ($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168 168
 												echo "
169 169
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
170 170
 													htmlspecialchars($username['username']) 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 											title="" 
190 190
 											id="subscribe-button"
191 191
 											type="button" 
192
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
192
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
193 193
 											role="button">
194 194
 											<span class="yt-uix-button-icon-wrapper">
195 195
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 						<div id="watch-main-container">
248 248
 							<div id="watch-main">
249 249
 								<div id="watch-panel">
250
-									<?php if($_video['featured'] == "v") { ?>
250
+									<?php if ($_video['featured'] == "v") { ?>
251 251
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn">  <div class="yt-alert-icon">
252 252
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
253 253
 										</div>
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 										</div></div></div>
259 259
 									<?php }  ?>
260 260
 
261
-	  								<?php if($_video['visibility'] == "u") { ?>
261
+	  								<?php if ($_video['visibility'] == "u") { ?>
262 262
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn">  <div class="yt-alert-icon">
263 263
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
264 264
 										</div>
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 												This video is unlisted. Only people who have the link can view this video.
268 268
 											</div>
269 269
 										</div></div></div>
270
-									<?php } else if($_video['visibility'] == "v") { ?>
270
+									<?php } else if ($_video['visibility'] == "v") { ?>
271 271
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
272 272
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
273 273
 										</div>
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 											<button onclick=";window.location.href=this.getAttribute('href');return false;" href="/get/like_video?v=<?php echo $_video['rid']; ?>"
302 302
 											title="I like this" 
303 303
 											type="button" 
304
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
304
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
305 305
 											id="watch-like"  
306 306
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
307 307
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 											type="button" 
316 316
 											style="margin-left: -2px;"
317 317
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
318
-											class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
318
+											class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
319 319
 											id="watch-unlike" 
320 320
 											role="button">
321 321
 												<span class="yt-uix-button-icon-wrapper">
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 												</div>
336 336
 											</div>
337 337
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
338
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
338
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
339 339
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
340 340
 													<div class="yt-alert-icon">
341 341
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 												<?php } else { ?>
352 352
 													<h3>Be friends with the creator</h3>
353 353
 
354
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
354
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
355 355
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
356 356
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
357 357
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 														</span><br><br>
366 366
 													<?php } ?>
367 367
 
368
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
369
-														<?php if($_video['friended'] == false) { ?>
368
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
369
+														<?php if ($_video['friended'] == false) { ?>
370 370
 															<a href="/friends">Send a friend request</a>
371 371
 														<?php } else { ?>
372 372
 															Your friend request is pending.
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 													<?php } ?>
377 377
 													<hr><br>
378 378
 													<h3>Add to Favorites</h3>
379
-													<?php if($_video['favorited'] == false) { ?>
379
+													<?php if ($_video['favorited'] == false) { ?>
380 380
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
381 381
 													<?php } else { ?>
382 382
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -387,10 +387,10 @@  discard block
 block discarded – undo
387 387
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
388 388
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
389 389
 														$stmt->execute();
390
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
390
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391 391
 															$buffer = json_decode($playlist['videos']);
392 392
 															@$rid = $buffer[0];
393
-															if(!empty($rid)) {
393
+															if (!empty($rid)) {
394 394
 																@$video = $__video_h->fetch_video_rid($rid);
395 395
 															} else {
396 396
 																$video['thumbnail'] = "";
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 												$stmt->execute();
669 669
 											?>
670 670
 
671
-											<?php if($stmt->rowCount() != 0) { ?>
671
+											<?php if ($stmt->rowCount() != 0) { ?>
672 672
 												<div class="comments-section">
673 673
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
674 674
 													see all
@@ -676,8 +676,8 @@  discard block
 block discarded – undo
676 676
 													<h4>Video Responses</h4>
677 677
 													<ul class="video-list">
678 678
 													<?php 
679
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
-															if($__video_h->video_exists($video['video'])) { 
679
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
+															if ($__video_h->video_exists($video['video'])) { 
681 681
 																$video = $__video_h->fetch_video_rid($video['video']);
682 682
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
683 683
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -708,18 +708,18 @@  discard block
 block discarded – undo
708 708
 														</h4>
709 709
 													</div>
710 710
 												</div>
711
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
711
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
712 712
 													<div class="comments-post-container clearfix">
713 713
 														<div class="comments-post-alert">
714 714
 															<a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span>
715 715
 														</div>
716 716
 													</div>
717
-												<?php } else if($_video['commenting'] == "d") { ?>
717
+												<?php } else if ($_video['commenting'] == "d") { ?>
718 718
 													<div class="comments-disabled-message">
719 719
 														<img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png">
720 720
 														<span>Adding comments has been disabled for this video.</span>
721 721
 													</div>
722
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
722
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
723 723
 													<div class="comments-post-container clearfix">
724 724
 														<div class="comments-post-alert">
725 725
 															This user has blocked you!
@@ -773,15 +773,15 @@  discard block
 block discarded – undo
773 773
 														$stmt->execute();
774 774
 
775 775
 														$number_of_result = $stmt->rowCount();
776
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
776
+														$number_of_page = ceil($number_of_result/$results_per_page);  
777 777
 
778
-														if (!isset ($_GET['page']) ) {  
778
+														if (!isset ($_GET['page'])) {  
779 779
 															$page = 1;  
780 780
 														} else {  
781
-															$page = (int)$_GET['page'];  
781
+															$page = (int) $_GET['page'];  
782 782
 														}  
783 783
 
784
-														$page_first_result = ($page - 1) * $results_per_page;  
784
+														$page_first_result = ($page - 1)*$results_per_page;  
785 785
 
786 786
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
787 787
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -789,10 +789,10 @@  discard block
 block discarded – undo
789 789
 														$stmt->bindParam(":pper", $results_per_page);
790 790
 														$stmt->execute();
791 791
 
792
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
792
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
+															if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794 794
 																$comment['liked'] = true;
795
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
795
+															else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796 796
 																$comment['disliked'] = true;
797 797
 																
798 798
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 																			<span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span>
815 815
 																			</span>
816 816
 																			</span></span>
817
-																			<?php if($comment['likes'] != 0) { ?>
817
+																			<?php if ($comment['likes'] != 0) { ?>
818 818
 																			<span dir="ltr" class="comments-rating-positive" title="9 up, 1 down">
819 819
 																				<?php echo $comment['likes']; ?>
820 820
 																				<img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif">
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 																			</button>
843 843
 																		</span>
844 844
 																	</div>
845
-																<?php if(isset($_SESSION['siteusername'])) { ?> 
845
+																<?php if (isset($_SESSION['siteusername'])) { ?> 
846 846
 																	<li id="reply_to_<?php echo $comment['id']; ?>" style="display: none;" class="comment yt-tile-default  child" data-tag="O" data-author-viewing="" data-id="iRV7EkT9us81mDLFDSB6FAsB156Fdn13HUmTm26C3PE" data-score="34" data-author="<?php echo htmlspecialchars($row['author']); ?>">
847 847
 
848 848
 																	<div class="comment-body">
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 															$stmt2->bindParam(":rid", $comment['id']);
868 868
 															$stmt2->execute();
869 869
 
870
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
870
+															while ($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
871 871
 														?>
872 872
 															<li class="comment yt-tile-default " style="margin-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0">
873 873
 																<div class="comment-body">
@@ -950,11 +950,11 @@  discard block
 block discarded – undo
950 950
 												<?php
951 951
 													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
952 952
 													$stmt->execute();
953
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
953
+													while ($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
954 954
 														$_playlist['videos'] = json_decode($_playlist['videos']);
955 955
 														$_playlist['count'] = 1;
956 956
 
957
-														if($__video_h->video_exists($_playlist['videos'][0])) {
957
+														if ($__video_h->video_exists($_playlist['videos'][0])) {
958 958
 															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
959 959
 														} else {
960 960
 															$video = [];
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
 												<?php
1010 1010
 													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1011 1011
 													$stmt->execute();
1012
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1012
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1013 1013
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1014 1014
 														$video['duration'] = $__time_h->timestamp($video['duration']);
1015 1015
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
-		header("Location: /");
18
+	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) {
19
+			header("Location: /");
20
+	}
20 21
 
21 22
 	$__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
22 23
 
@@ -164,11 +165,12 @@  discard block
 block discarded – undo
164 165
 										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
165 166
 
166 167
 										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168
-												echo "
168
+											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") {
169
+																							echo "
169 170
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
170 171
 													htmlspecialchars($username['username']) 
171 172
 												. "</a><br>";
173
+											}
172 174
 										}
173 175
 									?>
174 176
 									<hr>
@@ -790,10 +792,11 @@  discard block
 block discarded – undo
790 792
 														$stmt->execute();
791 793
 
792 794
 														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794
-																$comment['liked'] = true;
795
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796
-																$comment['disliked'] = true;
795
+															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) {
796
+																															$comment['liked'] = true;
797
+															} else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) {
798
+																															$comment['disliked'] = true;
799
+															}
797 800
 																
798 801
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
799 802
 															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
Please login to merge, or discard this patch.
web/public/d/channel_update.php 2 patches
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,86 +192,86 @@  discard block
 block discarded – undo
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(
266
-                $_POST['layout_channel'] == "feed"      || 
267
-                $_POST['layout_channel'] == "featured"  || 
264
+        if (!empty($_POST['layout_channel'])) {
265
+            if (
266
+                $_POST['layout_channel'] == "feed" || 
267
+                $_POST['layout_channel'] == "featured" || 
268 268
                 $_POST['layout_channel'] == "playlists" || 
269 269
                 $_POST['layout_channel'] == "everything"
270 270
             )
271 271
                 $__user_u->update_row($_SESSION['siteusername'], "layout", $_POST['layout_channel']);
272 272
         }
273 273
 
274
-    if(!empty($_POST['bgoptionset'])) {
274
+    if (!empty($_POST['bgoptionset'])) {
275 275
         $bgoption = $_POST['bgoption'];
276 276
         $bgcolor = $_POST['solidcolor'];
277 277
         $default = "default.png";
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         
281 281
         $__user_u->update_row($_SESSION['siteusername'], "2012_bgcolor", $bgcolor);
282 282
 
283
-        if($bgoption == "solid") {
283
+        if ($bgoption == "solid") {
284 284
             $__user_u->update_row($_SESSION['siteusername'], "2012_bg ", $default);
285 285
         }
286 286
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -211,8 +211,9 @@  discard block
 block discarded – undo
211 211
         if(!empty($_POST['solidcolor'])) {
212 212
             $__user_u->update_row($_SESSION['siteusername'], "2012_bgoption", $_POST['bgoption']);
213 213
 
214
-            if($_POST['bgoption'] == "solid")
215
-                $__user_u->update_row($_SESSION['siteusername'], "2012_bg", "");
214
+            if($_POST['bgoption'] == "solid") {
215
+                            $__user_u->update_row($_SESSION['siteusername'], "2012_bg", "");
216
+            }
216 217
 
217 218
             $__user_u->update_row($_SESSION['siteusername'], "primary_color", $_POST['solidcolor']);
218 219
         }
@@ -267,8 +268,9 @@  discard block
 block discarded – undo
267 268
                 $_POST['layout_channel'] == "featured"  || 
268 269
                 $_POST['layout_channel'] == "playlists" || 
269 270
                 $_POST['layout_channel'] == "everything"
270
-            )
271
-                $__user_u->update_row($_SESSION['siteusername'], "layout", $_POST['layout_channel']);
271
+            ) {
272
+                            $__user_u->update_row($_SESSION['siteusername'], "layout", $_POST['layout_channel']);
273
+            }
272 274
         }
273 275
 
274 276
     if(!empty($_POST['bgoptionset'])) {
Please login to merge, or discard this patch.
web/public/s/mod/header.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
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
 
9
-	if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
10
-		die("<a href='/logout'>Your user has been deleted. Logout</a>");
11
-	}
9
+    if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
10
+        die("<a href='/logout'>Your user has been deleted. Logout</a>");
11
+    }
12 12
 ?>
13 13
 <!-- begin masthead -->
14 14
 <div id="masthead" class="" dir="ltr">
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 <div id="masthead-expanded" class="hid" style="display: none;height: 165px;">
106 106
 	<div id="masthead-expanded-container" style="height: 142px;" class="with-sandbar">
107 107
 	<?php
108
-		$stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
109
-		$stmt->bindParam(":username", $_SESSION['siteusername']);
110
-		$stmt->execute();
111
-	?>
108
+        $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
109
+        $stmt->bindParam(":username", $_SESSION['siteusername']);
110
+        $stmt->execute();
111
+    ?>
112 112
 	<div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="<?php echo $stmt->rowCount(); ?>"
113 113
 		style="
114 114
 		width: 580px;
@@ -123,14 +123,14 @@  discard block
 block discarded – undo
123 123
 	<div class="yt-uix-slider-body" style="width: 525px;">
124 124
 		<div class="yt-uix-slider-slides">
125 125
 			<?php 
126
-				while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
127
-					$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
128
-					$video['duration'] = $__time_h->timestamp($video['duration']);
129
-					$video['views'] = $__video_h->fetch_video_views($video['rid']);
130
-					$video['author'] = htmlspecialchars($video['author']);		
131
-					$video['title'] = htmlspecialchars($video['title']);
132
-					$video['description'] = $__video_h->shorten_description($video['description'], 50);
133
-			?>
126
+                while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
127
+                    $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
128
+                    $video['duration'] = $__time_h->timestamp($video['duration']);
129
+                    $video['views'] = $__video_h->fetch_video_views($video['rid']);
130
+                    $video['author'] = htmlspecialchars($video['author']);		
131
+                    $video['title'] = htmlspecialchars($video['title']);
132
+                    $video['description'] = $__video_h->shorten_description($video['description'], 50);
133
+            ?>
134 134
 			<ul class="yt-uix-slider-slide ">
135 135
 				<li class="yt-uix-slider-slide-item ">
136 136
 					<div class="video-list-item  yt-tile-default ">
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
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
 
9
-	if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
9
+	if (isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
10 10
 		die("<a href='/logout'>Your user has been deleted. Logout</a>");
11 11
 	}
12 12
 ?>
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	<a id="logo-container" href="/" title="SubRocks home">
16 16
 	<img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="SubRocks home">
17 17
 	</a>
18
-	<?php if(!isset($_SESSION['siteusername'])) { ?>
18
+	<?php if (!isset($_SESSION['siteusername'])) { ?>
19 19
 	<div id="yt-masthead-signin">
20 20
 		<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">
21 21
 			<span class="clip">
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 			<div id="masthead-user-bar">
34 34
 				<div id="masthead-user">
35 35
 					<span id="masthead-gaia-user-expander" class="masthead-user-menu-expander masthead-expander" onclick="yt.www.masthead.toggleExpandedMasthead()"><span id="masthead-gaia-user-wrapper" class="yt-rounded" tabindex="0"><?php echo htmlspecialchars($_SESSION['siteusername']); ?></span></span>
36
-							<?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
36
+							<?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
37 37
 							<button type="button" onclick=";window.location.href=this.getAttribute('href');return false;" href="/inbox/" class="sb-button sb-notif-on yt-uix-button" id="sb-button-notify" role="button"><span class="yt-uix-button-content"><?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?></span></button>
38 38
 					<?php } else { ?>
39 39
 							<button type="button" onclick=";window.location.href=this.getAttribute('href');return false;" href="/inbox/" class="sb-button sb-notif-off yt-uix-button" id="sb-button-notify" role="button"><span class="yt-uix-button-content"><?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?></span></button>
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	<div class="alerts-2012">
56 56
 	
57 57
 	</div>
58
-	<?php if(isset($error['status'])) { ?>
58
+	<?php if (isset($error['status'])) { ?>
59 59
 		<div id="masthead_child_div" style="width: 970px;margin: auto;"><div class="yt-alert yt-alert-default yt-alert-error  yt-alert-player">  <div class="yt-alert-icon">
60 60
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
61 61
 		</div>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			</div>
66 66
 		</div></div></div>
67 67
 	<?php } ?>
68
-	<?php if(isset($_GET['error'])) { ?>
68
+	<?php if (isset($_GET['error'])) { ?>
69 69
 		<div id="masthead_child_div" style="width: 970px;margin: auto;"><div class="yt-alert yt-alert-default yt-alert-error ">  <div class="yt-alert-icon">
70 70
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
71 71
 		</div>
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 			</div>
76 76
 		</div></div></div>
77 77
 	<?php } ?>
78
-	<?php if(isset($_GET['success'])) { ?>
78
+	<?php if (isset($_GET['success'])) { ?>
79 79
 		<div id="masthead_child_div" style="width: 970px;margin: auto;"><div class="yt-alert yt-alert-default yt-alert-success ">  <div class="yt-alert-icon">
80 80
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
81 81
 		</div>
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			</div>
86 86
 		</div></div></div>
87 87
 	<?php } ?>
88
-	<?php if(isset($_SESSION['error'])) { ?>
88
+	<?php if (isset($_SESSION['error'])) { ?>
89 89
 		<div id="masthead_child_div" style="width: 970px;margin: auto;"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
90 90
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
91 91
 		</div>
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		<b>New minor update: <pre style="display:inline-block;">1fe1fa4</pre></b> <pre style="display:inline-block;font-size:10px;margin-left:35px;">This is a part of the Communications update. The inbox has been updated with a cleaner look.</pre>
102 102
 	</div></div></div></div><br>
103 103
 	-->
104
-<?php if(isset($_SESSION['siteusername'])) { ?>
104
+<?php if (isset($_SESSION['siteusername'])) { ?>
105 105
 <div id="masthead-expanded" class="hid" style="display: none;height: 165px;">
106 106
 	<div id="masthead-expanded-container" style="height: 142px;" class="with-sandbar">
107 107
 	<?php
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	<div class="yt-uix-slider-body" style="width: 525px;">
124 124
 		<div class="yt-uix-slider-slides">
125 125
 			<?php 
126
-				while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
126
+				while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
127 127
 					$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
128 128
 					$video['duration'] = $__time_h->timestamp($video['duration']);
129 129
 					$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/s/mod/channel_everything.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 												<div class="module-view other-channels-view">
216 216
 													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
217 217
 													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
218
-														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
-													} ?>
218
+                                                        echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
+                                                    } ?>
220 220
 													<ul class="channel-summary-list ">
221 221
 														<?php 
222
-															foreach($_user['featured_channels'] as $user) {
223
-																if($__user_h->user_exists($user)) {
224
-														?>
222
+                                                            foreach($_user['featured_channels'] as $user) {
223
+                                                                if($__user_h->user_exists($user)) {
224
+                                                        ?>
225 225
 															<li class="yt-tile-visible yt-uix-tile">
226 226
 																<div class="channel-summary clearfix channel-summary-compact">
227 227
 																	<div class="channel-summary-thumb">
@@ -245,19 +245,19 @@  discard block
 block discarded – undo
245 245
 											</div>
246 246
 
247 247
 											<?php 
248
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
-												$stmt->bindParam(":search", $_user['username']);
250
-												$stmt->execute();
248
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
+                                                $stmt->bindParam(":search", $_user['username']);
250
+                                                $stmt->execute();
251 251
 
252
-												if($stmt->rowCount() != 0) {
253
-											?>
252
+                                                if($stmt->rowCount() != 0) {
253
+                                            ?>
254 254
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
255 255
 													<div class="module-view gh-featured">
256 256
 														<h2>Featured Playlists</h2>     
257 257
 														<?php
258
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
-															$playlist['videos'] = json_decode($playlist['videos']);
260
-														?> 
258
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
260
+                                                        ?> 
261 261
 															<div class="playlist yt-tile-visible yt-uix-tile">
262 262
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
263 263
 																<span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering">
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template">
3 3
 									<div class="tab-content-body">
4 4
 										<div class="primary-pane">
5
-                                            <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?>
5
+                                            <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?>
6 6
 											<div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge">
7 7
 												<div class="module-view featured-video-view-module">
8 8
 												<div id="watch-video" >
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
                                                         ?>
57 57
                                                         <div class="playlist-info">
58 58
                                                             <h2><?php echo htmlspecialchars($_user['username']); ?>'s playlists</h2>
59
-                                                            <?php if($stmt->rowCount() == 0) { echo "<span style='font-size:11px;color:grey;'>This user has no playlists available currently.</span><br><br>"; } ?>
59
+                                                            <?php if ($stmt->rowCount() == 0) { echo "<span style='font-size:11px;color:grey;'>This user has no playlists available currently.</span><br><br>"; } ?>
60 60
                                                             <div class="yt-horizontal-rule "><span class="first"></span><span class="second"></span><span class="third"></span></div>
61 61
                                                         </div>
62 62
                                                         <?php 
63
-                                                            if($stmt->rowCount() != 0) {
64
-                                                                while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
63
+                                                            if ($stmt->rowCount() != 0) {
64
+                                                                while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
65 65
                                                                     $playlist['videos'] = json_decode($playlist['videos']);
66 66
                                                         ?>
67 67
                                                         <div class="playlist yt-tile-visible yt-uix-tile">
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 													<div class="playlist-info">
100 100
 														<h2>Uploaded videos</h2>
101 101
 														<div class="yt-horizontal-rule "><span class="first"></span><span class="second"></span><span class="third"></span></div>
102
-														<?php if($_user['videos'] == 0) { ?>
102
+														<?php if ($_user['videos'] == 0) { ?>
103 103
 															<h4>This user has not uploaded a video yet.</h4>
104 104
 														<?php } ?>
105 105
 													</div>
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                                                             $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
109 109
                                                             $stmt->bindParam(":username", $_user['username']);
110 110
                                                             $stmt->execute();
111
-                                                            while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
111
+                                                            while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
112 112
                                                         ?>
113 113
 														<li class="blogger-video">
114 114
 															<div class="video yt-tile-visible">
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 														</div>
191 191
 														<hr class="yt-horizontal-rule ">
192 192
 													</div>
193
-													<?php if(!empty($_user['website'])) { ?>
193
+													<?php if (!empty($_user['website'])) { ?>
194 194
 														<div class="user-profile-item">
195 195
 															<div class="yt-c3-profile-custom-url field-container ">
196 196
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 															<h5>Country</h5>
240 240
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
241 241
 														</div>
242
-														<?php if($_user['genre'] != "none") { ?>
242
+														<?php if ($_user['genre'] != "none") { ?>
243 243
 															<div class="user-profile-item ">
244 244
 																<h5>Channel Genre</h5>
245 245
 																<span class="value"><?php echo htmlspecialchars(ucfirst($_user['genre'])); ?></span>
@@ -251,16 +251,16 @@  discard block
 block discarded – undo
251 251
 											</div>
252 252
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
253 253
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
254
-												<?php if(count($_user['featured_channels']) != 0) { ?>
254
+												<?php if (count($_user['featured_channels']) != 0) { ?>
255 255
 												<div class="module-view other-channels-view">
256
-													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
257
-													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
256
+													<h2 <?php if (@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
257
+													<?php if (@$_SESSION['siteusername'] == $_user['username']) { 
258 258
 														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
259 259
 													} ?>
260 260
 													<ul class="channel-summary-list ">
261 261
 														<?php 
262
-															foreach($_user['featured_channels'] as $user) {
263
-																if($__user_h->user_exists($user)) {
262
+															foreach ($_user['featured_channels'] as $user) {
263
+																if ($__user_h->user_exists($user)) {
264 264
 														?>
265 265
 															<li class="yt-tile-visible yt-uix-tile">
266 266
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -289,13 +289,13 @@  discard block
 block discarded – undo
289 289
 												$stmt->bindParam(":search", $_user['username']);
290 290
 												$stmt->execute();
291 291
 
292
-												if($stmt->rowCount() != 0) {
292
+												if ($stmt->rowCount() != 0) {
293 293
 											?>
294 294
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
295 295
 													<div class="module-view gh-featured">
296 296
 														<h2>Featured Playlists</h2>     
297 297
 														<?php
298
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
298
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
299 299
 															$playlist['videos'] = json_decode($playlist['videos']);
300 300
 														?> 
301 301
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.