Test Failed
Push — main ( 433cdf...8ba42a )
by chief
02:59
created
web/public/watch.php 2 patches
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
18
+    $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
19 19
 
20
-	$_SESSION['current_video'] = $_video['rid'];
20
+    $_SESSION['current_video'] = $_video['rid'];
21 21
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
22 22
         $error = array();
23 23
 
@@ -27,33 +27,33 @@  discard block
 block discarded – undo
27 27
         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; }
28 28
 
29 29
         if(!isset($error['message'])) {
30
-			$text = $_POST['comment'];
30
+            $text = $_POST['comment'];
31 31
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
32 32
             $stmt->bindParam(":v", $_GET['v']);
33
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
34
-			$stmt->bindParam(":comment", $text);
33
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
34
+            $stmt->bindParam(":comment", $text);
35 35
             $stmt->execute();
36 36
 
37
-			$__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
38
-			$__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt");
37
+            $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
38
+            $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt");
39 39
         }
40 40
     }
41 41
 
42
-	/* 
42
+    /* 
43 43
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
44 44
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
45 45
 	Work on this tomorrow or some shit idk lol
46 46
 	*/
47 47
 
48
-	/* 
48
+    /* 
49 49
 	USE THE GOD DAMN __CONFIG MORE -- idiot
50 50
 	Work on this tomorrow or some shit
51 51
 	*/
52 52
 
53
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
54
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
55
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
56
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
53
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
54
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
55
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
56
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
57 57
 ?>
58 58
 <!DOCTYPE html>
59 59
 <html>
@@ -83,29 +83,29 @@  discard block
 block discarded – undo
83 83
          if (window.yt.timing) {yt.timing.tick("ct");}    
84 84
       </script>
85 85
 		<?php
86
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
87
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
86
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
87
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
88 88
 
89
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
90
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
89
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
90
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
91 91
 
92
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
93
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
92
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
93
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
94 94
 
95
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
96
-				$_video['likeswidth'] = 0;
97
-				$_video['dislikeswidth'] = 0;
98
-			} else {
99
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
100
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
101
-			}
95
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
96
+                $_video['likeswidth'] = 0;
97
+                $_video['dislikeswidth'] = 0;
98
+            } else {
99
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
100
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
101
+            }
102 102
 
103
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
104
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
105
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
106
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
107
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
108
-		?>
103
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
104
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
105
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
106
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
107
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
108
+        ?>
109 109
 	</head>
110 110
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
111 111
 		<form name="logoutForm" method="POST" action="/logout">
@@ -327,21 +327,21 @@  discard block
 block discarded – undo
327 327
 													<hr><br>
328 328
 													<h3>Add to a Playlist</h3>
329 329
 													<?php
330
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
331
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
332
-														$stmt->execute();
333
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
334
-															$buffer = json_decode($playlist['videos']);
335
-															@$rid = $buffer[0];
336
-															if(!empty($rid)) {
337
-																@$video = $__video_h->fetch_video_rid($rid);
338
-															} else {
339
-																$video['thumbnail'] = "";
340
-																$video['duration'] = 0;
341
-															}
330
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
331
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
332
+                                                        $stmt->execute();
333
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
334
+                                                            $buffer = json_decode($playlist['videos']);
335
+                                                            @$rid = $buffer[0];
336
+                                                            if(!empty($rid)) {
337
+                                                                @$video = $__video_h->fetch_video_rid($rid);
338
+                                                            } else {
339
+                                                                $video['thumbnail'] = "";
340
+                                                                $video['duration'] = 0;
341
+                                                            }
342 342
 
343
-															$videos = count($buffer);
344
-													?>
343
+                                                            $videos = count($buffer);
344
+                                                    ?>
345 345
 														<a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a>
346 346
 													<?php } ?>
347 347
 												<?php } ?>
@@ -606,10 +606,10 @@  discard block
 block discarded – undo
606 606
 												</div>
607 607
 											</div>
608 608
 											<?php 
609
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
610
-												$stmt->bindParam(":v", $_GET['v']);
611
-												$stmt->execute();
612
-											?>
609
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
610
+                                                $stmt->bindParam(":v", $_GET['v']);
611
+                                                $stmt->execute();
612
+                                            ?>
613 613
 
614 614
 											<?php if($stmt->rowCount() != 0) { ?>
615 615
 												<div class="comments-section">
@@ -619,16 +619,16 @@  discard block
 block discarded – undo
619 619
 													<h4>Video Responses</h4>
620 620
 													<ul class="video-list">
621 621
 													<?php 
622
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
623
-															if($__video_h->video_exists($video['video'])) { 
624
-																$video = $__video_h->fetch_video_rid($video['video']);
625
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
626
-																$video['duration'] = $__time_h->timestamp($video['duration']);
627
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
628
-																$video['author'] = htmlspecialchars($video['author']);		
629
-																$video['title'] = htmlspecialchars($video['title']);
630
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
631
-													?>
622
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
623
+                                                            if($__video_h->video_exists($video['video'])) { 
624
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
625
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
626
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
627
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
628
+                                                                $video['author'] = htmlspecialchars($video['author']);		
629
+                                                                $video['title'] = htmlspecialchars($video['title']);
630
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
631
+                                                    ?>
632 632
 														<li class="video-list-item yt-tile-default">
633 633
 															<a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="<?php echo htmlspecialchars($_video['author']); ?>&amp;feature=watch_response"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
634 634
 															<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">
@@ -710,38 +710,38 @@  discard block
 block discarded – undo
710 710
 												</div>
711 711
 												<ul class="comment-list" id="live_comments">
712 712
 														<?php
713
-														$results_per_page = 20;
713
+                                                        $results_per_page = 20;
714 714
 
715
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
716
-														$stmt->bindParam(":rid", $_video['rid']);
717
-														$stmt->execute();
715
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
716
+                                                        $stmt->bindParam(":rid", $_video['rid']);
717
+                                                        $stmt->execute();
718 718
 
719
-														$number_of_result = $stmt->rowCount();
720
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
719
+                                                        $number_of_result = $stmt->rowCount();
720
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
721 721
 
722
-														if (!isset ($_GET['page']) ) {  
723
-															$page = 1;  
724
-														} else {  
725
-															$page = (int)$_GET['page'];  
726
-														}  
722
+                                                        if (!isset ($_GET['page']) ) {  
723
+                                                            $page = 1;  
724
+                                                        } else {  
725
+                                                            $page = (int)$_GET['page'];  
726
+                                                        }  
727 727
 
728
-														$page_first_result = ($page - 1) * $results_per_page;  
728
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
729 729
 
730
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
731
-														$stmt->bindParam(":rid", $_video['rid']);
732
-														$stmt->bindParam(":pfirst", $page_first_result);
733
-														$stmt->bindParam(":pper", $results_per_page);
734
-														$stmt->execute();
730
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
731
+                                                        $stmt->bindParam(":rid", $_video['rid']);
732
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
733
+                                                        $stmt->bindParam(":pper", $results_per_page);
734
+                                                        $stmt->execute();
735 735
 
736
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
737
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
738
-																$comment['liked'] = true;
739
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
740
-																$comment['disliked'] = true;
736
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
737
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
738
+                                                                $comment['liked'] = true;
739
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
740
+                                                                $comment['disliked'] = true;
741 741
 																
742
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
743
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
744
-													?>
742
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
743
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
744
+                                                    ?>
745 745
 
746 746
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
747 747
 														<div class="comment-body">
@@ -826,16 +826,16 @@  discard block
 block discarded – undo
826 826
 											<ul id="watch-related" class="video-list">
827 827
 												<div id="ppv-container" class="hid"></div>
828 828
 												<?php
829
-													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
830
-													$stmt->execute();
831
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
832
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
833
-														$video['duration'] = $__time_h->timestamp($video['duration']);
834
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
835
-														$video['author'] = htmlspecialchars($video['author']);		
836
-														$video['title'] = htmlspecialchars($video['title']);
837
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
838
-												?>
829
+                                                    $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
830
+                                                    $stmt->execute();
831
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
832
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
833
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
834
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
835
+                                                        $video['author'] = htmlspecialchars($video['author']);		
836
+                                                        $video['title'] = htmlspecialchars($video['title']);
837
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
838
+                                                ?>
839 839
 												<li class="video-list-item"><a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="ved=CAIQzRooAA%3D%3D&amp;<?php echo htmlspecialchars($_video['author']); ?>&amp;feature=relmfu"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
840 840
 													<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">
841 841
 													</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   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -11,22 +11,22 @@  discard block
 block discarded – undo
11 11
 <?php $__user_u = new user_update($__db); ?>
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18 18
 	$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
19 19
 
20 20
 	$_SESSION['current_video'] = $_video['rid'];
21
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
21
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
22 22
         $error = array();
23 23
 
24
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
25
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
26
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
27
-        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
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
25
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
26
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
27
+        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; }
28 28
 
29
-        if(!isset($error['message'])) {
29
+        if (!isset($error['message'])) {
30 30
 			$text = $_POST['comment'];
31 31
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
32 32
             $stmt->bindParam(":v", $_GET['v']);
@@ -83,20 +83,20 @@  discard block
 block discarded – undo
83 83
          if (window.yt.timing) {yt.timing.tick("ct");}    
84 84
       </script>
85 85
 		<?php
86
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
86
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
87 87
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
88 88
 
89
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
90
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
89
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
90
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
91 91
 
92 92
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
93 93
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
94 94
 
95
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
95
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
96 96
 				$_video['likeswidth'] = 0;
97 97
 				$_video['dislikeswidth'] = 0;
98 98
 			} else {
99
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
99
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
100 100
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
101 101
 			}
102 102
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 									</div>
131 131
 									<div id="instream_google_companion_ad_div"></div>
132 132
 								</div>
133
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
133
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
134 134
 									<div id="watch-owner-container">
135 135
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
136 136
 											<ul class="yt-nav-aside">
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 											title="" 
166 166
 											id="subscribe-button"
167 167
 											type="button" 
168
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
168
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
169 169
 											role="button">
170 170
 											<span class="yt-uix-button-icon-wrapper">
171 171
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 											<button onclick=";like_video();return false;"
247 247
 											title="I like this" 
248 248
 											type="button" 
249
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
249
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
250 250
 											id="watch-like"  
251 251
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
252 252
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 											type="button" 
261 261
 											style="margin-left: -2px;"
262 262
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
263
-											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" 
263
+											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" 
264 264
 											id="watch-unlike" 
265 265
 											role="button">
266 266
 												<span class="yt-uix-button-icon-wrapper">
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 												not implemented ismnf
279 279
 											</div>
280 280
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
281
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
281
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
282 282
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
283 283
 													<div class="yt-alert-icon">
284 284
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 												<?php } else { ?>
295 295
 													<h3>Be friends with the creator</h3>
296 296
 
297
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
297
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
298 298
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
299 299
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
300 300
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
 														</span><br><br>
309 309
 													<?php } ?>
310 310
 
311
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
312
-														<?php if($_video['friended'] == false) { ?>
311
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
312
+														<?php if ($_video['friended'] == false) { ?>
313 313
 															<a href="/friends">Send a friend request</a>
314 314
 														<?php } else { ?>
315 315
 															Your friend request is pending.
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 													<?php } ?>
320 320
 													<hr><br>
321 321
 													<h3>Add to Favorites</h3>
322
-													<?php if($_video['favorited'] == false) { ?>
322
+													<?php if ($_video['favorited'] == false) { ?>
323 323
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
324 324
 													<?php } else { ?>
325 325
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -330,10 +330,10 @@  discard block
 block discarded – undo
330 330
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
331 331
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
332 332
 														$stmt->execute();
333
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
333
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
334 334
 															$buffer = json_decode($playlist['videos']);
335 335
 															@$rid = $buffer[0];
336
-															if(!empty($rid)) {
336
+															if (!empty($rid)) {
337 337
 																@$video = $__video_h->fetch_video_rid($rid);
338 338
 															} else {
339 339
 																$video['thumbnail'] = "";
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 												$stmt->execute();
612 612
 											?>
613 613
 
614
-											<?php if($stmt->rowCount() != 0) { ?>
614
+											<?php if ($stmt->rowCount() != 0) { ?>
615 615
 												<div class="comments-section">
616 616
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
617 617
 													see all
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
 													<h4>Video Responses</h4>
620 620
 													<ul class="video-list">
621 621
 													<?php 
622
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
623
-															if($__video_h->video_exists($video['video'])) { 
622
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
623
+															if ($__video_h->video_exists($video['video'])) { 
624 624
 																$video = $__video_h->fetch_video_rid($video['video']);
625 625
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
626 626
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -651,19 +651,19 @@  discard block
 block discarded – undo
651 651
 														</h4>
652 652
 													</div>
653 653
 												</div>
654
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
654
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
655 655
 													<div class="comments-post-container clearfix">
656 656
 														<div class="comments-post-alert">
657 657
 															<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>
658 658
 														</div>
659 659
 													</div>
660
-												<?php } else if($_video['commenting'] == "d") { ?>
660
+												<?php } else if ($_video['commenting'] == "d") { ?>
661 661
 													<div class="comments-post-container clearfix">
662 662
 														<div class="comments-post-alert">
663 663
 															This video has comemnting disabled!
664 664
 														</div>
665 665
 													</div>
666
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
666
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
667 667
 													<div class="comments-post-container clearfix">
668 668
 														<div class="comments-post-alert">
669 669
 															This user has blocked you!
@@ -717,15 +717,15 @@  discard block
 block discarded – undo
717 717
 														$stmt->execute();
718 718
 
719 719
 														$number_of_result = $stmt->rowCount();
720
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
720
+														$number_of_page = ceil($number_of_result/$results_per_page);  
721 721
 
722
-														if (!isset ($_GET['page']) ) {  
722
+														if (!isset ($_GET['page'])) {  
723 723
 															$page = 1;  
724 724
 														} else {  
725
-															$page = (int)$_GET['page'];  
725
+															$page = (int) $_GET['page'];  
726 726
 														}  
727 727
 
728
-														$page_first_result = ($page - 1) * $results_per_page;  
728
+														$page_first_result = ($page - 1)*$results_per_page;  
729 729
 
730 730
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
731 731
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -733,10 +733,10 @@  discard block
 block discarded – undo
733 733
 														$stmt->bindParam(":pper", $results_per_page);
734 734
 														$stmt->execute();
735 735
 
736
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
737
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
736
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
737
+															if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
738 738
 																$comment['liked'] = true;
739
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
739
+															else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
740 740
 																$comment['disliked'] = true;
741 741
 																
742 742
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 																		<span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span>
759 759
 																		</span>
760 760
 																		</span></span>
761
-																		<?php if($comment['likes'] != 0) { ?>
761
+																		<?php if ($comment['likes'] != 0) { ?>
762 762
 																		<span dir="ltr" class="comments-rating-positive" title="9 up, 1 down">
763 763
 																			<?php echo $comment['likes']; ?>
764 764
 																			<img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif">
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 												<?php
829 829
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
830 830
 													$stmt->execute();
831
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
831
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
832 832
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
833 833
 														$video['duration'] = $__time_h->timestamp($video['duration']);
834 834
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/comment_service_ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@  discard block
 block discarded – undo
14 14
 <?php
15 15
 $_video = $__video_h->fetch_video_rid($_SESSION['current_video']);
16 16
 
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", $_SESSION['current_video']);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 header("Content-type: text/xml");
39 39
 // ugly solution
40
-if(!isset($error['status'])) {
40
+if (!isset($error['status'])) {
41 41
     $xml = '<?xml version="1.0" encoding="utf-8"?><root><str_code><![CDATA[OK]]></str_code><html_content><![CDATA[<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="420" data-score="0"><div class="comment-body"><div class="content-container"><div class="content"><div class="comment-text" dir="ltr"><p>' . $__video_h->shorten_description($_POST['comment'], 2048, true) . '</p></div><p class="metadata"><span class="author "><a href="/user/' . htmlspecialchars($_SESSION['siteusername']) . '" class="yt-uix-sessionlink yt-user-name " data-sessionlink="' . htmlspecialchars($_SESSION['siteusername']) . '" dir="ltr">' . htmlspecialchars($_SESSION['siteusername']) . '</a></span><span class="time" dir="ltr"><span dir="ltr">just now<span></span></span></span></p></div><div class="comment-actions"><span class="yt-uix-button-group"><button type="button" class="start comment-action-vote-up comment-action yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" onclick=";return false;" title="Vote Up" data-action="vote-up" data-tooltip-show-delay="300" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-watch-comment-vote-up" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Vote Up"><span class="yt-valign-trick"></span></span></button><button type="button" class="end comment-action-vote-down comment-action yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" onclick=";return false;" title="Vote Down" data-action="vote-down" data-tooltip-show-delay="300" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-watch-comment-vote-down" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Vote Down"><span class="yt-valign-trick"></span></span></button></span><span class="yt-uix-button-group"><!--<button type="button" class="start comment-action yt-uix-button yt-uix-button-default" onclick=";return false;" data-action="reply" role="button"><span class="yt-uix-button-content">Reply </span></button>--><button type="button" class="end flip yt-uix-button yt-uix-button-default yt-uix-button-empty" onclick=";return false;" data-button-has-sibling-menu="true" role="button" aria-pressed="false" aria-expanded="false" aria-haspopup="true" aria-activedescendant=""><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""><div class=" yt-uix-button-menu yt-uix-button-menu-default" style="display: none;"><ul><li class="comment-action" data-action="share"><span class="yt-uix-button-menu-item">Share</span></li><li class="comment-action-remove comment-action" data-action="remove"><span class="yt-uix-button-menu-item">Remove</span></li><li class="comment-action" data-action="flag"><span class="yt-uix-button-menu-item">Flag for spam</span></li><li class="comment-action-block comment-action" data-action="block"><span class="yt-uix-button-menu-item">Block User</span></li><li class="comment-action-unblock comment-action" data-action="unblock"><span class="yt-uix-button-menu-item">Unblock User</span></li></ul></div></button></span></div></div></div></li>]]></html_content><return_code><![CDATA[0]]></return_code></root>';
42 42
 } else {
43 43
     $xml = '<?xml version="1.0" encoding="utf-8"?><root><str_code><![CDATA[OK]]></str_code><html_content><![CDATA[<div class="yt-alert yt-alert-default yt-alert-error ">  <div class="yt-alert-icon"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"></div><div class="yt-alert-buttons"></div><div class="yt-alert-content" role="alert"><span class="yt-alert-vertical-trick"></span><div class="yt-alert-message">You are under a cooldown!</div></div></div>]]></html_content><return_code><![CDATA[0]]></return_code></root>';
Please login to merge, or discard this patch.
web/public/channel_videos.php 1 patch
Spacing   +22 added lines, -22 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']);
@@ -68,28 +68,28 @@  discard block
 block discarded – undo
68 68
     $_user['genre'] = strtolower($_user['genre']);
69 69
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
70 70
 
71
-    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
72
-    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
73
-    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
74
-    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
75
-    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
76
-    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
71
+    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
72
+    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
73
+    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
74
+    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
75
+    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
76
+    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
77 77
 
78
-	if(isset($_SESSION['siteusername']))
78
+	if (isset($_SESSION['siteusername']))
79 79
     	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
80 80
 
81
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
81
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
82 82
         $error = array();
83 83
 
84
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
85
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
86
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
84
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
85
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
86
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
87 87
         //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; }
88 88
         //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; }
89
-        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; }
89
+        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 90
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
91 91
 
92
-        if(!isset($error['message'])) {
92
+        if (!isset($error['message'])) {
93 93
 			$text = $_POST['comment'];
94 94
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
95 95
 			$stmt->bindParam(":id", $_user['username']);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
101 101
 
102
-            if(@$_SESSION['siteusername'] != $_user['username']) { 
102
+            if (@$_SESSION['siteusername'] != $_user['username']) { 
103 103
                 $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']);
104 104
             }
105 105
         }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		<link rel="stylesheet" href="/yt/cssbin/www-extra.css">
134 134
 		<style>
135 135
 			#content-container {
136
-				background-color: <?php echo $_user['primary_color'];  ?>;
136
+				background-color: <?php echo $_user['primary_color']; ?>;
137 137
 				background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>);
138 138
 				background-repeat: repeat;
139 139
 				background-position: center top;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			<div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div>
150 150
 			<div id="content-container">
151 151
 				<!-- begin content -->
152
-				<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
152
+				<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
153 153
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
154 154
 				<?php } ?> 
155 155
 				<div id="content">
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 												<h1><?php echo htmlspecialchars($_user['username']); ?></h1>
205 205
 											</div>
206 206
 											<div class="upper-left-section enable-fancy-subscribe-button">
207
-											<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
207
+											<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
208 208
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
209 209
 														<button 
210 210
 															href="#" 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 															title="" 
213 213
 															id="subscribe-button"
214 214
 															type="button" 
215
-															class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
215
+															class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
216 216
 															role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" 
217 217
 															src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
218 218
 														<span class="subscribed-label">Subscribed</span>
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 									</div>
279 279
 								</div>
280 280
 							</div>
281
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
281
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
282 282
 							<div id="branded-page-body">
283 283
                                 <div class="channel-tab-content channel-layout-full-width">
284 284
                                     <div class="tab-content-body">
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 														$stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
313 313
 														$stmt->bindParam(":username", $_user['username']);
314 314
 														$stmt->execute();
315
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
315
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
316 316
 															$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
317 317
 															$video['duration'] = $__time_h->timestamp($video['duration']);
318 318
 															$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/playlists.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@  discard block
 block discarded – undo
8 8
 <?php $__user_u = new user_update($__db); ?>
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
13
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
14 14
         $error = array();
15 15
 
16
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "You are not logged in"; $error['status'] = true; }
17
-        if(!$_POST['comment']){ $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
18
-        if(empty(trim($_POST['title']))){ $error['message'] = "Your title cannot be blank"; $error['status'] = true; }
19
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
20
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; }
16
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "You are not logged in"; $error['status'] = true; }
17
+        if (!$_POST['comment']) { $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
18
+        if (empty(trim($_POST['title']))) { $error['message'] = "Your title cannot be blank"; $error['status'] = true; }
19
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
20
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; }
21 21
 
22
-        if(!isset($error['message'])) {
22
+        if (!isset($error['message'])) {
23 23
             $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_';
24 24
             $result = '';
25 25
             for ($i = 0; $i < 11; $i++)
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
                                     $stmt->execute();
189 189
 
190 190
                                     $number_of_result = $stmt->rowCount();
191
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
191
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
192 192
 
193
-                                    if (!isset ($_GET['page']) ) {  
193
+                                    if (!isset ($_GET['page'])) {  
194 194
                                         $page = 1;  
195 195
                                     } else {  
196
-                                        $page = (int)$_GET['page'];  
196
+                                        $page = (int) $_GET['page'];  
197 197
                                     }  
198 198
 
199
-                                    $page_first_result = ($page - 1) * $results_per_page;  
199
+                                    $page_first_result = ($page - 1)*$results_per_page;  
200 200
                                 ?>
201 201
                                 <?php 
202 202
                                     $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper");
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
                                     </tr>
242 242
                                     
243 243
                                     <?php
244
-                                        while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
244
+                                        while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
245 245
                                             $playlist['videos'] = json_decode($playlist['videos']);
246
-                                            if($__video_h->video_exists(@$playlist['videos'][0])) {
247
-                                                if(count($playlist['videos']) != 0) {
246
+                                            if ($__video_h->video_exists(@$playlist['videos'][0])) {
247
+                                                if (count($playlist['videos']) != 0) {
248 248
                                                     $video = $__video_h->fetch_video_rid($playlist['videos'][0]);
249 249
                                                     $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
250 250
                                                     $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                                     </div>
327 327
                                 </center>
328 328
 
329
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
329
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
330 330
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button>
331 331
                                 <?php } ?>   
332 332
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
                                 </script>
373 373
 
374 374
                                 <?php 
375
-                                    if($stmt6->rowCount() == 0) { echo "
375
+                                    if ($stmt6->rowCount() == 0) { echo "
376 376
                                         <br>Welcome to your playlists! You can make collections of videos for you to share with others.<br>
377 377
                                     "; 
378 378
                                 } ?>
Please login to merge, or discard this patch.
web/public/channel_feed.php 1 patch
Spacing   +33 added lines, -33 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']);
@@ -68,28 +68,28 @@  discard block
 block discarded – undo
68 68
     $_user['genre'] = strtolower($_user['genre']);
69 69
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
70 70
 
71
-    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
72
-    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
73
-    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
74
-    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
75
-    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
76
-    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
71
+    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
72
+    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
73
+    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
74
+    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
75
+    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
76
+    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
77 77
 
78
-	if(isset($_SESSION['siteusername']))
78
+	if (isset($_SESSION['siteusername']))
79 79
     	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
80 80
 
81
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
81
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
82 82
         $error = array();
83 83
 
84
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
85
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
86
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
84
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
85
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
86
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
87 87
         //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; }
88 88
         //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; }
89
-        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; }
89
+        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 90
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
91 91
 
92
-        if(!isset($error['message'])) {
92
+        if (!isset($error['message'])) {
93 93
 			$text = $_POST['comment'];
94 94
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
95 95
 			$stmt->bindParam(":id", $_user['username']);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
101 101
 
102
-            if(@$_SESSION['siteusername'] != $_user['username']) { 
102
+            if (@$_SESSION['siteusername'] != $_user['username']) { 
103 103
                 $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']);
104 104
             }
105 105
         }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		<link rel="stylesheet" href="/yt/cssbin/www-extra.css">
134 134
 		<style>
135 135
 			#content-container {
136
-				background-color: <?php echo $_user['primary_color'];  ?>;
136
+				background-color: <?php echo $_user['primary_color']; ?>;
137 137
 				background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>);
138 138
 				background-repeat: repeat;
139 139
 				background-position: center top;
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 			<div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div>
150 150
 			<div id="content-container">
151 151
 				<!-- begin content -->
152
-				<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
152
+				<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
153 153
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
154 154
 				<?php } ?> 
155 155
 				<?php
156
-					if(empty(trim($_user['bio'])))
156
+					if (empty(trim($_user['bio'])))
157 157
 						$_user['bio'] = "This user has no description.";
158 158
 				?>
159 159
 				<div id="content">
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 												<h1><?php echo htmlspecialchars($_user['username']); ?></h1>
209 209
 											</div>
210 210
 											<div class="upper-left-section enable-fancy-subscribe-button">
211
-											<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
211
+											<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
212 212
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
213 213
 														<button 
214 214
 															href="#" 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 															title="" 
217 217
 															id="subscribe-button"
218 218
 															type="button" 
219
-															class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
219
+															class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
220 220
 															role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" 
221 221
 															src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
222 222
 														<span class="subscribed-label">Subscribed</span>
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 									</div>
283 283
 								</div>
284 284
 							</div>
285
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
285
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
286 286
 							<div id="branded-page-body">
287 287
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template">
288 288
 									<div class="tab-content-body">
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
                                                                         $stmt->bindParam(":comment_username", $_user['username']);
338 338
 																		$stmt->bindParam(":videos_username", $_user['username']);
339 339
                                                                         $stmt->execute();
340
-                                                                        while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
341
-																			if((int)$content['id']) {
340
+                                                                        while ($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
341
+																			if ((int) $content['id']) {
342 342
 																				$content = $__video_h->fetch_comment_id($content['id']);
343 343
 																				$content['video'] = $__video_h->fetch_video_rid($content['toid']);
344 344
 																				$content['type'] = "comment";
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 																				$content['type'] = "video";
348 348
 																			}
349 349
 
350
-																			if($content['type'] == "video") {
350
+																			if ($content['type'] == "video") {
351 351
                                                                     ?>
352 352
                                                                     <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg">
353 353
                                                                         <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">
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
                                                                         </div>
420 420
                                                                     </div>
421 421
                                                                     <?php } else { 
422
-																		if($__video_h->video_exists($content['video']['rid'])) { ?>
422
+																		if ($__video_h->video_exists($content['video']['rid'])) { ?>
423 423
 																	<div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw">
424 424
 																		<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">
425 425
 																		<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>
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 														</div>
526 526
 														<hr class="yt-horizontal-rule ">
527 527
 													</div>
528
-													<?php if(!empty($_user['website'])) { ?>
528
+													<?php if (!empty($_user['website'])) { ?>
529 529
 														<div class="user-profile-item">
530 530
 															<div class="yt-c3-profile-custom-url field-container ">
531 531
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 															<h5>Country</h5>
575 575
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
576 576
 														</div>
577
-														<?php if($_user['genre'] != "none") { ?>
577
+														<?php if ($_user['genre'] != "none") { ?>
578 578
 															<div class="user-profile-item ">
579 579
 																<h5>Channel Genre</h5>
580 580
 																<span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span>
@@ -586,13 +586,13 @@  discard block
 block discarded – undo
586 586
 											</div>
587 587
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
588 588
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
589
-												<?php if(count($_user['featured_channels']) != 0) { ?>
589
+												<?php if (count($_user['featured_channels']) != 0) { ?>
590 590
 												<div class="module-view other-channels-view">
591 591
 													<h2>Featured Channels</h2>
592 592
 													<ul class="channel-summary-list ">
593 593
 														<?php 
594
-															foreach($_user['featured_channels'] as $user) {
595
-																if($__user_h->user_exists($user)) {
594
+															foreach ($_user['featured_channels'] as $user) {
595
+																if ($__user_h->user_exists($user)) {
596 596
 														?>
597 597
 															<li class="yt-tile-visible yt-uix-tile">
598 598
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -621,13 +621,13 @@  discard block
 block discarded – undo
621 621
 												$stmt->bindParam(":search", $_user['username']);
622 622
 												$stmt->execute();
623 623
 
624
-												if($stmt->rowCount() != 0) {
624
+												if ($stmt->rowCount() != 0) {
625 625
 											?>
626 626
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
627 627
 													<div class="module-view gh-featured">
628 628
 														<h2>Featured Playlists</h2>     
629 629
 														<?php
630
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
630
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
631 631
 															$playlist['videos'] = json_decode($playlist['videos']);
632 632
 														?> 
633 633
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.
web/public/playlists_ajax.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -8,36 +8,36 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ob_start(); ?>
10 10
 <?php
11
-   $request = (object) [
12
-      "search_term"      => $_SESSION['siteusername'],
13
-      "like_search_term" => "%" . $_SESSION['siteusername'] . "%",
14
-      "search_amount"    => 0 /* [fallback] */
15
-   ];
11
+    $request = (object) [
12
+        "search_term"      => $_SESSION['siteusername'],
13
+        "like_search_term" => "%" . $_SESSION['siteusername'] . "%",
14
+        "search_amount"    => 0 /* [fallback] */
15
+    ];
16 16
 
17
-   $stmt = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ");
18
-   $stmt->bindParam(":search", $request->like_search_term);
19
-   $stmt->execute(); 
20
-   $request->search_amount = $stmt->rowCount();
17
+    $stmt = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ");
18
+    $stmt->bindParam(":search", $request->like_search_term);
19
+    $stmt->execute(); 
20
+    $request->search_amount = $stmt->rowCount();
21 21
 
22
-   $results_per_page = 12;
23
-   $number_of_result = $request->search_amount;
24
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
22
+    $results_per_page = 12;
23
+    $number_of_result = $request->search_amount;
24
+    $number_of_page = ceil ($number_of_result / $results_per_page);  
25 25
 
26
-   if (!isset ($_GET['page']) ) {  
27
-       $page = 1;  
28
-   } else {  
29
-       $page = (int)$_GET['page'];  
30
-   }  
26
+    if (!isset ($_GET['page']) ) {  
27
+        $page = 1;  
28
+    } else {  
29
+        $page = (int)$_GET['page'];  
30
+    }  
31 31
 
32
-   $page_first_result = ($page - 1) * $results_per_page;  
32
+    $page_first_result = ($page - 1) * $results_per_page;  
33 33
 
34
-   $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35
-   $stmt6->bindParam(":search", $request->like_search_term);
36
-   $stmt6->bindParam(":pfirst", $page_first_result);
37
-   $stmt6->bindParam(":pper", $results_per_page);
38
-   $stmt6->execute();
34
+    $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35
+    $stmt6->bindParam(":search", $request->like_search_term);
36
+    $stmt6->bindParam(":pfirst", $page_first_result);
37
+    $stmt6->bindParam(":pper", $results_per_page);
38
+    $stmt6->execute();
39 39
 
40
-   /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
40
+    /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
41 41
 ?>               
42 42
 <table style="width: 100%;">
43 43
     <tr>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
 
22 22
    $results_per_page = 12;
23 23
    $number_of_result = $request->search_amount;
24
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
24
+   $number_of_page = ceil($number_of_result/$results_per_page);  
25 25
 
26
-   if (!isset ($_GET['page']) ) {  
26
+   if (!isset ($_GET['page'])) {  
27 27
        $page = 1;  
28 28
    } else {  
29
-       $page = (int)$_GET['page'];  
29
+       $page = (int) $_GET['page'];  
30 30
    }  
31 31
 
32
-   $page_first_result = ($page - 1) * $results_per_page;  
32
+   $page_first_result = ($page - 1)*$results_per_page;  
33 33
 
34 34
    $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35 35
    $stmt6->bindParam(":search", $request->like_search_term);
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
     </tr>
51 51
     
52 52
     <?php
53
-        while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
53
+        while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
54 54
             $playlist['videos'] = json_decode($playlist['videos']);
55
-            if($__video_h->video_exists(@$playlist['videos'][0])) {
56
-                if(count($playlist['videos']) != 0) {
55
+            if ($__video_h->video_exists(@$playlist['videos'][0])) {
56
+                if (count($playlist['videos']) != 0) {
57 57
                     $video = $__video_h->fetch_video_rid($playlist['videos'][0]);
58 58
                     $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
59 59
                     $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
Please login to merge, or discard this patch.
web/public/s/mod/channel_customization.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                             </script>
287 287
                             <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>-->
288 288
                         <img src="/dynamic/pfp/<?php echo $_user['pfp']; ?>" style="width:100px;height:100px;"><br>
289
-                        <?php if($_user['pfp'] != "default.png") { ?>
289
+                        <?php if ($_user['pfp'] != "default.png") { ?>
290 290
                             <a href="/get/remove_profile_pic">Remove Profile Picture</a><br>
291 291
                         <?php } ?>
292 292
                         <br><hr class="thin-line-darker" style="width:unset;">
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                             <input style="width: 169px;position: relative;top: 10px;" type="file" name="videopagebanner" id="avatar-upload">
297 297
                             <button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>
298 298
                         </div><br>                   
299
-                        <?php if(!empty($_user['subbutton'])) { ?>
299
+                        <?php if (!empty($_user['subbutton'])) { ?>
300 300
                             <a href="/get/remove_watch_banner">Remove Watch Page Banner</a><br>
301 301
                         <?php } ?><br><hr class="thin-line-darker" style="width:unset;">
302 302
                         
@@ -322,19 +322,19 @@  discard block
 block discarded – undo
322 322
 
323 323
                         <b>Featured Video</b>
324 324
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
325
-                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']);?>" name="videoid">
325
+                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']); ?>" name="videoid">
326 326
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
327 327
 
328 328
                         <div style="position: relative;top: 7px;">
329 329
                             <b>Featured Channels</b>
330 330
                             <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
331
-                            <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']);?>" name="featuredchannels">
331
+                            <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']); ?>" name="featuredchannels">
332 332
                             </div>
333 333
                         </div><br><br><hr class="thin-line-darker" style="margin-top: 0px;width:unset;"><br>
334 334
 
335 335
                         <b>Website</b>
336 336
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -7px;">
337
-                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']);?>" name="website">
337
+                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']); ?>" name="website">
338 338
                             
339 339
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
340 340
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
                             <span style="font-size: 11px;" class="grey-text">This will show what type of channel you are to other users.</span>
345 345
                             <div class="customization-module" id="channellayout" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -19px;">
346 346
                                 <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"   name="genre">
347
-                                    <?php foreach($categories as $category) { ?>
347
+                                    <?php foreach ($categories as $category) { ?>
348 348
                                         <option value="<?php echo $category; ?>"><?php echo $category; ?></option>
349 349
                                     <?php } ?>
350 350
                                 </select>
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                                 <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"   name="transparency">
359 359
                                 <?php
360 360
                                 $trans = array(
361
-                                    "1.1","1.0","0.9","0.8","0.7","0.6","0.5","0.4","0.3","0.2","0.1",
361
+                                    "1.1", "1.0", "0.9", "0.8", "0.7", "0.6", "0.5", "0.4", "0.3", "0.2", "0.1",
362 362
                                 );
363 363
                                 ?>
364 364
                                     <option value="1.0">100% (Visible)</option>
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
                             <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"  id="country" name="country" value="<?php echo $_user['country']?>">
382 382
                             <?php
383 383
                             $countries = array(
384
-                                "Select country","Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
384
+                                "Select country", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
385 385
                             );
386 386
 
387 387
                             $countryLength = sizeof($countries);
388 388
                             $i = 0;
389
-                            for($i = 0;$i <= $countryLength; $i++)
389
+                            for ($i = 0; $i <= $countryLength; $i++)
390 390
                             {
391 391
                                 $c = $countries[$i];
392 392
                                 if ($c == $_user['country'])
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                                 else
400 400
                                 {
401 401
                                 ?>
402
-                                <option value="<?php echo $c;?>"><?php echo $c; ?></option>
402
+                                <option value="<?php echo $c; ?>"><?php echo $c; ?></option>
403 403
                                 <?php
404 404
                                 }
405 405
                             }
Please login to merge, or discard this patch.
web/public/s/classes/video_helper.php 1 patch
Spacing   +17 added lines, -17 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
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $stmt->execute();
62 62
         
63 63
         $views = 0;
64
-        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
64
+        while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
65 65
             $views = $views + $this->fetch_video_views($video['rid']);
66 66
         }
67 67
         return $views;
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 
79 79
     function shorten_description(string $description, int $limit, bool $newlines = false) {
80 80
         $description = trim($description);
81
-        if(strlen($description) >= $limit) {
81
+        if (strlen($description) >= $limit) {
82 82
             $description = substr($description, 0, $limit) . "...";
83 83
         } 
84 84
 
85 85
         $description = htmlspecialchars($description);
86
-        if($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); }
86
+        if ($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); }
87 87
         return $description;
88 88
     }
89 89
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     }
97 97
 
98 98
     function get_video_likes($reciever, $liked) {
99
-        if($liked) {
99
+        if ($liked) {
100 100
             $stmt = $this->__db->prepare("SELECT `sender` FROM likes WHERE reciever = :reciever AND type = 'l'");
101 101
             $stmt->bindParam(":reciever", $reciever);
102 102
             $stmt->execute();
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $stmt->bindParam(":viewer", $user);
117 117
         $stmt->bindParam(":rid", $vidid);
118 118
         $stmt->execute();
119
-        if($stmt->rowCount() === 0) {
119
+        if ($stmt->rowCount() === 0) {
120 120
             $this->add_view($vidid, $user);
121 121
         }
122 122
     }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     }
130 130
 
131 131
     function get_comment_likes($reciever, $liked) {
132
-        if($liked) {
132
+        if ($liked) {
133 133
             $stmt = $this->__db->prepare("SELECT `sender` FROM comment_likes WHERE reciever = :reciever AND type = 'l'");
134 134
             $stmt->bindParam(":reciever", $reciever);
135 135
             $stmt->execute();
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     }
146 146
 
147 147
     function if_liked($user, $reciever, $liked) {
148
-        if($liked) {
148
+        if ($liked) {
149 149
             $stmt = $this->__db->prepare("SELECT `sender` FROM likes WHERE sender = :sender AND reciever = :reciever AND type = 'l'");
150 150
             $stmt->bindParam(":sender", $user);
151 151
             $stmt->bindParam(":reciever", $reciever);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     }
164 164
 
165 165
     function if_comment_liked($user, $reciever, $liked) {
166
-        if($liked) {
166
+        if ($liked) {
167 167
             $stmt = $this->__db->prepare("SELECT `sender` FROM comment_likes WHERE sender = :sender AND reciever = :reciever AND type = 'l'");
168 168
             $stmt->bindParam(":sender", $user);
169 169
             $stmt->bindParam(":reciever", $reciever);
Please login to merge, or discard this patch.
web/public/channel.php 2 patches
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  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");
@@ -26,21 +26,21 @@  discard block
 block discarded – undo
26 26
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
27 27
     }
28 28
 
29
-	function addhttp($url) {
30
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
31
-			$url = "http://" . $url;
32
-		}
33
-		return $url;
34
-	}
29
+    function addhttp($url) {
30
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
31
+            $url = "http://" . $url;
32
+        }
33
+        return $url;
34
+    }
35 35
 
36 36
     function check_valid_colorhex($colorCode) {
37 37
         // If user accidentally passed along the # sign, strip it off
38 38
         $colorCode = ltrim($colorCode, '#');
39 39
     
40 40
         if (
41
-              ctype_xdigit($colorCode) &&
41
+                ctype_xdigit($colorCode) &&
42 42
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
43
-                   return true;
43
+                    return true;
44 44
     
45 45
         else return false;
46 46
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7);
66 66
 
67 67
     $_user['genre'] = strtolower($_user['genre']);
68
-	$_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
68
+    $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
69 69
 
70 70
     if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
71 71
     if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
75 75
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
76 76
 
77
-	if(isset($_SESSION['siteusername']))
78
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
77
+    if(isset($_SESSION['siteusername']))
78
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
79 79
 
80 80
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
81 81
         $error = array();
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
90 90
 
91 91
         if(!isset($error['message'])) {
92
-			$text = $_POST['comment'];
92
+            $text = $_POST['comment'];
93 93
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
94
-			$stmt->bindParam(":id", $_user['username']);
95
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
96
-			$stmt->bindParam(":comment", $text);
94
+            $stmt->bindParam(":id", $_user['username']);
95
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
96
+            $stmt->bindParam(":comment", $text);
97 97
             $stmt->execute();
98 98
 
99 99
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
     }
106 106
 ?>
107 107
 <?php
108
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
109
-	$__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
110
-	$__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
111
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
108
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
109
+    $__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
110
+    $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
111
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
112 112
 ?>
113 113
 <!DOCTYPE html>
114 114
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -140,27 +140,27 @@  discard block
 block discarded – undo
140 140
 				background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>);
141 141
 				background-repeat: repeat;
142 142
 				<?php
143
-					switch($_user['2012_bgoption']) {
144
-						case "stretch":
145
-						echo "background-size: cover;";
146
-						break;
147
-						case "solid":
148
-						echo "";
149
-						break;
150
-						case "norepeat":
151
-						echo "";
152
-						break;
153
-						case "repeatxy":
154
-						echo "background-repeat: repeat;";
155
-						break;
156
-						case "repeaty":
157
-						echo "background-repeat: repeat-y;";
158
-						break;
159
-						case "repeatx":
160
-						echo "background-repeat: repeat-x;";
161
-						break;
162
-					}
163
-				?>
143
+                    switch($_user['2012_bgoption']) {
144
+                        case "stretch":
145
+                        echo "background-size: cover;";
146
+                        break;
147
+                        case "solid":
148
+                        echo "";
149
+                        break;
150
+                        case "norepeat":
151
+                        echo "";
152
+                        break;
153
+                        case "repeatxy":
154
+                        echo "background-repeat: repeat;";
155
+                        break;
156
+                        case "repeaty":
157
+                        echo "background-repeat: repeat-y;";
158
+                        break;
159
+                        case "repeatx":
160
+                        echo "background-repeat: repeat-x;";
161
+                        break;
162
+                    }
163
+                ?>
164 164
 			}
165 165
    		</style>
166 166
 		   <script>
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
189 189
 				<?php } ?>
190 190
 				<?php
191
-					if(empty(trim($_user['bio'])))
192
-						$_user['bio'] = "This user has no description.";
193
-				?>
191
+                    if(empty(trim($_user['bio'])))
192
+                        $_user['bio'] = "This user has no description.";
193
+                ?>
194 194
 				<div id="content">
195 195
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
196 196
 						<div class="content" id="recommended-channels-list"></div>
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
 													<h2>Featured Channels</h2>
537 537
 													<ul class="channel-summary-list ">
538 538
 														<?php 
539
-															foreach($_user['featured_channels'] as $user) {
540
-																if($__user_h->user_exists($user)) {
541
-														?>
539
+                                                            foreach($_user['featured_channels'] as $user) {
540
+                                                                if($__user_h->user_exists($user)) {
541
+                                                        ?>
542 542
 															<li class="yt-tile-visible yt-uix-tile">
543 543
 																<div class="channel-summary clearfix channel-summary-compact">
544 544
 																	<div class="channel-summary-thumb">
@@ -562,19 +562,19 @@  discard block
 block discarded – undo
562 562
 											</div>
563 563
 
564 564
 											<?php 
565
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
566
-												$stmt->bindParam(":search", $_user['username']);
567
-												$stmt->execute();
565
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
566
+                                                $stmt->bindParam(":search", $_user['username']);
567
+                                                $stmt->execute();
568 568
 
569
-												if($stmt->rowCount() != 0) {
570
-											?>
569
+                                                if($stmt->rowCount() != 0) {
570
+                                            ?>
571 571
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
572 572
 													<div class="module-view gh-featured">
573 573
 														<h2>Featured Playlists</h2>     
574 574
 														<?php
575
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
576
-															$playlist['videos'] = json_decode($playlist['videos']);
577
-														?> 
575
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
576
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
577
+                                                        ?> 
578 578
 															<div class="playlist yt-tile-visible yt-uix-tile">
579 579
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
580 580
 																<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   +34 added lines, -34 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']);
@@ -67,28 +67,28 @@  discard block
 block discarded – undo
67 67
     $_user['genre'] = strtolower($_user['genre']);
68 68
 	$_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
69 69
 
70
-    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
71
-    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
72
-    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
73
-    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
74
-    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
75
-    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
70
+    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
71
+    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
72
+    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
73
+    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
74
+    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
75
+    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
76 76
 
77
-	if(isset($_SESSION['siteusername']))
77
+	if (isset($_SESSION['siteusername']))
78 78
     	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
79 79
 
80
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
80
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
81 81
         $error = array();
82 82
 
83
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
84
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
85
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
83
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
84
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
85
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
86 86
         //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; }
87 87
         //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; }
88
-        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
+        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; }
89 89
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
90 90
 
91
-        if(!isset($error['message'])) {
91
+        if (!isset($error['message'])) {
92 92
 			$text = $_POST['comment'];
93 93
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
94 94
 			$stmt->bindParam(":id", $_user['username']);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
100 100
 
101
-            if(@$_SESSION['siteusername'] != $_user['username']) { 
101
+            if (@$_SESSION['siteusername'] != $_user['username']) { 
102 102
                 $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']);
103 103
             }
104 104
         }
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
 		<link rel="stylesheet" href="/yt/cssbin/www-extra.css">
137 137
 		<style>
138 138
 			#content-container {
139
-				background-color: <?php echo $_user['primary_color'];  ?>;
139
+				background-color: <?php echo $_user['primary_color']; ?>;
140 140
 				background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>);
141 141
 				background-repeat: repeat;
142 142
 				<?php
143
-					switch($_user['2012_bgoption']) {
143
+					switch ($_user['2012_bgoption']) {
144 144
 						case "stretch":
145 145
 						echo "background-size: cover;";
146 146
 						break;
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 			<div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div>
185 185
 			<div id="content-container">
186 186
 				<!-- begin content -->
187
-				<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
187
+				<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
188 188
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
189 189
 				<?php } ?>
190 190
 				<?php
191
-					if(empty(trim($_user['bio'])))
191
+					if (empty(trim($_user['bio'])))
192 192
 						$_user['bio'] = "This user has no description.";
193 193
 				?>
194 194
 				<div id="content">
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 												<h1><?php echo htmlspecialchars($_user['username']); ?></h1>
244 244
 											</div>
245 245
 											<div class="upper-left-section enable-fancy-subscribe-button">
246
-												<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
246
+												<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
247 247
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
248 248
 														<button 
249 249
 															href="#" 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 															title="" 
252 252
 															id="subscribe-button"
253 253
 															type="button" 
254
-															class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
254
+															class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
255 255
 															role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" 
256 256
 															src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
257 257
 														<span class="subscribed-label">Subscribed</span>
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 												<div class="header-stats">
273 273
 													<div class="stat-entry">
274 274
 														<span class="stat-value"><?php echo $_user['subscribers']; ?></span>
275
-														<span class="stat-name"><?php if($_user['subscribers'] == 1){ ?>subscriber<?php }else{ ?>subscribers<?php } ?></span>
275
+														<span class="stat-name"><?php if ($_user['subscribers'] == 1) { ?>subscriber<?php } else { ?>subscribers<?php } ?></span>
276 276
 													</div>
277 277
 													<div class="stat-entry">
278 278
 														<span class="stat-value"><?php echo $_user['views']; ?></span>
@@ -317,12 +317,12 @@  discard block
 block discarded – undo
317 317
 									</div>
318 318
 								</div>
319 319
 							</div>
320
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
320
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
321 321
 							<div id="branded-page-body">
322 322
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template">
323 323
 									<div class="tab-content-body">
324 324
 										<div class="primary-pane">
325
-                                            <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?>
325
+                                            <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?>
326 326
 											<div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge">
327 327
 												<div class="module-view featured-video-view-module">
328 328
 												<div id="watch-video" >
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 													<div class="playlist-info">
380 380
 														<h2>Uploaded videos</h2>
381 381
 														<div class="yt-horizontal-rule "><span class="first"></span><span class="second"></span><span class="third"></span></div>
382
-														<?php if($_user['videos'] == 0) { ?>
382
+														<?php if ($_user['videos'] == 0) { ?>
383 383
 															<h4>This user has not uploaded a video yet.</h4>
384 384
 														<?php } ?>
385 385
 													</div>
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                                                             $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
389 389
                                                             $stmt->bindParam(":username", $_user['username']);
390 390
                                                             $stmt->execute();
391
-                                                            while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
+                                                            while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
392 392
                                                         ?>
393 393
 														<li class="blogger-video">
394 394
 															<div class="video yt-tile-visible">
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 														</div>
471 471
 														<hr class="yt-horizontal-rule ">
472 472
 													</div>
473
-													<?php if(!empty($_user['website'])) { ?>
473
+													<?php if (!empty($_user['website'])) { ?>
474 474
 														<div class="user-profile-item">
475 475
 															<div class="yt-c3-profile-custom-url field-container ">
476 476
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 															<h5>Country</h5>
520 520
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
521 521
 														</div>
522
-														<?php if($_user['genre'] != "none") { ?>
522
+														<?php if ($_user['genre'] != "none") { ?>
523 523
 															<div class="user-profile-item ">
524 524
 																<h5>Channel Genre</h5>
525 525
 																<span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span>
@@ -531,13 +531,13 @@  discard block
 block discarded – undo
531 531
 											</div>
532 532
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
533 533
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
534
-												<?php if(count($_user['featured_channels']) != 0) { ?>
534
+												<?php if (count($_user['featured_channels']) != 0) { ?>
535 535
 												<div class="module-view other-channels-view">
536 536
 													<h2>Featured Channels</h2>
537 537
 													<ul class="channel-summary-list ">
538 538
 														<?php 
539
-															foreach($_user['featured_channels'] as $user) {
540
-																if($__user_h->user_exists($user)) {
539
+															foreach ($_user['featured_channels'] as $user) {
540
+																if ($__user_h->user_exists($user)) {
541 541
 														?>
542 542
 															<li class="yt-tile-visible yt-uix-tile">
543 543
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -566,13 +566,13 @@  discard block
 block discarded – undo
566 566
 												$stmt->bindParam(":search", $_user['username']);
567 567
 												$stmt->execute();
568 568
 
569
-												if($stmt->rowCount() != 0) {
569
+												if ($stmt->rowCount() != 0) {
570 570
 											?>
571 571
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
572 572
 													<div class="module-view gh-featured">
573 573
 														<h2>Featured Playlists</h2>     
574 574
 														<?php
575
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
575
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
576 576
 															$playlist['videos'] = json_decode($playlist['videos']);
577 577
 														?> 
578 578
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.