Test Failed
Push — main ( a201ed...241bcb )
by chief
03:31
created
web/public/channel_discussion.php 1 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.
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/s/mod/header.php 1 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>
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	<div id="ticker" class="ytg-base "><div id="ticker-inner"><div class="ytg-wide"><button onclick="yt.net.cookies.set('HideTicker', 1, 604800);" class="yt-uix-close" data-close-parent-id="ticker"><img alt="Close" src="https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"></button><img class="ticker-icon" src="https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt=""><div class="ticker-content">
100 100
 		<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>
101 101
 	</div></div></div></div><br>
102
-<?php if(isset($_SESSION['siteusername'])) { ?>
102
+<?php if (isset($_SESSION['siteusername'])) { ?>
103 103
 <div id="masthead-expanded" class="hid" style="display: none;">
104 104
 	<div id="masthead-expanded-container" class="with-sandbar">
105 105
 	<div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="4"
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                     $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
121 121
                     $stmt->bindParam(":username", $_SESSION['siteusername']);
122 122
                     $stmt->execute();
123
-                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
123
+                    while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
124 124
                         $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
125 125
                         $video['duration'] = $__time_h->timestamp($video['duration']);
126 126
                         $video['views'] = $__video_h->fetch_video_views($video['rid']);
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.