Test Failed
Push — main ( a0a7aa...e9fad0 )
by chief
03:33
created
web/public/uploaded_video.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(!$__video_h->video_exists($_GET['v']))
16
-		header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
15
+    if(!$__video_h->video_exists($_GET['v']))
16
+        header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
17 17
 
18
-	$_video = $__video_h->fetch_video_rid($_GET['v']); 
19
-	$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
20
-	$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
21
-	$_video['duration'] = $__time_h->timestamp($_video['duration']);
22
-	$_video['views'] = $__video_h->fetch_video_views($_video['rid']);
23
-	$_video['author'] = htmlspecialchars($_video['author']);		
24
-	$_video['title'] = htmlspecialchars($_video['title']);
25
-	$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
18
+    $_video = $__video_h->fetch_video_rid($_GET['v']); 
19
+    $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
20
+    $_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
21
+    $_video['duration'] = $__time_h->timestamp($_video['duration']);
22
+    $_video['views'] = $__video_h->fetch_video_views($_video['rid']);
23
+    $_video['author'] = htmlspecialchars($_video['author']);		
24
+    $_video['title'] = htmlspecialchars($_video['title']);
25
+    $_video['description'] = $__video_h->shorten_description($_video['description'], 50);
26 26
 
27 27
     if($_SESSION['siteusername'] != $_video['author'])
28 28
         header("Location: /");
29 29
 ?>
30 30
 <?php
31
-	$__server->page_embeds->page_title = "SubRocks - Uploaded Video";
32
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
33
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
34
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
31
+    $__server->page_embeds->page_title = "SubRocks - Uploaded Video";
32
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
33
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
34
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
35 35
 ?>
36 36
 <!DOCTYPE html>
37 37
 <html>
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -15,26 +15,26 @@  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(isset($_SESSION['siteusername']))
19
-		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
18
+    if(isset($_SESSION['siteusername']))
19
+        $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
20 20
 
21
-	$_SESSION['current_video'] = $_video['rid'];
21
+    $_SESSION['current_video'] = $_video['rid'];
22 22
 
23
-	/* 
23
+    /* 
24 24
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
25 25
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
26 26
 	Work on this tomorrow or some shit idk lol
27 27
 	*/
28 28
 
29
-	/* 
29
+    /* 
30 30
 	USE THE GOD DAMN __CONFIG MORE -- idiot
31 31
 	Work on this tomorrow or some shit
32 32
 	*/
33 33
 
34
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
35
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
36
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
37
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
34
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
35
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
36
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
37
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
38 38
 ?>
39 39
 <!DOCTYPE html>
40 40
 <html>
@@ -64,29 +64,29 @@  discard block
 block discarded – undo
64 64
          if (window.yt.timing) {yt.timing.tick("ct");}    
65 65
       </script>
66 66
 		<?php
67
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
68
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
67
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
68
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
69 69
 
70
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
71
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
70
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
71
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
72 72
 
73
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
74
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
73
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
74
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
75 75
 
76
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
77
-				$_video['likeswidth'] = 0;
78
-				$_video['dislikeswidth'] = 0;
79
-			} else {
80
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
81
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
82
-			}
76
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
77
+                $_video['likeswidth'] = 0;
78
+                $_video['dislikeswidth'] = 0;
79
+            } else {
80
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
81
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
82
+            }
83 83
 
84
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
85
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
86
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
87
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
88
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
89
-		?>
84
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
85
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
86
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
87
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
88
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
89
+        ?>
90 90
 	</head>
91 91
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
92 92
 		<form name="logoutForm" method="POST" action="/logout">
@@ -310,21 +310,21 @@  discard block
 block discarded – undo
310 310
 													<hr><br>
311 311
 													<h3>Add to a Playlist</h3>
312 312
 													<?php
313
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
314
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
315
-														$stmt->execute();
316
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
317
-															$buffer = json_decode($playlist['videos']);
318
-															@$rid = $buffer[0];
319
-															if(!empty($rid)) {
320
-																@$video = $__video_h->fetch_video_rid($rid);
321
-															} else {
322
-																$video['thumbnail'] = "";
323
-																$video['duration'] = 0;
324
-															}
313
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
314
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
315
+                                                        $stmt->execute();
316
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
317
+                                                            $buffer = json_decode($playlist['videos']);
318
+                                                            @$rid = $buffer[0];
319
+                                                            if(!empty($rid)) {
320
+                                                                @$video = $__video_h->fetch_video_rid($rid);
321
+                                                            } else {
322
+                                                                $video['thumbnail'] = "";
323
+                                                                $video['duration'] = 0;
324
+                                                            }
325 325
 
326
-															$videos = count($buffer);
327
-													?>
326
+                                                            $videos = count($buffer);
327
+                                                    ?>
328 328
 														<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>
329 329
 													<?php } ?>
330 330
 												<?php } ?>
@@ -589,10 +589,10 @@  discard block
 block discarded – undo
589 589
 												</div>
590 590
 											</div>
591 591
 											<?php 
592
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
593
-												$stmt->bindParam(":v", $_GET['v']);
594
-												$stmt->execute();
595
-											?>
592
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
593
+                                                $stmt->bindParam(":v", $_GET['v']);
594
+                                                $stmt->execute();
595
+                                            ?>
596 596
 
597 597
 											<?php if($stmt->rowCount() != 0) { ?>
598 598
 												<div class="comments-section">
@@ -602,16 +602,16 @@  discard block
 block discarded – undo
602 602
 													<h4>Video Responses</h4>
603 603
 													<ul class="video-list">
604 604
 													<?php 
605
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
606
-															if($__video_h->video_exists($video['video'])) { 
607
-																$video = $__video_h->fetch_video_rid($video['video']);
608
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
609
-																$video['duration'] = $__time_h->timestamp($video['duration']);
610
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
611
-																$video['author'] = htmlspecialchars($video['author']);		
612
-																$video['title'] = htmlspecialchars($video['title']);
613
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
614
-													?>
605
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
606
+                                                            if($__video_h->video_exists($video['video'])) { 
607
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
608
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
609
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
610
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
611
+                                                                $video['author'] = htmlspecialchars($video['author']);		
612
+                                                                $video['title'] = htmlspecialchars($video['title']);
613
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
614
+                                                    ?>
615 615
 														<li class="video-list-item yt-tile-default">
616 616
 															<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>
617 617
 															<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">
@@ -692,38 +692,38 @@  discard block
 block discarded – undo
692 692
 												</div>
693 693
 												<ul class="comment-list" id="live_comments">
694 694
 														<?php
695
-														$results_per_page = 20;
695
+                                                        $results_per_page = 20;
696 696
 
697
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
698
-														$stmt->bindParam(":rid", $_video['rid']);
699
-														$stmt->execute();
697
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
698
+                                                        $stmt->bindParam(":rid", $_video['rid']);
699
+                                                        $stmt->execute();
700 700
 
701
-														$number_of_result = $stmt->rowCount();
702
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
701
+                                                        $number_of_result = $stmt->rowCount();
702
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
703 703
 
704
-														if (!isset ($_GET['page']) ) {  
705
-															$page = 1;  
706
-														} else {  
707
-															$page = (int)$_GET['page'];  
708
-														}  
704
+                                                        if (!isset ($_GET['page']) ) {  
705
+                                                            $page = 1;  
706
+                                                        } else {  
707
+                                                            $page = (int)$_GET['page'];  
708
+                                                        }  
709 709
 
710
-														$page_first_result = ($page - 1) * $results_per_page;  
710
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
711 711
 
712
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
713
-														$stmt->bindParam(":rid", $_video['rid']);
714
-														$stmt->bindParam(":pfirst", $page_first_result);
715
-														$stmt->bindParam(":pper", $results_per_page);
716
-														$stmt->execute();
712
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
713
+                                                        $stmt->bindParam(":rid", $_video['rid']);
714
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
715
+                                                        $stmt->bindParam(":pper", $results_per_page);
716
+                                                        $stmt->execute();
717 717
 
718
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
719
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
720
-																$comment['liked'] = true;
721
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
722
-																$comment['disliked'] = true;
718
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
719
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
720
+                                                                $comment['liked'] = true;
721
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
722
+                                                                $comment['disliked'] = true;
723 723
 																
724
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
725
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
726
-													?>
724
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
725
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
726
+                                                    ?>
727 727
 
728 728
 														<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
729 729
 															<div class="comment-body">
@@ -789,12 +789,12 @@  discard block
 block discarded – undo
789 789
 															</div>
790 790
 														</li>
791 791
 														<?php 
792
-															$stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
793
-															$stmt2->bindParam(":rid", $comment['id']);
794
-															$stmt2->execute();
792
+                                                            $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
793
+                                                            $stmt2->bindParam(":rid", $comment['id']);
794
+                                                            $stmt2->execute();
795 795
 
796
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
797
-														?>
796
+                                                            while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
797
+                                                        ?>
798 798
 															<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">
799 799
 																<div class="comment-body">
800 800
 																	<div class="content-container">
@@ -875,16 +875,16 @@  discard block
 block discarded – undo
875 875
 											<ul id="watch-related" class="video-list">
876 876
 												<div id="ppv-container" class="hid"></div>
877 877
 												<?php
878
-													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
879
-													$stmt->execute();
880
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
881
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
882
-														$video['duration'] = $__time_h->timestamp($video['duration']);
883
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
884
-														$video['author'] = htmlspecialchars($video['author']);		
885
-														$video['title'] = htmlspecialchars($video['title']);
886
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
887
-												?>
878
+                                                    $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
879
+                                                    $stmt->execute();
880
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
881
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
882
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
883
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
884
+                                                        $video['author'] = htmlspecialchars($video['author']);		
885
+                                                        $video['title'] = htmlspecialchars($video['title']);
886
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
887
+                                                ?>
888 888
 												<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>
889 889
 													<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">
890 890
 													</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.