Test Failed
Push — main ( b09f12...0abb31 )
by chief
05:29
created
web/public/watch.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/channel_feed.php 3 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  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 20
         header("Location: /?userdoesntexist");
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
28 28
     }
29 29
 
30
-	function addhttp($url) {
31
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
32
-			$url = "http://" . $url;
33
-		}
34
-		return $url;
35
-	}
30
+    function addhttp($url) {
31
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
32
+            $url = "http://" . $url;
33
+        }
34
+        return $url;
35
+    }
36 36
 
37 37
     function check_valid_colorhex($colorCode) {
38 38
         // If user accidentally passed along the # sign, strip it off
39 39
         $colorCode = ltrim($colorCode, '#');
40 40
     
41 41
         if (
42
-              ctype_xdigit($colorCode) &&
42
+                ctype_xdigit($colorCode) &&
43 43
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
44
-                   return true;
44
+                    return true;
45 45
     
46 46
         else return false;
47 47
     }
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
77 77
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
78 78
 
79
-	if(isset($_SESSION['siteusername']))
80
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
79
+    if(isset($_SESSION['siteusername']))
80
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
81 81
 
82 82
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
83 83
         $error = array();
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
92 92
 
93 93
         if(!isset($error['message'])) {
94
-			$text = $_POST['comment'];
94
+            $text = $_POST['comment'];
95 95
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
96
-			$stmt->bindParam(":id", $_user['username']);
97
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
98
-			$stmt->bindParam(":comment", $text);
96
+            $stmt->bindParam(":id", $_user['username']);
97
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
98
+            $stmt->bindParam(":comment", $text);
99 99
             $stmt->execute();
100 100
 
101 101
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             }
106 106
         }
107 107
     }
108
-	?>
108
+    ?>
109 109
 <!DOCTYPE html>
110 110
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
111 111
 	<!-- machid: sNW5tN3Z2SWdXaDRqNGxuNEF5MFBxM1BxWXd0VGo0Rkg3UXNTTTNCUGRDWjR0WGpHR3R1YzFR -->
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 					<div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
147 147
 				<?php } ?> 
148 148
 				<?php
149
-					if(empty(trim($_user['bio'])))
150
-						$_user['bio'] = "This user has no description.";
151
-				?>
149
+                    if(empty(trim($_user['bio'])))
150
+                        $_user['bio'] = "This user has no description.";
151
+                ?>
152 152
 				<div id="content">
153 153
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
154 154
 						<div class="content" id="recommended-channels-list"></div>
@@ -320,19 +320,19 @@  discard block
 block discarded – undo
320 320
 																	  ORDER BY 
321 321
 																		`date` DESC;");
322 322
                                                                         $stmt->bindParam(":comment_username", $_user['username']);
323
-																		$stmt->bindParam(":videos_username", $_user['username']);
323
+                                                                        $stmt->bindParam(":videos_username", $_user['username']);
324 324
                                                                         $stmt->execute();
325 325
                                                                         while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
326
-																			if((int)$content['id']) {
327
-																				$content = $__video_h->fetch_comment_id($content['id']);
328
-																				$content['video'] = $__video_h->fetch_video_rid($content['toid']);
329
-																				$content['type'] = "comment";
330
-																			} else {
331
-																				$content = $__video_h->fetch_video_rid($content['id']);
332
-																				$content['type'] = "video";
333
-																			}
326
+                                                                            if((int)$content['id']) {
327
+                                                                                $content = $__video_h->fetch_comment_id($content['id']);
328
+                                                                                $content['video'] = $__video_h->fetch_video_rid($content['toid']);
329
+                                                                                $content['type'] = "comment";
330
+                                                                            } else {
331
+                                                                                $content = $__video_h->fetch_video_rid($content['id']);
332
+                                                                                $content['type'] = "video";
333
+                                                                            }
334 334
 
335
-																			if($content['type'] == "video") {
335
+                                                                            if($content['type'] == "video") {
336 336
                                                                     ?>
337 337
                                                                     <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg">
338 338
                                                                         <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">
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                                                                         </div>
405 405
                                                                     </div>
406 406
                                                                     <?php } else { 
407
-																		if($__video_h->video_exists($content['video']['rid'])) { ?>
407
+                                                                        if($__video_h->video_exists($content['video']['rid'])) { ?>
408 408
 																	<div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw">
409 409
 																		<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">
410 410
 																		<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>
@@ -576,9 +576,9 @@  discard block
 block discarded – undo
576 576
 													<h2>Featured Channels</h2>
577 577
 													<ul class="channel-summary-list ">
578 578
 														<?php 
579
-															foreach($_user['featured_channels'] as $user) {
580
-																if($__user_h->user_exists($user)) {
581
-														?>
579
+                                                            foreach($_user['featured_channels'] as $user) {
580
+                                                                if($__user_h->user_exists($user)) {
581
+                                                        ?>
582 582
 															<li class="yt-tile-visible yt-uix-tile">
583 583
 																<div class="channel-summary clearfix channel-summary-compact">
584 584
 																	<div class="channel-summary-thumb">
@@ -602,19 +602,19 @@  discard block
 block discarded – undo
602 602
 											</div>
603 603
 
604 604
 											<?php 
605
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
606
-												$stmt->bindParam(":search", $_user['username']);
607
-												$stmt->execute();
605
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
606
+                                                $stmt->bindParam(":search", $_user['username']);
607
+                                                $stmt->execute();
608 608
 
609
-												if($stmt->rowCount() != 0) {
610
-											?>
609
+                                                if($stmt->rowCount() != 0) {
610
+                                            ?>
611 611
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
612 612
 													<div class="module-view gh-featured">
613 613
 														<h2>Featured Playlists</h2>     
614 614
 														<?php
615
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
616
-															$playlist['videos'] = json_decode($playlist['videos']);
617
-														?> 
615
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
616
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
617
+                                                        ?> 
618 618
 															<div class="playlist yt-tile-visible yt-uix-tile">
619 619
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
620 620
 																<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
@@ -13,10 +13,10 @@  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']))
16
+	if (isset($_SESSION['siteusername']))
17 17
 	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
18 18
 
19
-    if(!$__user_h->user_exists($_GET['n']))
19
+    if (!$__user_h->user_exists($_GET['n']))
20 20
         header("Location: /?userdoesntexist");
21 21
 
22 22
     $_user = $__user_h->fetch_user_username($_GET['n']);
@@ -69,28 +69,28 @@  discard block
 block discarded – undo
69 69
     $_user['genre'] = strtolower($_user['genre']);
70 70
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
71 71
 
72
-    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
73
-    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
74
-    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
75
-    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
76
-    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
77
-    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
72
+    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
73
+    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
74
+    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
75
+    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
76
+    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
77
+    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
78 78
 
79
-	if(isset($_SESSION['siteusername']))
79
+	if (isset($_SESSION['siteusername']))
80 80
     	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
81 81
 
82
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
82
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
83 83
         $error = array();
84 84
 
85
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
86
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
87
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
85
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
86
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
87
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
88 88
         //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; }
89 89
         //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; }
90
-        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; }
90
+        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; }
91 91
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
92 92
 
93
-        if(!isset($error['message'])) {
93
+        if (!isset($error['message'])) {
94 94
 			$text = $_POST['comment'];
95 95
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
96 96
 			$stmt->bindParam(":id", $_user['username']);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
102 102
 
103
-            if(@$_SESSION['siteusername'] != $_user['username']) { 
103
+            if (@$_SESSION['siteusername'] != $_user['username']) { 
104 104
                 $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']);
105 105
             }
106 106
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 		<link rel="stylesheet" href="/yt/cssbin/www-extra.css">
127 127
 		<style>
128 128
 			#content-container {
129
-				background-color: <?php echo $_user['primary_color'];  ?>;
129
+				background-color: <?php echo $_user['primary_color']; ?>;
130 130
 				background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>);
131 131
 				background-repeat: repeat;
132 132
 				background-position: center top;
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 			<div id="masthead-container"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div>
143 143
 			<div id="content-container">
144 144
 				<!-- begin content -->
145
-				<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
145
+				<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
146 146
 					<div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
147 147
 				<?php } ?> 
148 148
 				<?php
149
-					if(empty(trim($_user['bio'])))
149
+					if (empty(trim($_user['bio'])))
150 150
 						$_user['bio'] = "This user has no description.";
151 151
 				?>
152 152
 				<div id="content">
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 												<h1><?php echo htmlspecialchars($_user['username']); ?></h1>
202 202
 											</div>
203 203
 											<div class="upper-left-section enable-fancy-subscribe-button">
204
-												<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
204
+												<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
205 205
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
206 206
 														<button href="https://accounts.google.com/ServiceLogin?uilel=3&amp;service=youtube&amp;passive=true&amp;continue=http%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dsubscribe%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%252Fuser%252F<?php echo htmlspecialchars($_user['username']); ?>%253Ffeature%253Dg-logo-xit&amp;hl=en_US&amp;ltmpl=sso" onclick=";window.location.href=this.getAttribute('href');return false;" title="" type="button" class="yt-subscription-button subscription-button-with-recommended-channels   yt-uix-button yt-uix-button-subscription yt-uix-tooltip" data-enable-hovercard="true" data-subscription-value="UCIwFjwMjI0y7PDBVEO9-bkQ" data-force-position="" data-position="" data-subscription-feature="channels3" data-subscription-type="channel" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
207 207
 														<span class="subscribed-label">Subscribed</span>
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 									</div>
268 268
 								</div>
269 269
 							</div>
270
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
270
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
271 271
 							<div id="branded-page-body">
272 272
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template">
273 273
 									<div class="tab-content-body">
@@ -322,8 +322,8 @@  discard block
 block discarded – undo
322 322
                                                                         $stmt->bindParam(":comment_username", $_user['username']);
323 323
 																		$stmt->bindParam(":videos_username", $_user['username']);
324 324
                                                                         $stmt->execute();
325
-                                                                        while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
326
-																			if((int)$content['id']) {
325
+                                                                        while ($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
326
+																			if ((int) $content['id']) {
327 327
 																				$content = $__video_h->fetch_comment_id($content['id']);
328 328
 																				$content['video'] = $__video_h->fetch_video_rid($content['toid']);
329 329
 																				$content['type'] = "comment";
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 																				$content['type'] = "video";
333 333
 																			}
334 334
 
335
-																			if($content['type'] == "video") {
335
+																			if ($content['type'] == "video") {
336 336
                                                                     ?>
337 337
                                                                     <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg">
338 338
                                                                         <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">
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                                                                         </div>
405 405
                                                                     </div>
406 406
                                                                     <?php } else { 
407
-																		if($__video_h->video_exists($content['video']['rid'])) { ?>
407
+																		if ($__video_h->video_exists($content['video']['rid'])) { ?>
408 408
 																	<div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw">
409 409
 																		<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">
410 410
 																		<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>
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 														</div>
511 511
 														<hr class="yt-horizontal-rule ">
512 512
 													</div>
513
-													<?php if(!empty($_user['website'])) { ?>
513
+													<?php if (!empty($_user['website'])) { ?>
514 514
 														<div class="user-profile-item">
515 515
 															<div class="yt-c3-profile-custom-url field-container ">
516 516
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 															<h5>Country</h5>
560 560
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
561 561
 														</div>
562
-														<?php if($_user['genre'] != "none") { ?>
562
+														<?php if ($_user['genre'] != "none") { ?>
563 563
 															<div class="user-profile-item ">
564 564
 																<h5>Channel Genre</h5>
565 565
 																<span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span>
@@ -571,13 +571,13 @@  discard block
 block discarded – undo
571 571
 											</div>
572 572
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
573 573
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
574
-												<?php if(count($_user['featured_channels']) != 0) { ?>
574
+												<?php if (count($_user['featured_channels']) != 0) { ?>
575 575
 												<div class="module-view other-channels-view">
576 576
 													<h2>Featured Channels</h2>
577 577
 													<ul class="channel-summary-list ">
578 578
 														<?php 
579
-															foreach($_user['featured_channels'] as $user) {
580
-																if($__user_h->user_exists($user)) {
579
+															foreach ($_user['featured_channels'] as $user) {
580
+																if ($__user_h->user_exists($user)) {
581 581
 														?>
582 582
 															<li class="yt-tile-visible yt-uix-tile">
583 583
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -606,13 +606,13 @@  discard block
 block discarded – undo
606 606
 												$stmt->bindParam(":search", $_user['username']);
607 607
 												$stmt->execute();
608 608
 
609
-												if($stmt->rowCount() != 0) {
609
+												if ($stmt->rowCount() != 0) {
610 610
 											?>
611 611
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
612 612
 													<div class="module-view gh-featured">
613 613
 														<h2>Featured Playlists</h2>     
614 614
 														<?php
615
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
615
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
616 616
 															$playlist['videos'] = json_decode($playlist['videos']);
617 617
 														?> 
618 618
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,11 +13,13 @@  discard block
 block discarded – undo
13 13
 <?php $__db_h = new db_helper(); ?>
14 14
 <?php $__time_h = new time_helper(); ?>
15 15
 <?php
16
-	if(isset($_SESSION['siteusername']))
17
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
16
+	if(isset($_SESSION['siteusername'])) {
17
+		    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
18
+	}
18 19
 
19
-    if(!$__user_h->user_exists($_GET['n']))
20
-        header("Location: /?userdoesntexist");
20
+    if(!$__user_h->user_exists($_GET['n'])) {
21
+            header("Location: /?userdoesntexist");
22
+    }
21 23
 
22 24
     $_user = $__user_h->fetch_user_username($_GET['n']);
23 25
 
@@ -40,10 +42,11 @@  discard block
 block discarded – undo
40 42
     
41 43
         if (
42 44
               ctype_xdigit($colorCode) &&
43
-              (strlen($colorCode) == 6 || strlen($colorCode) == 3))
44
-                   return true;
45
-    
46
-        else return false;
45
+              (strlen($colorCode) == 6 || strlen($colorCode) == 3)) {
46
+                           return true;
47
+        } else {
48
+            return false;
49
+        }
47 50
     }
48 51
 
49 52
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
@@ -76,8 +79,9 @@  discard block
 block discarded – undo
76 79
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
77 80
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
78 81
 
79
-	if(isset($_SESSION['siteusername']))
80
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
82
+	if(isset($_SESSION['siteusername'])) {
83
+	    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
84
+	}
81 85
 
82 86
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
83 87
         $error = array();
@@ -146,8 +150,9 @@  discard block
 block discarded – undo
146 150
 					<div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
147 151
 				<?php } ?> 
148 152
 				<?php
149
-					if(empty(trim($_user['bio'])))
150
-						$_user['bio'] = "This user has no description.";
153
+					if(empty(trim($_user['bio']))) {
154
+											$_user['bio'] = "This user has no description.";
155
+					}
151 156
 				?>
152 157
 				<div id="content">
153 158
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
Please login to merge, or discard this patch.
web/public/d/channel_update.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
18 18
     }
19 19
 
20
-        if(isset($_POST['layout'])) { 
20
+        if (isset($_POST['layout'])) { 
21 21
             $stmt = $__db->prepare("UPDATE users SET layout = :layout WHERE username = :username");
22 22
             $stmt->bindParam(":layout", $_POST['layout']);
23 23
             $stmt->bindParam(":username", $_SESSION['siteusername']);
24 24
             $stmt->execute();
25 25
         }
26 26
 
27
-        if(isset($_POST['left'])) {
27
+        if (isset($_POST['left'])) {
28 28
             $clean = $_POST['left'];
29 29
             $stmt = $__db->prepare("UPDATE users SET 2009_user_left = :clean WHERE username = :username");
30 30
             $stmt->bindParam(":clean", $clean);
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             $stmt->execute();
33 33
         }
34 34
 
35
-        if(isset($_POST['right'])) {
35
+        if (isset($_POST['right'])) {
36 36
             $clean = $_POST['right'];
37 37
             $stmt = $__db->prepare("UPDATE users SET 2009_user_right = :clean WHERE username = :username");
38 38
             $stmt->bindParam(":clean", $clean);
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
         }
42 42
 
43 43
 
44
-        if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['pfpset']) {
45
-            if(!empty($_FILES["pfpset"]["name"])) {
44
+        if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['pfpset']) {
45
+            if (!empty($_FILES["pfpset"]["name"])) {
46 46
                 $target_dir = "dynamic/pfp/";
47 47
                 $imageFileType = strtolower(pathinfo($_FILES["pfpset"]["name"], PATHINFO_EXTENSION));
48 48
                 $target_name = md5_file($_FILES["pfpset"]["tmp_name"]) . "." . $imageFileType;
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
                 $uploadOk = true;
53 53
                 $movedFile = false;
54 54
         
55
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
56
-                    && $imageFileType != "gif" ) {
55
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
56
+                    && $imageFileType != "gif") {
57 57
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
58 58
                     $uploadOk = false;
59 59
                     goto skip;
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
                     }
77 77
                 }
78 78
             }
79
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['backgroundbgset']) {
80
-            if(!empty($_FILES["backgroundbgset"]["name"])) {
79
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['backgroundbgset']) {
80
+            if (!empty($_FILES["backgroundbgset"]["name"])) {
81 81
                 $target_dir = "dynamic/banners/";
82 82
                 $imageFileType = strtolower(pathinfo($_FILES["backgroundbgset"]["name"], PATHINFO_EXTENSION));
83 83
                 $target_name = md5_file($_FILES["backgroundbgset"]["tmp_name"]) . "." . $imageFileType;
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
                 $uploadOk = true;
88 88
                 $movedFile = false;
89 89
     
90
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
91
-                    && $imageFileType != "gif" ) {
90
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
91
+                    && $imageFileType != "gif") {
92 92
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
93 93
                     $uploadOk = false;
94 94
                     goto skip;
95 95
                 }
96 96
     
97
-                if($uploadOk) { 
97
+                if ($uploadOk) { 
98 98
                     if (file_exists($target_file)) {
99 99
                         $movedFile = true;
100 100
                     } else {
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
                     }
111 111
                 }
112 112
             }
113
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['bannerset']) {
114
-            if(!empty($_FILES["file"]["name"])) {
113
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['bannerset']) {
114
+            if (!empty($_FILES["file"]["name"])) {
115 115
                 $target_dir = "dynamic/banners/";
116 116
                 $imageFileType = strtolower(pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION));
117 117
                 $target_name = md5_file($_FILES["file"]["tmp_name"]) . "." . $imageFileType;
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
                 $uploadOk = true;
122 122
                 $movedFile = false;
123 123
     
124
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
125
-                    && $imageFileType != "gif" ) {
124
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
125
+                    && $imageFileType != "gif") {
126 126
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
127 127
                     $uploadOk = false;
128 128
                     goto skip;
129 129
                 }
130 130
     
131
-                if($uploadOk) { 
131
+                if ($uploadOk) { 
132 132
                     if (file_exists($target_file)) {
133 133
                         $movedFile = true;
134 134
                     } else {
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
                     }
145 145
                 } 
146 146
             }
147
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['videopagebanner']) {
148
-            if(!empty($_FILES["videopagebanner"]["name"])) {
147
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['videopagebanner']) {
148
+            if (!empty($_FILES["videopagebanner"]["name"])) {
149 149
                 $target_dir = "dynamic/subscribe/";
150 150
                 $imageFileType = strtolower(pathinfo($_FILES["videopagebanner"]["name"], PATHINFO_EXTENSION));
151 151
                 $target_name = md5_file($_FILES["videopagebanner"]["tmp_name"]) . "." . $imageFileType;
@@ -155,14 +155,14 @@  discard block
 block discarded – undo
155 155
                 $uploadOk = true;
156 156
                 $movedFile = false;
157 157
     
158
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
159
-                    && $imageFileType != "gif" ) {
158
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
159
+                    && $imageFileType != "gif") {
160 160
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
161 161
                     $uploadOk = false;
162 162
                     goto skip;
163 163
                 }
164 164
     
165
-                if($uploadOk) { 
165
+                if ($uploadOk) { 
166 166
                     if (file_exists($target_file)) {
167 167
                         $movedFile = true;
168 168
                     } else {
@@ -180,71 +180,71 @@  discard block
 block discarded – undo
180 180
             }
181 181
         }
182 182
 
183
-        if(!empty($_POST['bio'])) { 
183
+        if (!empty($_POST['bio'])) { 
184 184
             $__user_u->update_row($_SESSION['siteusername'], "bio", $_POST['bio']);
185 185
         }
186 186
 
187
-        if(!empty($_POST['featuredchannels'])) { 
187
+        if (!empty($_POST['featuredchannels'])) { 
188 188
             $__user_u->update_row($_SESSION['siteusername'], "featured_channels", $_POST['featuredchannels']);
189 189
         }
190 190
     
191
-        if(!empty($_POST['css'])) {
191
+        if (!empty($_POST['css'])) {
192 192
             $__user_u->update_row($_SESSION['siteusername'], "css", $_POST['css']);
193 193
         }
194 194
 
195
-        if(!empty($_POST['videoid'])) {
195
+        if (!empty($_POST['videoid'])) {
196 196
             $__user_u->update_row($_SESSION['siteusername'], "featured", $_POST['videoid']);
197 197
         }
198 198
 
199
-        if(!empty($_POST['solidcolor'])) {
199
+        if (!empty($_POST['solidcolor'])) {
200 200
             $__user_u->update_row($_SESSION['siteusername'], "primary_color", $_POST['solidcolor']);
201 201
         }
202 202
 
203
-        if(!empty($_POST['transparency'])) {
203
+        if (!empty($_POST['transparency'])) {
204 204
             $__user_u->update_row($_SESSION['siteusername'], "transparency", $_POST['transparency']);
205 205
         }
206 206
 
207
-        if(!empty($_POST['genre'])) {
207
+        if (!empty($_POST['genre'])) {
208 208
             $__user_u->update_row($_SESSION['siteusername'], "genre", $_POST['genre']);
209 209
         }
210 210
 
211
-        if(!empty($_POST['bordercolor'])) {
211
+        if (!empty($_POST['bordercolor'])) {
212 212
             $__user_u->update_row($_SESSION['siteusername'], "border_color", $_POST['bordercolor']);
213 213
         }
214 214
 
215
-        if(!empty($_POST['country'])) {
215
+        if (!empty($_POST['country'])) {
216 216
             $__user_u->update_row($_SESSION['siteusername'], "country", $_POST['country']);
217 217
         } // duplicate?
218 218
 
219
-        if(!empty($_POST['header'])) {
219
+        if (!empty($_POST['header'])) {
220 220
             $__user_u->update_row($_SESSION['siteusername'], "custom_header", $_POST['header']);
221 221
         }
222 222
 
223
-        if(!empty($_POST['customtext'])) {
223
+        if (!empty($_POST['customtext'])) {
224 224
             $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['customtext']);
225 225
         }
226 226
 
227
-        if(!empty($_POST['country'])) {
227
+        if (!empty($_POST['country'])) {
228 228
             $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['country']);
229 229
         } // duplicate?
230 230
 
231
-        if(!empty($_POST['website'])) {
231
+        if (!empty($_POST['website'])) {
232 232
             $__user_u->update_row($_SESSION['siteusername'], "website", $_POST['website']);
233 233
         }
234 234
     
235
-        if(!empty($_POST['channelboxcolor'])) {
235
+        if (!empty($_POST['channelboxcolor'])) {
236 236
             $__user_u->update_row($_SESSION['siteusername'], "secondary_color", $_POST['channelboxcolor']);
237 237
         }
238 238
 
239
-        if(!empty($_POST['backgroundcolor'])) {
239
+        if (!empty($_POST['backgroundcolor'])) {
240 240
             $__user_u->update_row($_SESSION['siteusername'], "third_color", $_POST['backgroundcolor']);
241 241
         }
242 242
 
243
-        if(!empty($_POST['textmaincolor'])) {
243
+        if (!empty($_POST['textmaincolor'])) {
244 244
             $__user_u->update_row($_SESSION['siteusername'], "primary_color_text", $_POST['textmaincolor']);
245 245
         }
246 246
 
247
-    if(!empty($_POST['bgoptionset'])) {
247
+    if (!empty($_POST['bgoptionset'])) {
248 248
         $bgoption = $_POST['bgoption'];
249 249
         $bgcolor = $_POST['solidcolor'];
250 250
         $default = "default.png";
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         
254 254
         $__user_u->update_row($_SESSION['siteusername'], "2009_bgcolor", $bgcolor);
255 255
 
256
-        if($bgoption == "solid") {
256
+        if ($bgoption == "solid") {
257 257
             $__user_u->update_row($_SESSION['siteusername'], "2009_bg", $default);
258 258
         }
259 259
     }
Please login to merge, or discard this patch.
web/public/s/classes/video_helper.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@
 block discarded – undo
43 43
         return true;
44 44
     }
45 45
 
46
-	public function __construct($conn){
46
+    public function __construct($conn){
47 47
         $this->__db = $conn;
48
-	}
48
+    }
49 49
 
50 50
     function fetch_video_views(string $id) {
51 51
         $stmt = $this->__db->prepare("SELECT * FROM views WHERE videoid = :id");
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function sh_exec(string $cmd, string $outputfile = "", string $pidfile = "", bool $mergestderror = true, bool $bg = false) {
14 14
         $fullcmd = $cmd;
15
-        if(strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile;
16
-        if($mergestderror) $fullcmd .= " 2>&1";
15
+        if (strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile;
16
+        if ($mergestderror) $fullcmd .= " 2>&1";
17 17
         
18
-        if($bg) {
18
+        if ($bg) {
19 19
             $fullcmd = "nohup " . $fullcmd . " &";
20
-            if(strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile;
20
+            if (strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile;
21 21
         } else {
22
-            if(strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile;
22
+            if (strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile;
23 23
         }
24 24
         shell_exec($fullcmd);
25 25
     }
@@ -29,21 +29,21 @@  discard block
 block discarded – undo
29 29
             $handle = fopen($file, "r");
30 30
             $i = 0;
31 31
             while (!feof($handle)) {
32
-                call_user_func_array($callback,array(fread($handle,$chunk_size),&$handle,$i));
32
+                call_user_func_array($callback, array(fread($handle, $chunk_size), &$handle, $i));
33 33
                 $i++;
34 34
             }
35 35
     
36 36
             fclose($handle);
37 37
         }
38
-        catch(Exception $e) {
39
-            trigger_error("file_get_contents_chunked::" . $e->getMessage(),E_USER_NOTICE);
38
+        catch (Exception $e) {
39
+            trigger_error("file_get_contents_chunked::" . $e->getMessage(), E_USER_NOTICE);
40 40
             return false;
41 41
         }
42 42
 
43 43
         return true;
44 44
     }
45 45
 
46
-	public function __construct($conn){
46
+	public function __construct($conn) {
47 47
         $this->__db = $conn;
48 48
 	}
49 49
 
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 
66 66
     function shorten_description(string $description, int $limit, bool $newlines = false) {
67 67
         $description = trim($description);
68
-        if(strlen($description) >= $limit) {
68
+        if (strlen($description) >= $limit) {
69 69
             $description = substr($description, 0, $limit) . "...";
70 70
         } 
71 71
 
72 72
         $description = htmlspecialchars($description);
73
-        if($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); }
73
+        if ($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); }
74 74
         return $description;
75 75
     }
76 76
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     function get_video_likes($reciever, $liked) {
86
-        if($liked) {
86
+        if ($liked) {
87 87
             $stmt = $this->__db->prepare("SELECT `sender` FROM likes WHERE reciever = :reciever AND type = 'l'");
88 88
             $stmt->bindParam(":reciever", $reciever);
89 89
             $stmt->execute();
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     }
100 100
 
101 101
     function if_liked($user, $reciever, $liked) {
102
-        if($liked) {
102
+        if ($liked) {
103 103
             $stmt = $this->__db->prepare("SELECT `sender` FROM likes WHERE sender = :sender AND reciever = :reciever AND type = 'l'");
104 104
             $stmt->bindParam(":sender", $user);
105 105
             $stmt->bindParam(":reciever", $reciever);
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,14 +12,22 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function sh_exec(string $cmd, string $outputfile = "", string $pidfile = "", bool $mergestderror = true, bool $bg = false) {
14 14
         $fullcmd = $cmd;
15
-        if(strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile;
16
-        if($mergestderror) $fullcmd .= " 2>&1";
15
+        if(strlen($outputfile) > 0) {
16
+            $fullcmd .= " >> " . $outputfile;
17
+        }
18
+        if($mergestderror) {
19
+            $fullcmd .= " 2>&1";
20
+        }
17 21
         
18 22
         if($bg) {
19 23
             $fullcmd = "nohup " . $fullcmd . " &";
20
-            if(strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile;
24
+            if(strlen($pidfile)) {
25
+                $fullcmd .= " echo $! > " . $pidfile;
26
+            }
21 27
         } else {
22
-            if(strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile;
28
+            if(strlen($pidfile) > 0) {
29
+                $fullcmd .= "; echo $$ > " . $pidfile;
30
+            }
23 31
         }
24 32
         shell_exec($fullcmd);
25 33
     }
@@ -34,8 +42,7 @@  discard block
 block discarded – undo
34 42
             }
35 43
     
36 44
             fclose($handle);
37
-        }
38
-        catch(Exception $e) {
45
+        } catch(Exception $e) {
39 46
             trigger_error("file_get_contents_chunked::" . $e->getMessage(),E_USER_NOTICE);
40 47
             return false;
41 48
         }
Please login to merge, or discard this patch.
web/public/s/mod/channel_customization.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                             <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>-->
212 212
                         </div><br><br>
213 213
                         <img src="/dynamic/pfp/<?php echo $_user['pfp']; ?>" style="width:100px;height:100px;"><br>
214
-                        <?php if($_user['pfp'] != "default.png") { ?>
214
+                        <?php if ($_user['pfp'] != "default.png") { ?>
215 215
                             <a href="/get/remove_profile_pic">Remove Profile Picture</a><br>
216 216
                         <?php } ?>
217 217
                         <br><hr class="thin-line-darker" style="width:unset;">
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
                             <input style="width: 169px;position: relative;top: 10px;" type="file" name="videopagebanner" id="avatar-upload">
221 221
                             <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>-->
222 222
                         </div><br>                   
223
-                        <?php if(!empty($_user['subbutton'])) { ?>
223
+                        <?php if (!empty($_user['subbutton'])) { ?>
224 224
                             <a href="/get/remove_watch_banner">Remove Watch Page Banner</a><br>
225 225
                         <?php } ?><br><hr class="thin-line-darker" style="width:unset;">
226 226
 
@@ -240,17 +240,17 @@  discard block
 block discarded – undo
240 240
 
241 241
                         <b>Featured Video</b>
242 242
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
243
-                        <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']);?>" name="videoid">
243
+                        <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']); ?>" name="videoid">
244 244
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
245 245
 
246 246
                         <b>Featured Channels</b>
247 247
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
248
-                        <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']);?>" name="featuredchannels">
248
+                        <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']); ?>" name="featuredchannels">
249 249
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
250 250
 
251 251
                         <b>Website</b>
252 252
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -7px;">
253
-                        <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']);?>" name="website">
253
+                        <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']); ?>" name="website">
254 254
                             
255 255
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
256 256
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                         <span style="font-size: 11px;" class="grey-text">This will show what type of channel you are to other users.</span>
260 260
                         <div class="customization-module" id="channellayout" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -19px;">
261 261
                             <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"   name="genre">
262
-                                <?php foreach($categories as $category) { ?>
262
+                                <?php foreach ($categories as $category) { ?>
263 263
                                     <option value="<?php echo $category; ?>"><?php echo $category; ?></option>
264 264
                                 <?php } ?>
265 265
                             </select>
Please login to merge, or discard this patch.
web/public/s/mod/header.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 	<a id="logo-container" href="/" title="YouTube home">
6 6
 	<img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="YouTube home">
7 7
 	</a>
8
-	<?php if(!isset($_SESSION['siteusername'])) { ?>
8
+	<?php if (!isset($_SESSION['siteusername'])) { ?>
9 9
 	<div id="yt-masthead-signin">
10 10
 		<a style="color: white; text-decoration: none;" href="/sign_in">
11 11
 		<button type="button" class=" yt-uix-button yt-uix-button-primary yt-uix-button-size-default" href="/sign_up" role="button">
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 		<span id="yt-masthead-user-displayname" dir="ltr" class="yt-valign-container" onclick="yt.www.masthead.toggleExpandedMasthead();">
21 21
 		<?php echo htmlspecialchars($_SESSION['siteusername']); ?>
22 22
 		</span>
23
-		<?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
23
+		<?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
24 24
 		<a style="position:relative;top:1px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
25 25
 		<?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?> 
26 26
 		</a>
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 </div>
58 58
 </div>
59 59
 </div>
60
-<?php if(isset($_SESSION['siteusername'])) { ?>
60
+<?php if (isset($_SESSION['siteusername'])) { ?>
61 61
 <div id="masthead-expanded" class="hid" style="display: none;">
62 62
 	<div id="masthead-expanded-container" class="with-sandbar">
63 63
 	<div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="4"
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                     $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
79 79
                     $stmt->bindParam(":username", $_SESSION['siteusername']);
80 80
                     $stmt->execute();
81
-                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
81
+                    while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
82 82
                         $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
83 83
                         $video['duration'] = $__time_h->timestamp($video['duration']);
84 84
                         $video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 <?php } ?>
224 224
 </div>
225 225
 <div id="alerts">
226
-	<?php if(isset($error['status'])) { ?>
226
+	<?php if (isset($error['status'])) { ?>
227 227
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error  yt-alert-player">  <div class="yt-alert-icon">
228 228
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
229 229
 		</div>
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 			</div>
234 234
 		</div></div></div>
235 235
 	<?php } ?>
236
-	<?php if(isset($_GET['error'])) { ?>
236
+	<?php if (isset($_GET['error'])) { ?>
237 237
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error ">  <div class="yt-alert-icon">
238 238
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
239 239
 		</div>
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 			</div>
244 244
 		</div></div></div>
245 245
 	<?php } ?>
246
-	<?php if(isset($_SESSION['error'])) { ?>
246
+	<?php if (isset($_SESSION['error'])) { ?>
247 247
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
248 248
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
249 249
 		</div>
Please login to merge, or discard this patch.
web/public/get/like_video.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
21 21
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
22 22
     $stmt->execute(array(
23
-      ':username' => $_SESSION['siteusername'],
24
-      ':reciever' => $name,
23
+        ':username' => $_SESSION['siteusername'],
24
+        ':reciever' => $name,
25 25
     ));
26 26
     header('Location: ' . $_SERVER['HTTP_REFERER']);
27 27
 }
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
34 34
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
35 35
     $stmt->execute(array(
36
-      ':username' => $_SESSION['siteusername'],
37
-      ':reciever' => $name,
36
+        ':username' => $_SESSION['siteusername'],
37
+        ':reciever' => $name,
38 38
     ));
39 39
     header('Location: ' . $_SERVER['HTTP_REFERER']);
40 40
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 $stmt->bindParam(":username", $_SESSION['siteusername']);
18 18
 $stmt->bindParam(":reciever", $name);
19 19
 $stmt->execute();
20
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
20
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
21 21
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
22 22
     $stmt->execute(array(
23 23
       ':username' => $_SESSION['siteusername'],
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 $stmt->bindParam(":username", $_SESSION['siteusername']);
31 31
 $stmt->bindParam(":reciever", $name);
32 32
 $stmt->execute();
33
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
33
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
34 34
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
35 35
     $stmt->execute(array(
36 36
       ':username' => $_SESSION['siteusername'],
Please login to merge, or discard this patch.
web/public/get/dislike_video.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
25 25
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
26 26
     $stmt->execute(array(
27
-      ':username' => $_SESSION['siteusername'],
28
-      ':reciever' => $name,
27
+        ':username' => $_SESSION['siteusername'],
28
+        ':reciever' => $name,
29 29
     ));
30 30
     header('Location: ' . $_SERVER['HTTP_REFERER']);
31 31
 }
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
38 38
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
39 39
     $stmt->execute(array(
40
-      ':username' => $_SESSION['siteusername'],
41
-      ':reciever' => $name,
40
+        ':username' => $_SESSION['siteusername'],
41
+        ':reciever' => $name,
42 42
     ));
43 43
     header('Location: ' . $_SERVER['HTTP_REFERER']);
44 44
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 <?php
14 14
 $name = $_GET['v'];
15 15
 
16
-if(!isset($_SESSION['siteusername']) || !isset($_GET['v'])) {
16
+if (!isset($_SESSION['siteusername']) || !isset($_GET['v'])) {
17 17
     header('Location: ' . $_SERVER['HTTP_REFERER']);
18 18
 }
19 19
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $stmt->bindParam(":username", $_SESSION['siteusername']);
22 22
 $stmt->bindParam(":reciever", $name);
23 23
 $stmt->execute();
24
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
24
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
25 25
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
26 26
     $stmt->execute(array(
27 27
       ':username' => $_SESSION['siteusername'],
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 $stmt->bindParam(":username", $_SESSION['siteusername']);
35 35
 $stmt->bindParam(":reciever", $name);
36 36
 $stmt->execute();
37
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
37
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
38 38
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
39 39
     $stmt->execute(array(
40 40
       ':username' => $_SESSION['siteusername'],
Please login to merge, or discard this patch.
web/public/get/delete_video.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@
 block discarded – undo
14 14
 <?php
15 15
 
16 16
 if($video['author'] == $_SESSION['siteusername']) {
17
-  $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
18
-  $stmt->execute(array(
17
+    $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
18
+    $stmt->execute(array(
19 19
     ':author' => $video['author'],
20 20
     ':rid' => $video['rid'],
21
-  ));
21
+    ));
22 22
 }
23 23
 
24 24
 header('Location: /video_manager');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 <?php $video = $__video_h->fetch_video_rid($_GET['v']); ?>
14 14
 <?php
15 15
 
16
-if($video['author'] == $_SESSION['siteusername']) {
16
+if ($video['author'] == $_SESSION['siteusername']) {
17 17
   $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
18 18
   $stmt->execute(array(
19 19
     ':author' => $video['author'],
Please login to merge, or discard this patch.