Test Failed
Pull Request — main (#26)
by
unknown
03:25
created
web/public/inbox/notifications.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php
12
-	$__server->page_embeds->page_title = "SubRocks - Notifications";
13
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
14
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
12
+    $__server->page_embeds->page_title = "SubRocks - Notifications";
13
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
14
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
16 16
 ?>
17 17
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
18 18
 <!DOCTYPE html>
Please login to merge, or discard this patch.
web/public/inbox/compose.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - Compose";
14
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
13
+    $__server->page_embeds->page_title = "SubRocks - Compose";
14
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <?php
19 19
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
Please login to merge, or discard this patch.
web/public/inbox/index.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 <?php $__time_h = new time_helper(); ?>
12 12
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13 13
 <?php
14
-	$__server->page_embeds->page_title = "SubRocks - Inbox";
15
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
16
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
17
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
14
+    $__server->page_embeds->page_title = "SubRocks - Inbox";
15
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
16
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
17
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
18 18
 ?>
19 19
 <!DOCTYPE html>
20 20
 <html dir="ltr">
Please login to merge, or discard this patch.
web/public/inbox/sent.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - Sent Messages";
14
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
13
+    $__server->page_embeds->page_title = "SubRocks - Sent Messages";
14
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  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
-	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
-		header("Location: /");
18
+    if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
+        header("Location: /");
20 20
 
21
-	if(isset($_SESSION['siteusername']))
22
-		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
21
+    if(isset($_SESSION['siteusername']))
22
+        $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
23 23
 
24
-	$_SESSION['current_video'] = $_video['rid'];
24
+    $_SESSION['current_video'] = $_video['rid'];
25 25
 
26
-	/* 
26
+    /* 
27 27
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
28 28
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
29 29
 	Work on this tomorrow or some shit idk lol
30 30
 	*/
31 31
 
32
-	/* 
32
+    /* 
33 33
 	USE THE GOD DAMN __CONFIG MORE -- idiot
34 34
 	Work on this tomorrow or some shit
35 35
 	*/
36 36
 
37
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
38
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
39
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
40
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
37
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
38
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
39
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
40
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
41 41
 ?>
42 42
 <!DOCTYPE html>
43 43
 <html>
@@ -67,29 +67,29 @@  discard block
 block discarded – undo
67 67
          if (window.yt.timing) {yt.timing.tick("ct");}    
68 68
       </script>
69 69
 		<?php
70
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
71
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
70
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
71
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
72 72
 
73
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
74
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
73
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
74
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
75 75
 
76
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
77
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
76
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
77
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
78 78
 
79
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
80
-				$_video['likeswidth'] = 0;
81
-				$_video['dislikeswidth'] = 0;
82
-			} else {
83
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
84
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
85
-			}
79
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
80
+                $_video['likeswidth'] = 0;
81
+                $_video['dislikeswidth'] = 0;
82
+            } else {
83
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
84
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
85
+            }
86 86
 
87
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
88
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
89
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
90
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
91
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
92
-		?>
87
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
88
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
89
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
90
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
91
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
92
+        ?>
93 93
 	</head>
94 94
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
95 95
 		<form name="logoutForm" method="POST" action="/logout">
@@ -333,21 +333,21 @@  discard block
 block discarded – undo
333 333
 													<hr><br>
334 334
 													<h3>Add to a Playlist</h3>
335 335
 													<?php
336
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
337
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
338
-														$stmt->execute();
339
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
340
-															$buffer = json_decode($playlist['videos']);
341
-															@$rid = $buffer[0];
342
-															if(!empty($rid)) {
343
-																@$video = $__video_h->fetch_video_rid($rid);
344
-															} else {
345
-																$video['thumbnail'] = "";
346
-																$video['duration'] = 0;
347
-															}
336
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
337
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
338
+                                                        $stmt->execute();
339
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
340
+                                                            $buffer = json_decode($playlist['videos']);
341
+                                                            @$rid = $buffer[0];
342
+                                                            if(!empty($rid)) {
343
+                                                                @$video = $__video_h->fetch_video_rid($rid);
344
+                                                            } else {
345
+                                                                $video['thumbnail'] = "";
346
+                                                                $video['duration'] = 0;
347
+                                                            }
348 348
 
349
-															$videos = count($buffer);
350
-													?>
349
+                                                            $videos = count($buffer);
350
+                                                    ?>
351 351
 														<a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a><br>
352 352
 													<?php } ?>
353 353
 												<?php } ?>
@@ -612,10 +612,10 @@  discard block
 block discarded – undo
612 612
 												</div>
613 613
 											</div>
614 614
 											<?php 
615
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
616
-												$stmt->bindParam(":v", $_GET['v']);
617
-												$stmt->execute();
618
-											?>
615
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
616
+                                                $stmt->bindParam(":v", $_GET['v']);
617
+                                                $stmt->execute();
618
+                                            ?>
619 619
 
620 620
 											<?php if($stmt->rowCount() != 0) { ?>
621 621
 												<div class="comments-section">
@@ -625,16 +625,16 @@  discard block
 block discarded – undo
625 625
 													<h4>Video Responses</h4>
626 626
 													<ul class="video-list">
627 627
 													<?php 
628
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
629
-															if($__video_h->video_exists($video['video'])) { 
630
-																$video = $__video_h->fetch_video_rid($video['video']);
631
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
632
-																$video['duration'] = $__time_h->timestamp($video['duration']);
633
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
634
-																$video['author'] = htmlspecialchars($video['author']);		
635
-																$video['title'] = htmlspecialchars($video['title']);
636
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
637
-													?>
628
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
629
+                                                            if($__video_h->video_exists($video['video'])) { 
630
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
631
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
632
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
633
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
634
+                                                                $video['author'] = htmlspecialchars($video['author']);		
635
+                                                                $video['title'] = htmlspecialchars($video['title']);
636
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
637
+                                                    ?>
638 638
 														<li class="video-list-item yt-tile-default">
639 639
 															<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>
640 640
 															<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">
@@ -715,38 +715,38 @@  discard block
 block discarded – undo
715 715
 												</div>
716 716
 												<ul class="comment-list" id="live_comments">
717 717
 														<?php
718
-														$results_per_page = 20;
718
+                                                        $results_per_page = 20;
719 719
 
720
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
721
-														$stmt->bindParam(":rid", $_video['rid']);
722
-														$stmt->execute();
720
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
721
+                                                        $stmt->bindParam(":rid", $_video['rid']);
722
+                                                        $stmt->execute();
723 723
 
724
-														$number_of_result = $stmt->rowCount();
725
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
724
+                                                        $number_of_result = $stmt->rowCount();
725
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
726 726
 
727
-														if (!isset ($_GET['page']) ) {  
728
-															$page = 1;  
729
-														} else {  
730
-															$page = (int)$_GET['page'];  
731
-														}  
727
+                                                        if (!isset ($_GET['page']) ) {  
728
+                                                            $page = 1;  
729
+                                                        } else {  
730
+                                                            $page = (int)$_GET['page'];  
731
+                                                        }  
732 732
 
733
-														$page_first_result = ($page - 1) * $results_per_page;  
733
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
734 734
 
735
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
736
-														$stmt->bindParam(":rid", $_video['rid']);
737
-														$stmt->bindParam(":pfirst", $page_first_result);
738
-														$stmt->bindParam(":pper", $results_per_page);
739
-														$stmt->execute();
735
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
736
+                                                        $stmt->bindParam(":rid", $_video['rid']);
737
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
738
+                                                        $stmt->bindParam(":pper", $results_per_page);
739
+                                                        $stmt->execute();
740 740
 
741
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
742
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
743
-																$comment['liked'] = true;
744
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
745
-																$comment['disliked'] = true;
741
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
742
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
743
+                                                                $comment['liked'] = true;
744
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
745
+                                                                $comment['disliked'] = true;
746 746
 																
747
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
748
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
749
-													?>
747
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
748
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
749
+                                                    ?>
750 750
 
751 751
 														<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
752 752
 															<div class="comment-body">
@@ -812,12 +812,12 @@  discard block
 block discarded – undo
812 812
 															</div>
813 813
 														</li>
814 814
 														<?php 
815
-															$stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
816
-															$stmt2->bindParam(":rid", $comment['id']);
817
-															$stmt2->execute();
815
+                                                            $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
816
+                                                            $stmt2->bindParam(":rid", $comment['id']);
817
+                                                            $stmt2->execute();
818 818
 
819
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
820
-														?>
819
+                                                            while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
820
+                                                        ?>
821 821
 															<li class="comment yt-tile-default " style="padding-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0">
822 822
 																<div class="comment-body">
823 823
 																	<div class="content-container">
@@ -898,16 +898,16 @@  discard block
 block discarded – undo
898 898
 											<ul id="watch-related" class="video-list">
899 899
 												<div id="ppv-container" class="hid"></div>
900 900
 												<?php
901
-													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
902
-													$stmt->execute();
903
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
904
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
905
-														$video['duration'] = $__time_h->timestamp($video['duration']);
906
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
907
-														$video['author'] = htmlspecialchars($video['author']);		
908
-														$video['title'] = htmlspecialchars($video['title']);
909
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
910
-												?>
901
+                                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
902
+                                                    $stmt->execute();
903
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
904
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
905
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
906
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
907
+                                                        $video['author'] = htmlspecialchars($video['author']);		
908
+                                                        $video['title'] = htmlspecialchars($video['title']);
909
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
910
+                                                ?>
911 911
 												<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.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>
912 912
 													<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">
913 913
 													</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.
web/public/d/edit_video.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         "description" => $_POST['description'],
24 24
         "tags" => $_POST['tags'],
25 25
         "privacy" => $_POST['privacy'],
26
-         /* 
26
+            /* 
27 27
             Public   : n
28 28
             Unlisted : u
29 29
             Private  : v
Please login to merge, or discard this patch.
web/public/index.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	$__server->page_embeds->page_title = "SubRocks - Homepage";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
11
+    $__server->page_embeds->page_title = "SubRocks - Homepage";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16 16
 <!DOCTYPE html>
17 17
 <html>
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 							</div>
62 62
 							<div class="guide">
63 63
 							<?php 
64
-								if(isset($_SESSION['siteusername'])) {
65
-								?>
64
+                                if(isset($_SESSION['siteusername'])) {
65
+                                ?>
66 66
 								<div style="/*! margin-top: 0px; *//*! margin-left: 10px; *//*! margin-bottom: 13px; */height: 99px;" class="guide-section feed-header channel first"><img alt="" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_SESSION['siteusername']); ?>" style="height: 88px;position: relative;top: 4px;left: 4px;" class="feed-header-thumb channel-thumb" width="88px"><div id="links" style="/*! margin-left: 5px; */position: relative;left: 13px;top: 7px;"><div style="font-size: 11px;margin-bottom: 6px;" class="metadata">
67 67
 								<a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel
68 68
 								<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="see-more-arrow" alt=""></a>        
@@ -225,16 +225,16 @@  discard block
 block discarded – undo
225 225
 							</p>
226 226
 							<ul>
227 227
 								<?php
228
-									$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
229
-									$stmt->execute();
230
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
231
-										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
232
-										$video['duration'] = $__time_h->timestamp($video['duration']);
233
-										$video['views'] = $__video_h->fetch_video_views($video['rid']);
234
-										$video['author'] = htmlspecialchars($video['author']);		
235
-										$video['title'] = htmlspecialchars($video['title']);
236
-										$video['description'] = $__video_h->shorten_description($video['description'], 50);
237
-								?>
228
+                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
229
+                                    $stmt->execute();
230
+                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
231
+                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
232
+                                        $video['duration'] = $__time_h->timestamp($video['duration']);
233
+                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
234
+                                        $video['author'] = htmlspecialchars($video['author']);		
235
+                                        $video['title'] = htmlspecialchars($video['title']);
236
+                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
237
+                                ?>
238 238
 								<li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $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>
239 239
 									<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="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
240 240
 									</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
@@ -248,16 +248,16 @@  discard block
 block discarded – undo
248 248
 							</h3>
249 249
 							<ul>
250 250
 								<?php
251
-									$stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
252
-									$stmt->execute();
253
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
254
-										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
255
-										$video['duration'] = $__time_h->timestamp($video['duration']);
256
-										$video['views'] = $__video_h->fetch_video_views($video['rid']);
257
-										$video['author'] = htmlspecialchars($video['author']);		
258
-										$video['title'] = htmlspecialchars($video['title']);
259
-										$video['description'] = $__video_h->shorten_description($video['description'], 50);
260
-								?>
251
+                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
252
+                                    $stmt->execute();
253
+                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
254
+                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
255
+                                        $video['duration'] = $__time_h->timestamp($video['duration']);
256
+                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
257
+                                        $video['author'] = htmlspecialchars($video['author']);		
258
+                                        $video['title'] = htmlspecialchars($video['title']);
259
+                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
260
+                                ?>
261 261
 								<li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $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>
262 262
 									<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="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
263 263
 									</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
@@ -281,16 +281,16 @@  discard block
 block discarded – undo
281 281
 									<div class="feed-page">
282 282
 										<ul>
283 283
 											<?php
284
-												$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
285
-												$stmt->execute();
286
-												while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
287
-													$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
288
-													$video['duration'] = $__time_h->timestamp($video['duration']);
289
-													$video['views'] = $__video_h->fetch_video_views($video['rid']);
290
-													$video['author'] = htmlspecialchars($video['author']);		
291
-													$video['title'] = htmlspecialchars($video['title']);
292
-													$video['description'] = $__video_h->shorten_description($video['description'], 50);
293
-											?>
284
+                                                $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
285
+                                                $stmt->execute();
286
+                                                while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
287
+                                                    $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
288
+                                                    $video['duration'] = $__time_h->timestamp($video['duration']);
289
+                                                    $video['views'] = $__video_h->fetch_video_views($video['rid']);
290
+                                                    $video['author'] = htmlspecialchars($video['author']);		
291
+                                                    $video['title'] = htmlspecialchars($video['title']);
292
+                                                    $video['description'] = $__video_h->shorten_description($video['description'], 50);
293
+                                            ?>
294 294
 											<li>
295 295
 												<div class="feed-item-container first " data-channel-key="UCR2A9ZNliJfgC66IvIpe-Zw">
296 296
 													<div class="feed-author-bubble-container">
Please login to merge, or discard this patch.
web/public/channel.php 1 patch
Indentation   +58 added lines, -58 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['2012_bgcolor'] = substr($_user['2012_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['2012_bgcolor']) && strlen($_user['2012_bgcolor']) != 6) { $_user['2012_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['2012_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 "background-repeat: no-repeat !important;";
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 "background-repeat: no-repeat !important;";
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>
@@ -535,13 +535,13 @@  discard block
 block discarded – undo
535 535
 												<div class="module-view other-channels-view">
536 536
 													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
537 537
 													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
538
-														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';return false;'>edit</a>"; 
539
-													} ?>
538
+                                                        echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';return false;'>edit</a>"; 
539
+                                                    } ?>
540 540
 													<ul class="channel-summary-list ">
541 541
 														<?php 
542
-															foreach($_user['featured_channels'] as $user) {
543
-																if($__user_h->user_exists($user)) {
544
-														?>
542
+                                                            foreach($_user['featured_channels'] as $user) {
543
+                                                                if($__user_h->user_exists($user)) {
544
+                                                        ?>
545 545
 															<li class="yt-tile-visible yt-uix-tile">
546 546
 																<div class="channel-summary clearfix channel-summary-compact">
547 547
 																	<div class="channel-summary-thumb">
@@ -565,19 +565,19 @@  discard block
 block discarded – undo
565 565
 											</div>
566 566
 
567 567
 											<?php 
568
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
569
-												$stmt->bindParam(":search", $_user['username']);
570
-												$stmt->execute();
568
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
569
+                                                $stmt->bindParam(":search", $_user['username']);
570
+                                                $stmt->execute();
571 571
 
572
-												if($stmt->rowCount() != 0) {
573
-											?>
572
+                                                if($stmt->rowCount() != 0) {
573
+                                            ?>
574 574
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
575 575
 													<div class="module-view gh-featured">
576 576
 														<h2>Featured Playlists</h2>     
577 577
 														<?php
578
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
579
-															$playlist['videos'] = json_decode($playlist['videos']);
580
-														?> 
578
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
579
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
580
+                                                        ?> 
581 581
 															<div class="playlist yt-tile-visible yt-uix-tile">
582 582
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
583 583
 																<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.