Test Failed
Push — main ( fafdd8...293136 )
by chief
03:47 queued 13s
created
web/public/get/delete_video_admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 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(); }
15
-    if(!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15
+    if (!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
16 16
 
17 17
     $request = (object) [
18 18
         "video" => $_GET['v'],
Please login to merge, or discard this patch.
web/public/s/mod/sidebar_inbox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@
 block discarded – undo
35 35
     </a>
36 36
 </div>
37 37
     <ol class="navigation-menu">
38
-        <?php foreach($__tabs as $_tab) { 
39
-            if($_SERVER['REQUEST_URI'] != $_tab->url)
38
+        <?php foreach ($__tabs as $_tab) { 
39
+            if ($_SERVER['REQUEST_URI'] != $_tab->url)
40 40
                 $_tab->selected = true;
41 41
             ?>
42 42
             <li class="menu-item">
Please login to merge, or discard this patch.
web/public/admin/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 <?php $__user_u = new user_update($__db); ?>
10 10
 <?php $__db_h = new db_helper(); ?>
11 11
 <?php $__time_h = new time_helper(); ?>
12
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
-<?php if(!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?>
12
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?>
14 14
 <?php
15 15
 	$__server->page_embeds->page_title = "SubRocks - Admin Panel";
16 16
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		$dif['idle'] = $info2[3] - $info1[3]; 
31 31
 		$total = array_sum($dif); 
32 32
 		$cpu = array(); 
33
-		foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
33
+		foreach ($dif as $x=>$y) $cpu[$x] = round($y/$total*100, 1);
34 34
 
35 35
 		return $cpu;
36 36
 	}
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 		foreach ($hexCode as & $color) {
48 48
 			$adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;
49
-			$adjustAmount = ceil($adjustableLimit * $adjustPercent);
49
+			$adjustAmount = ceil($adjustableLimit*$adjustPercent);
50 50
 
51 51
 			$color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);
52 52
 		}
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 	function get_server_memory_usage() {
58 58
 		$free = shell_exec('free');
59
-		$free = (string)trim($free);
59
+		$free = (string) trim($free);
60 60
 		$free_arr = explode("\n", $free);
61 61
 		$mem = explode(" ", $free_arr[1]);
62 62
 		$mem = array_filter($mem);
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 											CPU Idle Usage: 
275 275
 												<b style="float:right;color:<?php echo adjustBrightness("#FF0000", $server['idle']); ?>">
276 276
 													<?php echo $server['idle']; ?>%</b><br>
277
-											RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3)	; ?> megabytes</b>
277
+											RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3); ?> megabytes</b>
278 278
 										</div>
279 279
 										<div style="width: 200px;display:inline-block;margin-right:20px;vertical-align: top;margin-left: 22px;">
280 280
 											<?php $server = get_server_array_stats(); ?>
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  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
-	if(isset($_SESSION['siteusername']))
21
+	if (isset($_SESSION['siteusername']))
22 22
 		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
23 23
 
24 24
 	$_SESSION['current_video'] = $_video['rid'];
@@ -67,20 +67,20 @@  discard block
 block discarded – undo
67 67
          if (window.yt.timing) {yt.timing.tick("ct");}    
68 68
       </script>
69 69
 		<?php
70
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
70
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
71 71
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
72 72
 
73
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
74
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
73
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
74
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
75 75
 
76 76
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
77 77
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
78 78
 
79
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
80 80
 				$_video['likeswidth'] = 0;
81 81
 				$_video['dislikeswidth'] = 0;
82 82
 			} else {
83
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
83
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
84 84
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
85 85
 			}
86 86
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 									</div>
115 115
 									<div id="instream_google_companion_ad_div"></div>
116 116
 								</div>
117
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
117
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
118 118
 									<div id="watch-owner-container">
119 119
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
120 120
 											<ul class="yt-nav-aside">
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 										</div>
134 134
 									</div><br>
135 135
 								<?php } ?>
136
-								<?php if($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?>
136
+								<?php if ($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?>
137 137
 									<div id="watch-owner-container">
138 138
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
139 139
 											<ul class="yt-nav-aside">
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
 										$stmt->execute();
160 160
 										$alts = $stmt->rowCount();
161 161
 
162
-										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
162
+										if ($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
163 163
 
164
-										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
165
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
164
+										while ($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
165
+											if ($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
166 166
 												echo "
167 167
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
168 168
 													htmlspecialchars($username['username']) 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 											title="" 
188 188
 											id="subscribe-button"
189 189
 											type="button" 
190
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
190
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
191 191
 											role="button">
192 192
 											<span class="yt-uix-button-icon-wrapper">
193 193
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 						<div id="watch-main-container">
246 246
 							<div id="watch-main">
247 247
 								<div id="watch-panel">
248
-	  								<?php if($_video['visibility'] == "u") { ?>
248
+	  								<?php if ($_video['visibility'] == "u") { ?>
249 249
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn">  <div class="yt-alert-icon">
250 250
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
251 251
 										</div>
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 												This video is unlisted. Only people who have the link can view this video.
255 255
 											</div>
256 256
 										</div></div></div>
257
-									<?php } else if($_video['visibility'] == "v") { ?>
257
+									<?php } else if ($_video['visibility'] == "v") { ?>
258 258
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
259 259
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
260 260
 										</div>
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 											<button onclick=";like_video();return false;"
289 289
 											title="I like this" 
290 290
 											type="button" 
291
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
291
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
292 292
 											id="watch-like"  
293 293
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
294 294
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 											type="button" 
303 303
 											style="margin-left: -2px;"
304 304
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
305
-											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" 
305
+											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" 
306 306
 											id="watch-unlike" 
307 307
 											role="button">
308 308
 												<span class="yt-uix-button-icon-wrapper">
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 												</div>
323 323
 											</div>
324 324
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
325
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
325
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
326 326
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
327 327
 													<div class="yt-alert-icon">
328 328
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 												<?php } else { ?>
339 339
 													<h3>Be friends with the creator</h3>
340 340
 
341
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
341
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
342 342
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
343 343
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
344 344
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -352,8 +352,8 @@  discard block
 block discarded – undo
352 352
 														</span><br><br>
353 353
 													<?php } ?>
354 354
 
355
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
356
-														<?php if($_video['friended'] == false) { ?>
355
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
356
+														<?php if ($_video['friended'] == false) { ?>
357 357
 															<a href="/friends">Send a friend request</a>
358 358
 														<?php } else { ?>
359 359
 															Your friend request is pending.
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 													<?php } ?>
364 364
 													<hr><br>
365 365
 													<h3>Add to Favorites</h3>
366
-													<?php if($_video['favorited'] == false) { ?>
366
+													<?php if ($_video['favorited'] == false) { ?>
367 367
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
368 368
 													<?php } else { ?>
369 369
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -374,10 +374,10 @@  discard block
 block discarded – undo
374 374
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
375 375
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
376 376
 														$stmt->execute();
377
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
377
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
378 378
 															$buffer = json_decode($playlist['videos']);
379 379
 															@$rid = $buffer[0];
380
-															if(!empty($rid)) {
380
+															if (!empty($rid)) {
381 381
 																@$video = $__video_h->fetch_video_rid($rid);
382 382
 															} else {
383 383
 																$video['thumbnail'] = "";
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 												$stmt->execute();
656 656
 											?>
657 657
 
658
-											<?php if($stmt->rowCount() != 0) { ?>
658
+											<?php if ($stmt->rowCount() != 0) { ?>
659 659
 												<div class="comments-section">
660 660
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
661 661
 													see all
@@ -663,8 +663,8 @@  discard block
 block discarded – undo
663 663
 													<h4>Video Responses</h4>
664 664
 													<ul class="video-list">
665 665
 													<?php 
666
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
667
-															if($__video_h->video_exists($video['video'])) { 
666
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
667
+															if ($__video_h->video_exists($video['video'])) { 
668 668
 																$video = $__video_h->fetch_video_rid($video['video']);
669 669
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
670 670
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -695,18 +695,18 @@  discard block
 block discarded – undo
695 695
 														</h4>
696 696
 													</div>
697 697
 												</div>
698
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
698
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
699 699
 													<div class="comments-post-container clearfix">
700 700
 														<div class="comments-post-alert">
701 701
 															<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>
702 702
 														</div>
703 703
 													</div>
704
-												<?php } else if($_video['commenting'] == "d") { ?>
704
+												<?php } else if ($_video['commenting'] == "d") { ?>
705 705
 													<div class="comments-disabled-message">
706 706
 														<img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png">
707 707
 														<span>Adding comments has been disabled for this video.</span>
708 708
 													</div>
709
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
709
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
710 710
 													<div class="comments-post-container clearfix">
711 711
 														<div class="comments-post-alert">
712 712
 															This user has blocked you!
@@ -760,15 +760,15 @@  discard block
 block discarded – undo
760 760
 														$stmt->execute();
761 761
 
762 762
 														$number_of_result = $stmt->rowCount();
763
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
763
+														$number_of_page = ceil($number_of_result/$results_per_page);  
764 764
 
765
-														if (!isset ($_GET['page']) ) {  
765
+														if (!isset ($_GET['page'])) {  
766 766
 															$page = 1;  
767 767
 														} else {  
768
-															$page = (int)$_GET['page'];  
768
+															$page = (int) $_GET['page'];  
769 769
 														}  
770 770
 
771
-														$page_first_result = ($page - 1) * $results_per_page;  
771
+														$page_first_result = ($page - 1)*$results_per_page;  
772 772
 
773 773
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
774 774
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -776,10 +776,10 @@  discard block
 block discarded – undo
776 776
 														$stmt->bindParam(":pper", $results_per_page);
777 777
 														$stmt->execute();
778 778
 
779
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
780
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
779
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
780
+															if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
781 781
 																$comment['liked'] = true;
782
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
782
+															else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
783 783
 																$comment['disliked'] = true;
784 784
 																
785 785
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 																			<span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span>
802 802
 																			</span>
803 803
 																			</span></span>
804
-																			<?php if($comment['likes'] != 0) { ?>
804
+																			<?php if ($comment['likes'] != 0) { ?>
805 805
 																			<span dir="ltr" class="comments-rating-positive" title="9 up, 1 down">
806 806
 																				<?php echo $comment['likes']; ?>
807 807
 																				<img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif">
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 																			</button>
830 830
 																		</span>
831 831
 																	</div>
832
-																<?php if(isset($_SESSION['siteusername'])) { ?> 
832
+																<?php if (isset($_SESSION['siteusername'])) { ?> 
833 833
 																	<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']); ?>">
834 834
 
835 835
 																	<div class="comment-body">
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 															$stmt2->bindParam(":rid", $comment['id']);
855 855
 															$stmt2->execute();
856 856
 
857
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
857
+															while ($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
858 858
 														?>
859 859
 															<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">
860 860
 																<div class="comment-body">
@@ -937,11 +937,11 @@  discard block
 block discarded – undo
937 937
 												<?php
938 938
 													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
939 939
 													$stmt->execute();
940
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
940
+													while ($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
941 941
 														$_playlist['videos'] = json_decode($_playlist['videos']);
942 942
 														$_playlist['count'] = 1;
943 943
 
944
-														if($__video_h->video_exists($_playlist['videos'][0])) {
944
+														if ($__video_h->video_exists($_playlist['videos'][0])) {
945 945
 															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
946 946
 														} else {
947 947
 															$video = [];
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 												<?php
997 997
 													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
998 998
 													$stmt->execute();
999
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
999
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1000 1000
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1001 1001
 														$video['duration'] = $__time_h->timestamp($video['duration']);
1002 1002
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/d/admin.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 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(); }
15
-    if(!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15
+    if (!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
16 16
 
17 17
     $request = (object) [
18 18
         "action" => $_GET['action'],
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
     );
50 50
     $request->tables_increment = 0;
51 51
 
52
-    if($request->action == "ban_users") {        
53
-        foreach($request->users as $username) {
52
+    if ($request->action == "ban_users") {        
53
+        foreach ($request->users as $username) {
54 54
             $stmt = $__db->prepare("DELETE FROM users WHERE username=:username");
55 55
             $stmt->execute(array(
56 56
                 ':username' => $username,
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 
134 134
             header("Location: /admin/bans");
135 135
         }
136
-    } else if($request->action == "delete_videos") {
137
-        foreach($request->videos as $video) {
136
+    } else if ($request->action == "delete_videos") {
137
+        foreach ($request->videos as $video) {
138 138
             $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:video");
139 139
             $stmt->execute(array(
140 140
                 ':video' => $video,
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
             header("Location: /admin/bans");
144 144
         }
145
-    } else if($request->action == "actually_just_ban") {
145
+    } else if ($request->action == "actually_just_ban") {
146 146
         /*
147 147
         foreach($request->users as $user) {
148 148
             $stmt = $__db->prepare("UPDATE videos SET visibility = :visibility WHERE author = :username");
Please login to merge, or discard this patch.
web/public/s/mod/header.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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
 ?>
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 	<a id="logo-container" href="/" title="SubRocks home">
12 12
 	<img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="SubRocks home">
13 13
 	</a>
14
-	<?php if(!isset($_SESSION['siteusername'])) { ?>
14
+	<?php if (!isset($_SESSION['siteusername'])) { ?>
15 15
 	<div id="yt-masthead-signin">
16 16
 		<div id="masthead-user-display"><span id="masthead-user-wrapper"><button href="/sign_in" type="button" id="masthead-user-button" onclick=";window.location.href=this.getAttribute('href');return false;" class=" yt-uix-button yt-uix-button-text" role="button"><span class="yt-uix-button-content">  <span id="masthead-user-image">
17 17
 			<span class="clip">
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		<span id="yt-masthead-user-displayname" dir="ltr" class="yt-valign-container" onclick="yt.www.masthead.toggleExpandedMasthead();">
30 30
 		<?php echo htmlspecialchars($_SESSION['siteusername']); ?>
31 31
 		</span>
32
-		<?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
32
+		<?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
33 33
 		<a style="border-radius:2px;font-weight:bold;border:1px solid #CE4D34;position:relative;top:1px;color: white;text-decoration: none;background-color: #E26148;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
34 34
 		<?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?> 
35 35
 		</a>
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 			</form>
52 52
 		</div>
53 53
 	</div></div>
54
-<?php if(isset($_SESSION['siteusername'])) { ?>
54
+<?php if (isset($_SESSION['siteusername'])) { ?>
55 55
 <div id="masthead-expanded" class="hid" style="display: none;">
56 56
 	<div id="masthead-expanded-container" class="with-sandbar">
57 57
 	<div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="4"
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                     $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
73 73
                     $stmt->bindParam(":username", $_SESSION['siteusername']);
74 74
                     $stmt->execute();
75
-                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
75
+                    while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
76 76
                         $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
77 77
                         $video['duration'] = $__time_h->timestamp($video['duration']);
78 78
                         $video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 <?php } ?>
217 217
 </div>
218 218
 <div id="alerts">
219
-	<?php if(isset($error['status'])) { ?>
219
+	<?php if (isset($error['status'])) { ?>
220 220
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error  yt-alert-player">  <div class="yt-alert-icon">
221 221
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
222 222
 		</div>
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			</div>
227 227
 		</div></div></div>
228 228
 	<?php } ?>
229
-	<?php if(isset($_GET['error'])) { ?>
229
+	<?php if (isset($_GET['error'])) { ?>
230 230
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error ">  <div class="yt-alert-icon">
231 231
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
232 232
 		</div>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 			</div>
237 237
 		</div></div></div>
238 238
 	<?php } ?>
239
-	<?php if(isset($_GET['success'])) { ?>
239
+	<?php if (isset($_GET['success'])) { ?>
240 240
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-success ">  <div class="yt-alert-icon">
241 241
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
242 242
 		</div>
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			</div>
247 247
 		</div></div></div>
248 248
 	<?php } ?>
249
-	<?php if(isset($_SESSION['error'])) { ?>
249
+	<?php if (isset($_SESSION['error'])) { ?>
250 250
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
251 251
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
252 252
 		</div>
Please login to merge, or discard this patch.
web/public/s/mod/channel_feed.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
                                                                         $stmt->bindParam(":comment_username", $_user['username']);
48 48
 																		$stmt->bindParam(":videos_username", $_user['username']);
49 49
                                                                         $stmt->execute();
50
-																		if($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; }
51
-                                                                        while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
52
-																			if((int)$content['id']) {
50
+																		if ($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; }
51
+                                                                        while ($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
52
+																			if ((int) $content['id']) {
53 53
 																				$content = $__video_h->fetch_comment_id($content['id']);
54 54
 																				$content['video'] = $__video_h->fetch_video_rid($content['toid']);
55 55
 																				$content['type'] = "comment";
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 																				$content['type'] = "video";
59 59
 																			}
60 60
 
61
-																			if($content['type'] == "video") {
61
+																			if ($content['type'] == "video") {
62 62
                                                                     ?>
63 63
                                                                     <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg">
64 64
                                                                         <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>">  <span class="feed-item-author">
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                                                                         </div>
131 131
                                                                     </div>
132 132
                                                                     <?php } else { 
133
-																		if($__video_h->video_exists($content['video']['rid'])) { ?>
133
+																		if ($__video_h->video_exists($content['video']['rid'])) { ?>
134 134
 																	<div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw">
135 135
 																		<a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>">  <span class="feed-item-author">
136 136
 																		<span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo htmlspecialchars($content['author']); ?>" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($content['author']); ?>" width="28"><span class="vertical-align"></span></span></span></span>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 														</div>
237 237
 														<hr class="yt-horizontal-rule ">
238 238
 													</div>
239
-													<?php if(!empty($_user['website'])) { ?>
239
+													<?php if (!empty($_user['website'])) { ?>
240 240
 														<div class="user-profile-item">
241 241
 															<div class="yt-c3-profile-custom-url field-container ">
242 242
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 															<h5>Country</h5>
286 286
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
287 287
 														</div>
288
-														<?php if($_user['genre'] != "none") { ?>
288
+														<?php if ($_user['genre'] != "none") { ?>
289 289
 															<div class="user-profile-item ">
290 290
 																<h5>Channel Genre</h5>
291 291
 																<span class="value"><?php echo htmlspecialchars(ucfirst($_user['genre'])); ?></span>
@@ -297,16 +297,16 @@  discard block
 block discarded – undo
297 297
 											</div>
298 298
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
299 299
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
300
-												<?php if(count($_user['featured_channels']) != 0) { ?>
300
+												<?php if (count($_user['featured_channels']) != 0) { ?>
301 301
 												<div class="module-view other-channels-view">
302
-													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
303
-													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
302
+													<h2 <?php if (@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
303
+													<?php if (@$_SESSION['siteusername'] == $_user['username']) { 
304 304
 														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
305 305
 													} ?>
306 306
 													<ul class="channel-summary-list ">
307 307
 														<?php 
308
-															foreach($_user['featured_channels'] as $user) {
309
-																if($__user_h->user_exists($user)) {
308
+															foreach ($_user['featured_channels'] as $user) {
309
+																if ($__user_h->user_exists($user)) {
310 310
 														?>
311 311
 															<li class="yt-tile-visible yt-uix-tile">
312 312
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -335,13 +335,13 @@  discard block
 block discarded – undo
335 335
 												$stmt->bindParam(":search", $_user['username']);
336 336
 												$stmt->execute();
337 337
 
338
-												if($stmt->rowCount() != 0) {
338
+												if ($stmt->rowCount() != 0) {
339 339
 											?>
340 340
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
341 341
 													<div class="module-view gh-featured">
342 342
 														<h2>Featured Playlists</h2>     
343 343
 														<?php
344
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
344
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
345 345
 															$playlist['videos'] = json_decode($playlist['videos']);
346 346
 														?> 
347 347
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.
web/public/s/classes/config.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@  discard block
 block discarded – undo
23 23
             "db_connected" => false,
24 24
         ], 
25 25
 
26
-        "video_properties" => (object) [ "status" => "unloaded" ],
27
-        "user_properties"  => (object) [ "status" => "unloaded" ],
28
-        "group_properties" => (object) [ "status" => "unloaded" ],
29
-        "forum_properties" => (object) [ "status" => "unloaded" ],
26
+        "video_properties" => (object) ["status" => "unloaded"],
27
+        "user_properties"  => (object) ["status" => "unloaded"],
28
+        "group_properties" => (object) ["status" => "unloaded"],
29
+        "forum_properties" => (object) ["status" => "unloaded"],
30 30
     ];
31 31
 
32 32
     try
33 33
     {
34
-        $__db = new PDO("mysql:host=".$__server->db_properties->db_host.";dbname=".$__server->db_properties->db_database.";charset=utf8mb4",
34
+        $__db = new PDO("mysql:host=" . $__server->db_properties->db_host . ";dbname=" . $__server->db_properties->db_database . ";charset=utf8mb4",
35 35
             $__server->db_properties->db_user,
36 36
             $__server->db_properties->db_password,
37 37
             [
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
         );
42 42
         $__server->db_properties->db_connected = true;
43 43
     }
44
-    catch(PDOException $e)
44
+    catch (PDOException $e)
45 45
     {
46
-        die("An error occured connecting to the database: ".$e->getMessage());
46
+        die("An error occured connecting to the database: " . $e->getMessage());
47 47
     }
48 48
 
49 49
     session_start();
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	$stmt->bindParam(":username", $_SESSION['siteusername']);
54 54
 	$stmt->execute();
55 55
 
56
-	while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
56
+	while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
57 57
         $ban_info = $ban;
58
-        if($_SERVER['REQUEST_URI'] != "/ban")
58
+        if ($_SERVER['REQUEST_URI'] != "/ban")
59 59
 		    header("Location: /ban");
60 60
 	}
61 61
 ?>
62 62
\ No newline at end of file
Please login to merge, or discard this patch.
web/public/api/get_user_info.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
     "status" => 201,
15 15
 ];
16 16
 
17
-if(!isset($_GET['u']))                  { $response->status = 400; die(json_encode($response)); } 
18
-if(!$__user_h->user_exists($_GET['u'])) { $response->status = 400; die(json_encode($response)); }
17
+if (!isset($_GET['u'])) { $response->status = 400; die(json_encode($response)); } 
18
+if (!$__user_h->user_exists($_GET['u'])) { $response->status = 400; die(json_encode($response)); }
19 19
 
20 20
 $_user = $__user_h->fetch_user_username($_GET['u']);
21 21
 $response = (object) [
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 $_user['featured_channels'] = explode($_user['featured_channels'], ",");
41 41
 $_user['featured_channels_object'] = (object) [];
42 42
 $i = 0;
43
-foreach($_user['featured_channels'] as $channel) {
43
+foreach ($_user['featured_channels'] as $channel) {
44 44
     $_user['featured_channels_object']->$i = $channel;
45 45
 }
46 46
 
Please login to merge, or discard this patch.