Test Failed
Push — main ( 2f6890...e57cdf )
by chief
02:56
created
web/public/watch_2.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
         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; }
24 24
 
25 25
         if(!isset($error['message'])) {
26
-			$text = $_POST['comment'];
26
+            $text = $_POST['comment'];
27 27
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
28 28
             $stmt->bindParam(":v", $_GET['v']);
29
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
30
-			$stmt->bindParam(":comment", $text);
29
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
30
+            $stmt->bindParam(":comment", $text);
31 31
             $stmt->execute();
32 32
 
33
-			$__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
33
+            $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
34 34
         }
35 35
     }
36 36
 ?>
@@ -53,28 +53,28 @@  discard block
 block discarded – undo
53 53
 			if (window.yt.timing) {yt.timing.tick("ct");}    
54 54
 		</script>
55 55
 		<?php
56
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
57
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
56
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
57
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
58 58
 
59
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
60
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
59
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
60
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
61 61
 
62
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
63
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
62
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
63
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
64 64
 
65
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
66
-				$_video['likeswidth'] = 50;
67
-				$_video['dislikeswidth'] = 50;
68
-			} else {
69
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
70
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
71
-			}
65
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
66
+                $_video['likeswidth'] = 50;
67
+                $_video['dislikeswidth'] = 50;
68
+            } else {
69
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
70
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
71
+            }
72 72
 
73
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
74
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
75
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
76
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
77
-		?>
73
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
74
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
75
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
76
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
77
+        ?>
78 78
 	</head>
79 79
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
80 80
 		<form name="logoutForm" method="POST" action="/logout">
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
 												</div>
361 361
 											</div>
362 362
 											<?php 
363
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
364
-												$stmt->bindParam(":v", $_GET['v']);
365
-												$stmt->execute();
366
-											?>
363
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
364
+                                                $stmt->bindParam(":v", $_GET['v']);
365
+                                                $stmt->execute();
366
+                                            ?>
367 367
 
368 368
 											<?php if($stmt->rowCount() != 0) { ?>
369 369
 												<div class="comments-section">
@@ -373,16 +373,16 @@  discard block
 block discarded – undo
373 373
 													<h4>Video Responses</h4>
374 374
 													<ul class="video-list">
375 375
 													<?php 
376
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
377
-															if($__video_h->video_exists($video['video'])) { 
378
-																$video = $__video_h->fetch_video_rid($video['video']);
379
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
380
-																$video['duration'] = $__time_h->timestamp($video['duration']);
381
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
382
-																$video['author'] = htmlspecialchars($video['author']);		
383
-																$video['title'] = htmlspecialchars($video['title']);
384
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
385
-													?>
376
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
377
+                                                            if($__video_h->video_exists($video['video'])) { 
378
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
379
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
380
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
381
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
382
+                                                                $video['author'] = htmlspecialchars($video['author']);		
383
+                                                                $video['title'] = htmlspecialchars($video['title']);
384
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
385
+                                                    ?>
386 386
 														<li class="video-list-item yt-tile-default">
387 387
 															<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="http://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>
388 388
 															<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">
@@ -464,31 +464,31 @@  discard block
 block discarded – undo
464 464
 												</div>
465 465
 												<ul class="comment-list" id="live_comments">
466 466
 														<?php
467
-														$results_per_page = 20;
467
+                                                        $results_per_page = 20;
468 468
 
469
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
470
-														$stmt->bindParam(":rid", $_video['rid']);
471
-														$stmt->execute();
469
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
470
+                                                        $stmt->bindParam(":rid", $_video['rid']);
471
+                                                        $stmt->execute();
472 472
 
473
-														$number_of_result = $stmt->rowCount();
474
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
473
+                                                        $number_of_result = $stmt->rowCount();
474
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
475 475
 
476
-														if (!isset ($_GET['page']) ) {  
477
-															$page = 1;  
478
-														} else {  
479
-															$page = (int)$_GET['page'];  
480
-														}  
476
+                                                        if (!isset ($_GET['page']) ) {  
477
+                                                            $page = 1;  
478
+                                                        } else {  
479
+                                                            $page = (int)$_GET['page'];  
480
+                                                        }  
481 481
 
482
-														$page_first_result = ($page - 1) * $results_per_page;  
482
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
483 483
 
484
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
485
-														$stmt->bindParam(":rid", $_video['rid']);
486
-														$stmt->bindParam(":pfirst", $page_first_result);
487
-														$stmt->bindParam(":pper", $results_per_page);
488
-														$stmt->execute();
484
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
485
+                                                        $stmt->bindParam(":rid", $_video['rid']);
486
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
487
+                                                        $stmt->bindParam(":pper", $results_per_page);
488
+                                                        $stmt->execute();
489 489
 
490
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
491
-													?>
490
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
491
+                                                    ?>
492 492
 
493 493
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
494 494
 														<div class="comment-body">
@@ -567,16 +567,16 @@  discard block
 block discarded – undo
567 567
 											<ul id="watch-related" class="video-list">
568 568
 												<div id="ppv-container" class="hid"></div>
569 569
 												<?php
570
-													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
571
-													$stmt->execute();
572
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
573
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
574
-														$video['duration'] = $__time_h->timestamp($video['duration']);
575
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
576
-														$video['author'] = htmlspecialchars($video['author']);		
577
-														$video['title'] = htmlspecialchars($video['title']);
578
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
579
-												?>
570
+                                                    $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
571
+                                                    $stmt->execute();
572
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
573
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
574
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
575
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
576
+                                                        $video['author'] = htmlspecialchars($video['author']);		
577
+                                                        $video['title'] = htmlspecialchars($video['title']);
578
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
579
+                                                ?>
580 580
 												<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="http://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>
581 581
 													<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">
582 582
 													</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   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@  discard block
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
13
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14 14
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
15 15
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
16 16
 <?php
17
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
17
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
18 18
         $error = array();
19 19
 
20
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
21
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
22
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
23
-        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; }
20
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
21
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
22
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
23
+        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; }
24 24
 
25
-        if(!isset($error['message'])) {
25
+        if (!isset($error['message'])) {
26 26
 			$text = $_POST['comment'];
27 27
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
28 28
             $stmt->bindParam(":v", $_GET['v']);
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
 			if (window.yt.timing) {yt.timing.tick("ct");}    
54 54
 		</script>
55 55
 		<?php
56
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
56
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
57 57
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
58 58
 
59
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
60
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
59
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
60
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
61 61
 
62 62
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
63 63
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
64 64
 
65
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
65
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
66 66
 				$_video['likeswidth'] = 50;
67 67
 				$_video['dislikeswidth'] = 50;
68 68
 			} else {
69
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
69
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
70 70
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
71 71
 			}
72 72
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 									</div>
100 100
 									<div id="instream_google_companion_ad_div"></div>
101 101
 								</div>
102
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
102
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
103 103
 									<div id="watch-owner-container">
104 104
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
105 105
 											<ul class="yt-nav-aside">
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 											title="" 
135 135
 											id="subscribe-button"
136 136
 											type="button" 
137
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
137
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
138 138
 											role="button">
139 139
 											<span class="yt-uix-button-icon-wrapper">
140 140
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 											<button onclick=";window.location.href=this.getAttribute('href');return false;"
227 227
 											title="I like this" 
228 228
 											type="button" 
229
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
229
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
230 230
 											id="watch-like"  
231 231
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
232 232
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 											type="button" 
241 241
 											style="margin-left: -2px;"
242 242
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
243
-											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" 
243
+											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" 
244 244
 											id="watch-unlike" 
245 245
 											role="button">
246 246
 												<span class="yt-uix-button-icon-wrapper">
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 												$stmt->execute();
366 366
 											?>
367 367
 
368
-											<?php if($stmt->rowCount() != 0) { ?>
368
+											<?php if ($stmt->rowCount() != 0) { ?>
369 369
 												<div class="comments-section">
370 370
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
371 371
 													see all
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
 													<h4>Video Responses</h4>
374 374
 													<ul class="video-list">
375 375
 													<?php 
376
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
377
-															if($__video_h->video_exists($video['video'])) { 
376
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
377
+															if ($__video_h->video_exists($video['video'])) { 
378 378
 																$video = $__video_h->fetch_video_rid($video['video']);
379 379
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
380 380
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -405,19 +405,19 @@  discard block
 block discarded – undo
405 405
 														</h4>
406 406
 													</div>
407 407
 												</div>
408
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
408
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
409 409
 													<div class="comments-post-container clearfix">
410 410
 														<div class="comments-post-alert">
411 411
 															<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>
412 412
 														</div>
413 413
 													</div>
414
-												<?php } else if($_video['commenting'] == "d") { ?>
414
+												<?php } else if ($_video['commenting'] == "d") { ?>
415 415
 													<div class="comments-post-container clearfix">
416 416
 														<div class="comments-post-alert">
417 417
 															This video has comemnting disabled!
418 418
 														</div>
419 419
 													</div>
420
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
420
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
421 421
 													<div class="comments-post-container clearfix">
422 422
 														<div class="comments-post-alert">
423 423
 															This user has blocked you!
@@ -471,15 +471,15 @@  discard block
 block discarded – undo
471 471
 														$stmt->execute();
472 472
 
473 473
 														$number_of_result = $stmt->rowCount();
474
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
474
+														$number_of_page = ceil($number_of_result/$results_per_page);  
475 475
 
476
-														if (!isset ($_GET['page']) ) {  
476
+														if (!isset ($_GET['page'])) {  
477 477
 															$page = 1;  
478 478
 														} else {  
479
-															$page = (int)$_GET['page'];  
479
+															$page = (int) $_GET['page'];  
480 480
 														}  
481 481
 
482
-														$page_first_result = ($page - 1) * $results_per_page;  
482
+														$page_first_result = ($page - 1)*$results_per_page;  
483 483
 
484 484
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
485 485
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 														$stmt->bindParam(":pper", $results_per_page);
488 488
 														$stmt->execute();
489 489
 
490
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
490
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
491 491
 													?>
492 492
 
493 493
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 												<?php
570 570
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
571 571
 													$stmt->execute();
572
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
572
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
573 573
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
574 574
 														$video['duration'] = $__time_h->timestamp($video['duration']);
575 575
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/inbox_ajax.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,29 +17,29 @@  discard block
 block discarded – undo
17 17
 
18 18
     $results_per_page = 12;
19 19
     $number_of_result = $stmt->rowCount();
20
-    $number_of_page = ceil ($number_of_result / $results_per_page);  
20
+    $number_of_page = ceil($number_of_result/$results_per_page);  
21 21
 
22
-    if (!isset ($_GET['page']) ) {  
22
+    if (!isset ($_GET['page'])) {  
23 23
         $page = 1;  
24 24
     } else {  
25
-        $page = (int)$_GET['page'];  
25
+        $page = (int) $_GET['page'];  
26 26
     }  
27 27
 
28
-    $page_first_result = ($page - 1) * $results_per_page;  
28
+    $page_first_result = ($page - 1)*$results_per_page;  
29 29
 
30
-    if($_GET['filter'] == "notification") {
30
+    if ($_GET['filter'] == "notification") {
31 31
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nt' ORDER BY id DESC LIMIT :pfirst, :pper");
32 32
         $stmt6->bindParam(":search", $search);
33 33
         $stmt6->bindParam(":pfirst", $page_first_result);
34 34
         $stmt6->bindParam(":pper", $results_per_page);
35 35
         $stmt6->execute();
36
-    } else if($_GET['filter'] == "sent") {
36
+    } else if ($_GET['filter'] == "sent") {
37 37
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE owner = :search ORDER BY id DESC LIMIT :pfirst, :pper");
38 38
         $stmt6->bindParam(":search", $search);
39 39
         $stmt6->bindParam(":pfirst", $page_first_result);
40 40
         $stmt6->bindParam(":pper", $results_per_page);
41 41
         $stmt6->execute(); 
42
-    } else if($_GET['filter'] == "pm") {
42
+    } else if ($_GET['filter'] == "pm") {
43 43
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nm' ORDER BY id DESC LIMIT :pfirst, :pper");
44 44
         $stmt6->bindParam(":search", $search);
45 45
         $stmt6->bindParam(":pfirst", $page_first_result);
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
     </tr>
69 69
     
70 70
     <?php
71
-        while($inbox = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
72
-            if($__video_h->video_exists($inbox['video_attribute'])) {
71
+        while ($inbox = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
72
+            if ($__video_h->video_exists($inbox['video_attribute'])) {
73 73
                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
74 74
                 $inbox['video_attr_exists'] = true;
75 75
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     ?> 
84 84
     <tr style="margin-top: 5px;" id="videoslist">
85 85
             <!--
86
-            <?php if($inbox['readed'] == "n") { ?>
86
+            <?php if ($inbox['readed'] == "n") { ?>
87 87
                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
88 88
                 NEW
89 89
                 </a>
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         <td class="video-manager-stats" style="background: none;padding-left: 8px;">
107 107
             <h3><?php echo htmlspecialchars($inbox['subject']); ?></h3>
108 108
             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
109
-            <?php if($inbox['video_attr_exists']) { ?>
109
+            <?php if ($inbox['video_attr_exists']) { ?>
110 110
                 <hr>
111 111
                 <ul>
112 112
                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['video']['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><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="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
Please login to merge, or discard this patch.
web/public/get/unfavorite.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
 
27 27
 $stmt = $__db->prepare("DELETE FROM favorite_video WHERE sender = :sender AND reciever = :reciever");
28 28
 $stmt->execute(array(
29
-  ':sender' => $_SESSION['siteusername'],
30
-  ':reciever' => $name,
29
+    ':sender' => $_SESSION['siteusername'],
30
+    ':reciever' => $name,
31 31
 ));
32 32
 
33 33
 header('Location: ' . $_SERVER['HTTP_REFERER']);
Please login to merge, or discard this patch.
web/public/get/favorite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 $stmt->bindParam(":reciever", $name);
20 20
 $stmt->execute();
21 21
 
22
-if($stmt->rowCount() == 1) { 
22
+if ($stmt->rowCount() == 1) { 
23 23
     $_SESSION['error']->message = "You have already favorited this video.";
24 24
     header('Location: ' . $_SERVER['HTTP_REFERER']);
25 25
     die();
Please login to merge, or discard this patch.
web/public/channel_feed.php 3 patches
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.
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>
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 									</div>
315 315
 								</div>
316 316
 							</div>
317
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
317
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
318 318
 							<div id="branded-page-body">
319 319
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_feed.php"); ?></div>
320 320
 							</div>
Please login to merge, or discard this patch.
web/public/view_playlist.php 3 patches
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@  discard block
 block discarded – undo
14 14
 <?php
15 15
     $_playlist = $__video_h->fetch_playlist_rid($_GET['v']);
16 16
 
17
-    if(!$__user_h->user_exists($_playlist['author']))
18
-        header("Location: /?userdoesntexist");    
17
+    if(!$__user_h->user_exists($_playlist['author'])) {
18
+            header("Location: /?userdoesntexist");
19
+    }
19 20
 
20 21
     $_user = $__user_h->fetch_user_username($_playlist['author']);
21 22
 
@@ -38,10 +39,11 @@  discard block
 block discarded – undo
38 39
     
39 40
         if (
40 41
               ctype_xdigit($colorCode) &&
41
-              (strlen($colorCode) == 6 || strlen($colorCode) == 3))
42
-                   return true;
43
-    
44
-        else return false;
42
+              (strlen($colorCode) == 6 || strlen($colorCode) == 3)) {
43
+                           return true;
44
+        } else {
45
+            return false;
46
+        }
45 47
     }
46 48
 
47 49
     $_user['subscribers'] = $__user_h->fetch_subs_count($_user['username']);
@@ -73,8 +75,9 @@  discard block
 block discarded – undo
73 75
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
74 76
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
75 77
 
76
-	if(isset($_SESSION['siteusername']))
77
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
78
+	if(isset($_SESSION['siteusername'])) {
79
+	    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
80
+	}
78 81
 
79 82
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
80 83
         $error = array();
@@ -145,8 +148,9 @@  discard block
 block discarded – undo
145 148
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
146 149
 				<?php } ?>
147 150
 				<?php
148
-					if(empty(trim($_user['bio'])))
149
-						$_user['bio'] = "This user has no description.";
151
+					if(empty(trim($_user['bio']))) {
152
+											$_user['bio'] = "This user has no description.";
153
+					}
150 154
 				?>
151 155
 				<div id="content">
152 156
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
Please login to merge, or discard this patch.
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -25,21 +25,21 @@  discard block
 block discarded – undo
25 25
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
26 26
     }
27 27
 
28
-	function addhttp($url) {
29
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
30
-			$url = "http://" . $url;
31
-		}
32
-		return $url;
33
-	}
28
+    function addhttp($url) {
29
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
30
+            $url = "http://" . $url;
31
+        }
32
+        return $url;
33
+    }
34 34
 
35 35
     function check_valid_colorhex($colorCode) {
36 36
         // If user accidentally passed along the # sign, strip it off
37 37
         $colorCode = ltrim($colorCode, '#');
38 38
     
39 39
         if (
40
-              ctype_xdigit($colorCode) &&
40
+                ctype_xdigit($colorCode) &&
41 41
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
42
-                   return true;
42
+                    return true;
43 43
     
44 44
         else return false;
45 45
     }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7);
65 65
 
66 66
     $_user['genre'] = strtolower($_user['genre']);
67
-	$_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
67
+    $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
68 68
 
69 69
     if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
70 70
     if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
74 74
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
75 75
 
76
-	if(isset($_SESSION['siteusername']))
77
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
76
+    if(isset($_SESSION['siteusername']))
77
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
78 78
 
79 79
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
80 80
         $error = array();
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
89 89
 
90 90
         if(!isset($error['message'])) {
91
-			$text = $_POST['comment'];
91
+            $text = $_POST['comment'];
92 92
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
93
-			$stmt->bindParam(":id", $_user['username']);
94
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
95
-			$stmt->bindParam(":comment", $text);
93
+            $stmt->bindParam(":id", $_user['username']);
94
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
95
+            $stmt->bindParam(":comment", $text);
96 96
             $stmt->execute();
97 97
 
98 98
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
     }
105 105
 ?>
106 106
 <?php
107
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_playlist['title']);
108
-	$__server->page_embeds->page_description = htmlspecialchars($_playlist['description']);
109
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
110
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
107
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_playlist['title']);
108
+    $__server->page_embeds->page_description = htmlspecialchars($_playlist['description']);
109
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
110
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
111 111
 ?>	
112 112
 <!DOCTYPE html>
113 113
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -135,27 +135,27 @@  discard block
 block discarded – undo
135 135
 				background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>);
136 136
 				background-repeat: repeat;
137 137
 				<?php
138
-					switch($_user['2012_bgoption']) {
139
-						case "stretch":
140
-						echo "background-size: cover;";
141
-						break;
142
-						case "solid":
143
-						echo "";
144
-						break;
145
-						case "norepeat":
146
-						echo "background-repeat: no-repeat !important;";
147
-						break;
148
-						case "repeatxy":
149
-						echo "background-repeat: repeat;";
150
-						break;
151
-						case "repeaty":
152
-						echo "background-repeat: repeat-y;";
153
-						break;
154
-						case "repeatx":
155
-						echo "background-repeat: repeat-x;";
156
-						break;
157
-					}
158
-				?>
138
+                    switch($_user['2012_bgoption']) {
139
+                        case "stretch":
140
+                        echo "background-size: cover;";
141
+                        break;
142
+                        case "solid":
143
+                        echo "";
144
+                        break;
145
+                        case "norepeat":
146
+                        echo "background-repeat: no-repeat !important;";
147
+                        break;
148
+                        case "repeatxy":
149
+                        echo "background-repeat: repeat;";
150
+                        break;
151
+                        case "repeaty":
152
+                        echo "background-repeat: repeat-y;";
153
+                        break;
154
+                        case "repeatx":
155
+                        echo "background-repeat: repeat-x;";
156
+                        break;
157
+                    }
158
+                ?>
159 159
 			}
160 160
    		</style>
161 161
 	</head>
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
173 173
 				<?php } ?>
174 174
 				<?php
175
-					if(empty(trim($_user['bio'])))
176
-						$_user['bio'] = "This user has no description.";
177
-				?>
175
+                    if(empty(trim($_user['bio'])))
176
+                        $_user['bio'] = "This user has no description.";
177
+                ?>
178 178
 				<div id="content">
179 179
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
180 180
 						<div class="content" id="recommended-channels-list"></div>
@@ -306,20 +306,20 @@  discard block
 block discarded – undo
306 306
                                                         </div>
307 307
                                                         <ol>
308 308
 															<?php
309
-																$_playlist['videos'] = json_decode($_playlist['videos']);
310
-																$_playlist['count'] = 1;
311
-																foreach($_playlist['videos'] as $video) {
312
-																	if($__video_h->video_exists($video)) {
313
-																		$_video = $__video_h->fetch_video_rid($video);
314
-																		$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
315
-																		$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
316
-																		$_video['duration'] = $__time_h->timestamp($_video['duration']);
317
-																		$_video['views'] = $__video_h->fetch_video_views($_video['rid']);
318
-																		$_video['author'] = htmlspecialchars($_video['author']);		
319
-																		$_video['title'] = htmlspecialchars($_video['title']);
320
-																		$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
321
-																		$_playlist['title'] = htmlspecialchars($_playlist['title']);
322
-																	?>
309
+                                                                $_playlist['videos'] = json_decode($_playlist['videos']);
310
+                                                                $_playlist['count'] = 1;
311
+                                                                foreach($_playlist['videos'] as $video) {
312
+                                                                    if($__video_h->video_exists($video)) {
313
+                                                                        $_video = $__video_h->fetch_video_rid($video);
314
+                                                                        $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
315
+                                                                        $_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
316
+                                                                        $_video['duration'] = $__time_h->timestamp($_video['duration']);
317
+                                                                        $_video['views'] = $__video_h->fetch_video_views($_video['rid']);
318
+                                                                        $_video['author'] = htmlspecialchars($_video['author']);		
319
+                                                                        $_video['title'] = htmlspecialchars($_video['title']);
320
+                                                                        $_video['description'] = $__video_h->shorten_description($_video['description'], 50);
321
+                                                                        $_playlist['title'] = htmlspecialchars($_playlist['title']);
322
+                                                                    ?>
323 323
 																	<li class="playlist-video-item
324 324
 																		odd
325 325
 																		"> 
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 													<h2>Featured Channels</h2>
478 478
 													<ul class="channel-summary-list ">
479 479
 														<?php 
480
-															foreach($_user['featured_channels'] as $user) {
481
-																if($__user_h->user_exists($user)) {
482
-														?>
480
+                                                            foreach($_user['featured_channels'] as $user) {
481
+                                                                if($__user_h->user_exists($user)) {
482
+                                                        ?>
483 483
 															<li class="yt-tile-visible yt-uix-tile">
484 484
 																<div class="channel-summary clearfix channel-summary-compact">
485 485
 																	<div class="channel-summary-thumb">
@@ -503,19 +503,19 @@  discard block
 block discarded – undo
503 503
 											</div>
504 504
 
505 505
 											<?php 
506
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
507
-												$stmt->bindParam(":search", $_user['username']);
508
-												$stmt->execute();
506
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
507
+                                                $stmt->bindParam(":search", $_user['username']);
508
+                                                $stmt->execute();
509 509
 
510
-												if($stmt->rowCount() != 0) {
511
-											?>
510
+                                                if($stmt->rowCount() != 0) {
511
+                                            ?>
512 512
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
513 513
 													<div class="module-view gh-featured">
514 514
 														<h2>Featured Playlists</h2>     
515 515
 														<?php
516
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
517
-															$playlist['videos'] = json_decode($playlist['videos']);
518
-														?> 
516
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
517
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
518
+                                                        ?> 
519 519
 															<div class="playlist yt-tile-visible yt-uix-tile">
520 520
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
521 521
 																<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   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 <?php
15 15
     $_playlist = $__video_h->fetch_playlist_rid($_GET['v']);
16 16
 
17
-    if(!$__user_h->user_exists($_playlist['author']))
17
+    if (!$__user_h->user_exists($_playlist['author']))
18 18
         header("Location: /?userdoesntexist");    
19 19
 
20 20
     $_user = $__user_h->fetch_user_username($_playlist['author']);
@@ -66,28 +66,28 @@  discard block
 block discarded – undo
66 66
     $_user['genre'] = strtolower($_user['genre']);
67 67
 	$_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
68 68
 
69
-    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
70
-    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
71
-    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
72
-    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
73
-    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
74
-    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
69
+    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
70
+    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
71
+    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
72
+    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
73
+    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
74
+    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
75 75
 
76
-	if(isset($_SESSION['siteusername']))
76
+	if (isset($_SESSION['siteusername']))
77 77
     	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
78 78
 
79
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
79
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
80 80
         $error = array();
81 81
 
82
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
83
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
84
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
82
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
83
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
84
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
85 85
         //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; }
86 86
         //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; }
87
-        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; }
87
+        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; }
88 88
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
89 89
 
90
-        if(!isset($error['message'])) {
90
+        if (!isset($error['message'])) {
91 91
 			$text = $_POST['comment'];
92 92
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
93 93
 			$stmt->bindParam(":id", $_user['username']);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
99 99
 
100
-            if(@$_SESSION['siteusername'] != $_user['username']) { 
100
+            if (@$_SESSION['siteusername'] != $_user['username']) { 
101 101
                 $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']);
102 102
             }
103 103
         }
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 		<link rel="stylesheet" href="/yt/cssbin/www-extra.css">
132 132
 		<style>
133 133
 			#content-container {
134
-				background-color: <?php echo $_user['primary_color'];  ?>;
134
+				background-color: <?php echo $_user['primary_color']; ?>;
135 135
 				background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>);
136 136
 				background-repeat: repeat;
137 137
 				<?php
138
-					switch($_user['2012_bgoption']) {
138
+					switch ($_user['2012_bgoption']) {
139 139
 						case "stretch":
140 140
 						echo "background-size: cover;";
141 141
 						break;
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
 			<div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div>
169 169
 			<div id="content-container">
170 170
 				<!-- begin content -->
171
-				<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
171
+				<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
172 172
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
173 173
 				<?php } ?>
174 174
 				<?php
175
-					if(empty(trim($_user['bio'])))
175
+					if (empty(trim($_user['bio'])))
176 176
 						$_user['bio'] = "This user has no description.";
177 177
 				?>
178 178
 				<div id="content">
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 												</div>
233 233
 											</div>
234 234
 											<div class="upper-left-section enable-fancy-subscribe-button">
235
-												<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
235
+												<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
236 236
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
237 237
 														<button 
238 238
 															href="#" 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 															title="" 
241 241
 															id="subscribe-button"
242 242
 															type="button" 
243
-															class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
243
+															class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
244 244
 															role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" 
245 245
 															src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
246 246
 														<span class="subscribed-label">Subscribed</span>
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 									</div>
275 275
 								</div>
276 276
 							</div>
277
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
277
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
278 278
 							<div id="branded-page-body">
279 279
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template">
280 280
 									<div class="tab-content-body">
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
 															<?php
309 309
 																$_playlist['videos'] = json_decode($_playlist['videos']);
310 310
 																$_playlist['count'] = 1;
311
-																foreach($_playlist['videos'] as $video) {
312
-																	if($__video_h->video_exists($video)) {
311
+																foreach ($_playlist['videos'] as $video) {
312
+																	if ($__video_h->video_exists($video)) {
313 313
 																		$_video = $__video_h->fetch_video_rid($video);
314 314
 																		$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
315 315
 																		$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 																	</li>
358 358
 																	<?php $_playlist['count']++; ?>
359 359
 															<?php } } ?>
360
-															<?php if(count($_playlist['videos']) == 0) { ?>
360
+															<?php if (count($_playlist['videos']) == 0) { ?>
361 361
 																<h4>This playlist has no videos yet.</h4>
362 362
 															<?php } ?>
363 363
                                                         </ol>
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 														</div>
412 412
 														<hr class="yt-horizontal-rule ">
413 413
 													</div>
414
-													<?php if(!empty($_user['website'])) { ?>
414
+													<?php if (!empty($_user['website'])) { ?>
415 415
 														<div class="user-profile-item">
416 416
 															<div class="yt-c3-profile-custom-url field-container ">
417 417
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 															<h5>Country</h5>
461 461
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
462 462
 														</div>
463
-														<?php if($_user['genre'] != "none") { ?>
463
+														<?php if ($_user['genre'] != "none") { ?>
464 464
 															<div class="user-profile-item ">
465 465
 																<h5>Channel Genre</h5>
466 466
 																<span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span>
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
 											</div>
473 473
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
474 474
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
475
-												<?php if(count($_user['featured_channels']) != 0) { ?>
475
+												<?php if (count($_user['featured_channels']) != 0) { ?>
476 476
 												<div class="module-view other-channels-view">
477 477
 													<h2>Featured Channels</h2>
478 478
 													<ul class="channel-summary-list ">
479 479
 														<?php 
480
-															foreach($_user['featured_channels'] as $user) {
481
-																if($__user_h->user_exists($user)) {
480
+															foreach ($_user['featured_channels'] as $user) {
481
+																if ($__user_h->user_exists($user)) {
482 482
 														?>
483 483
 															<li class="yt-tile-visible yt-uix-tile">
484 484
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -507,13 +507,13 @@  discard block
 block discarded – undo
507 507
 												$stmt->bindParam(":search", $_user['username']);
508 508
 												$stmt->execute();
509 509
 
510
-												if($stmt->rowCount() != 0) {
510
+												if ($stmt->rowCount() != 0) {
511 511
 											?>
512 512
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
513 513
 													<div class="module-view gh-featured">
514 514
 														<h2>Featured Playlists</h2>     
515 515
 														<?php
516
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
516
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
517 517
 															$playlist['videos'] = json_decode($playlist['videos']);
518 518
 														?> 
519 519
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.
web/public/template.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	$__server->page_embeds->page_title = "SubRocks - Replace me";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
11
+    $__server->page_embeds->page_title = "SubRocks - Replace me";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16 16
 <!DOCTYPE html>
17 17
 <html>
Please login to merge, or discard this patch.
web/public/get/add_to_playlist.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
12 12
 $playlist = $__video_h->fetch_playlist_rid($_GET['playlist']);
13 13
 
14
-if($playlist['author'] == $_SESSION['siteusername']) {
14
+if ($playlist['author'] == $_SESSION['siteusername']) {
15 15
     $b = json_decode($playlist['videos']);
16 16
     array_push($b, $_GET['id']);
17 17
     $b = json_encode($b);
Please login to merge, or discard this patch.
web/public/all_comments.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 <?php $__user_h = new user_helper($__db); ?>
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
10
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
11 11
 <?php
12 12
     $_video = $__video_h->fetch_video_rid($_GET['v']);
13 13
     $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
@@ -80,19 +80,19 @@  discard block
 block discarded – undo
80 80
                                 </h4>
81 81
                             </div>
82 82
                         </div>
83
-                        <?php if(!isset($_SESSION['siteusername'])) { ?>
83
+                        <?php if (!isset($_SESSION['siteusername'])) { ?>
84 84
                             <div class="comments-post-container clearfix">
85 85
                                 <div class="comments-post-alert">
86 86
                                     <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>
87 87
                                 </div>
88 88
                             </div>
89
-                        <?php } else if($_video['commenting'] == "d") { ?>
89
+                        <?php } else if ($_video['commenting'] == "d") { ?>
90 90
                             <div class="comments-post-container clearfix">
91 91
                                 <div class="comments-post-alert">
92 92
                                     This video has comemnting disabled!
93 93
                                 </div>
94 94
                             </div>
95
-                        <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
95
+                        <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
96 96
                             <div class="comments-post-container clearfix">
97 97
                                 <div class="comments-post-alert">
98 98
                                     This user has blocked you!
@@ -139,15 +139,15 @@  discard block
 block discarded – undo
139 139
                                 $stmt->execute();
140 140
 
141 141
                                 $number_of_result = $stmt->rowCount();
142
-                                $number_of_page = ceil ($number_of_result / $results_per_page);  
142
+                                $number_of_page = ceil($number_of_result/$results_per_page);  
143 143
 
144
-                                if (!isset ($_GET['page']) ) {  
144
+                                if (!isset ($_GET['page'])) {  
145 145
                                     $page = 1;  
146 146
                                 } else {  
147
-                                    $page = (int)$_GET['page'];  
147
+                                    $page = (int) $_GET['page'];  
148 148
                                 }  
149 149
 
150
-                                $page_first_result = ($page - 1) * $results_per_page;  
150
+                                $page_first_result = ($page - 1)*$results_per_page;  
151 151
 
152 152
                                 $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
153 153
                                 $stmt->bindParam(":rid", $_video['rid']);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                                 $stmt->bindParam(":pper", $results_per_page);
156 156
                                 $stmt->execute();
157 157
 
158
-                                while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
158
+                                while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
159 159
                             ?>
160 160
 
161 161
                             <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -11,23 +11,23 @@
 block discarded – undo
11 11
 <?php
12 12
     $_video = $__video_h->fetch_video_rid($_GET['v']);
13 13
     $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
14
-	$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
15
-	$_video['duration'] = $__time_h->timestamp($_video['duration']);
16
-	$_video['views'] = $__video_h->fetch_video_views($_video['rid']);
17
-	$_video['author'] = htmlspecialchars($_video['author']);		
18
-	$_video['title'] = htmlspecialchars($_video['title']);
19
-	$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
14
+    $_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
15
+    $_video['duration'] = $__time_h->timestamp($_video['duration']);
16
+    $_video['views'] = $__video_h->fetch_video_views($_video['rid']);
17
+    $_video['author'] = htmlspecialchars($_video['author']);		
18
+    $_video['title'] = htmlspecialchars($_video['title']);
19
+    $_video['description'] = $__video_h->shorten_description($_video['description'], 50);
20 20
 
21
-	$__server->page_embeds->page_title = "SubRocks - All Comments";
22
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
23
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
24
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
21
+    $__server->page_embeds->page_title = "SubRocks - All Comments";
22
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
23
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
24
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
25 25
 ?>
26 26
 <?php
27
-	$__server->page_embeds->page_title = "SubRocks - All Comments";
28
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
29
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
30
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
27
+    $__server->page_embeds->page_title = "SubRocks - All Comments";
28
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
29
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
30
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
31 31
 ?>
32 32
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
33 33
 <!DOCTYPE html>
Please login to merge, or discard this patch.