Test Failed
Push — main ( 594560...d41f84 )
by chief
05:05 queued 02:09
created
web/public/watch.php 1 patch
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -15,28 +15,28 @@  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
-	$__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
21
+    $__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
22 22
 
23
-	$_SESSION['current_video'] = $_video['rid'];
23
+    $_SESSION['current_video'] = $_video['rid'];
24 24
 
25
-	/* 
25
+    /* 
26 26
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
27 27
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
28 28
 	Work on this tomorrow or some shit idk lol
29 29
 	*/
30 30
 
31
-	/* 
31
+    /* 
32 32
 	USE THE GOD DAMN __CONFIG MORE -- idiot
33 33
 	Work on this tomorrow or some shit
34 34
 	*/
35 35
 
36
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
37
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
38
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
39
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
36
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
37
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
38
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
39
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
40 40
 ?>
41 41
 <!DOCTYPE html>
42 42
 <html>
@@ -66,29 +66,29 @@  discard block
 block discarded – undo
66 66
          if (window.yt.timing) {yt.timing.tick("ct");}    
67 67
       </script>
68 68
 		<?php
69
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
70
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
69
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
70
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
71 71
 
72
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
73
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
72
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
73
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
74 74
 
75
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
76
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
75
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
76
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
77 77
 
78
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79
-				$_video['likeswidth'] = 0;
80
-				$_video['dislikeswidth'] = 0;
81
-			} else {
82
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
83
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
84
-			}
78
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79
+                $_video['likeswidth'] = 0;
80
+                $_video['dislikeswidth'] = 0;
81
+            } else {
82
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
83
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
84
+            }
85 85
 
86
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
87
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
88
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
89
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
90
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
91
-		?>
86
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
87
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
88
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
89
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
90
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
91
+        ?>
92 92
 	</head>
93 93
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
94 94
 		<form name="logoutForm" method="POST" action="/logout">
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
 
157 157
 									<?php $_user = $__user_h->fetch_user_username($_video['author']); ?>
158 158
 									<?php
159
-										$stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip");
160
-										$stmt->bindParam(":ip", $_user['ip']);
161
-										$stmt->execute();
162
-										$alts = $stmt->rowCount();
159
+                                        $stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip");
160
+                                        $stmt->bindParam(":ip", $_user['ip']);
161
+                                        $stmt->execute();
162
+                                        $alts = $stmt->rowCount();
163 163
 
164
-										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
164
+                                        if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
165 165
 
166
-										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168
-												echo "
166
+                                        while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
+                                            if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168
+                                                echo "
169 169
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
170
-													htmlspecialchars($username['username']) 
171
-												. "</a><br>";
172
-										}
173
-									?>
170
+                                                    htmlspecialchars($username['username']) 
171
+                                                . "</a><br>";
172
+                                        }
173
+                                    ?>
174 174
 									<hr>
175 175
 								<?php } ?>
176 176
 								<h1 id="watch-headline-title">
@@ -384,21 +384,21 @@  discard block
 block discarded – undo
384 384
 													<hr><br>
385 385
 													<h3>Add to a Playlist</h3>
386 386
 													<?php
387
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
388
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
389
-														$stmt->execute();
390
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
-															$buffer = json_decode($playlist['videos']);
392
-															@$rid = $buffer[0];
393
-															if(!empty($rid)) {
394
-																@$video = $__video_h->fetch_video_rid($rid);
395
-															} else {
396
-																$video['thumbnail'] = "";
397
-																$video['duration'] = 0;
398
-															}
387
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
388
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
389
+                                                        $stmt->execute();
390
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
+                                                            $buffer = json_decode($playlist['videos']);
392
+                                                            @$rid = $buffer[0];
393
+                                                            if(!empty($rid)) {
394
+                                                                @$video = $__video_h->fetch_video_rid($rid);
395
+                                                            } else {
396
+                                                                $video['thumbnail'] = "";
397
+                                                                $video['duration'] = 0;
398
+                                                            }
399 399
 
400
-															$videos = count($buffer);
401
-													?>
400
+                                                            $videos = count($buffer);
401
+                                                    ?>
402 402
 														<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>
403 403
 													<?php } ?>
404 404
 												<?php } ?>
@@ -663,10 +663,10 @@  discard block
 block discarded – undo
663 663
 												</div>
664 664
 											</div>
665 665
 											<?php 
666
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
667
-												$stmt->bindParam(":v", $_GET['v']);
668
-												$stmt->execute();
669
-											?>
666
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
667
+                                                $stmt->bindParam(":v", $_GET['v']);
668
+                                                $stmt->execute();
669
+                                            ?>
670 670
 
671 671
 											<?php if($stmt->rowCount() != 0) { ?>
672 672
 												<div class="comments-section">
@@ -676,16 +676,16 @@  discard block
 block discarded – undo
676 676
 													<h4>Video Responses</h4>
677 677
 													<ul class="video-list">
678 678
 													<?php 
679
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
-															if($__video_h->video_exists($video['video'])) { 
681
-																$video = $__video_h->fetch_video_rid($video['video']);
682
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
683
-																$video['duration'] = $__time_h->timestamp($video['duration']);
684
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
685
-																$video['author'] = htmlspecialchars($video['author']);		
686
-																$video['title'] = htmlspecialchars($video['title']);
687
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
688
-													?>
679
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
+                                                            if($__video_h->video_exists($video['video'])) { 
681
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
682
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
683
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
684
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
685
+                                                                $video['author'] = htmlspecialchars($video['author']);		
686
+                                                                $video['title'] = htmlspecialchars($video['title']);
687
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
688
+                                                    ?>
689 689
 														<li class="video-list-item yt-tile-default">
690 690
 															<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>
691 691
 															<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">
@@ -766,38 +766,38 @@  discard block
 block discarded – undo
766 766
 												</div>
767 767
 												<ul class="comment-list" id="live_comments">
768 768
 														<?php
769
-														$results_per_page = 20;
769
+                                                        $results_per_page = 20;
770 770
 
771
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
772
-														$stmt->bindParam(":rid", $_video['rid']);
773
-														$stmt->execute();
771
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
772
+                                                        $stmt->bindParam(":rid", $_video['rid']);
773
+                                                        $stmt->execute();
774 774
 
775
-														$number_of_result = $stmt->rowCount();
776
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
775
+                                                        $number_of_result = $stmt->rowCount();
776
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
777 777
 
778
-														if (!isset ($_GET['page']) ) {  
779
-															$page = 1;  
780
-														} else {  
781
-															$page = (int)$_GET['page'];  
782
-														}  
778
+                                                        if (!isset ($_GET['page']) ) {  
779
+                                                            $page = 1;  
780
+                                                        } else {  
781
+                                                            $page = (int)$_GET['page'];  
782
+                                                        }  
783 783
 
784
-														$page_first_result = ($page - 1) * $results_per_page;  
784
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
785 785
 
786
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
787
-														$stmt->bindParam(":rid", $_video['rid']);
788
-														$stmt->bindParam(":pfirst", $page_first_result);
789
-														$stmt->bindParam(":pper", $results_per_page);
790
-														$stmt->execute();
786
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
787
+                                                        $stmt->bindParam(":rid", $_video['rid']);
788
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
789
+                                                        $stmt->bindParam(":pper", $results_per_page);
790
+                                                        $stmt->execute();
791 791
 
792
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794
-																$comment['liked'] = true;
795
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796
-																$comment['disliked'] = true;
792
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794
+                                                                $comment['liked'] = true;
795
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796
+                                                                $comment['disliked'] = true;
797 797
 																
798
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
799
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
800
-													?>
798
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
799
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
800
+                                                    ?>
801 801
 
802 802
 														<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
803 803
 															<div class="comment-body">
@@ -863,12 +863,12 @@  discard block
 block discarded – undo
863 863
 															</div>
864 864
 														</li>
865 865
 														<?php 
866
-															$stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
867
-															$stmt2->bindParam(":rid", $comment['id']);
868
-															$stmt2->execute();
866
+                                                            $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
867
+                                                            $stmt2->bindParam(":rid", $comment['id']);
868
+                                                            $stmt2->execute();
869 869
 
870
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
871
-														?>
870
+                                                            while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
871
+                                                        ?>
872 872
 															<li class="comment yt-tile-default " style="margin-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0">
873 873
 																<div class="comment-body">
874 874
 																	<div class="content-container">
@@ -948,19 +948,19 @@  discard block
 block discarded – undo
948 948
 										<div id="watch-related-container" class="watch-sidebar-body">
949 949
 											<ul id="watch-related" class="video-list">
950 950
 												<?php
951
-													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
952
-													$stmt->execute();
953
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
954
-														$_playlist['videos'] = json_decode($_playlist['videos']);
955
-														$_playlist['count'] = 1;
951
+                                                    $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
952
+                                                    $stmt->execute();
953
+                                                    while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
954
+                                                        $_playlist['videos'] = json_decode($_playlist['videos']);
955
+                                                        $_playlist['count'] = 1;
956 956
 
957
-														if($__video_h->video_exists($_playlist['videos'][0])) {
958
-															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
959
-														} else {
960
-															$video = [];
961
-															$video['thumbnail'] = "default.jpg";
962
-														}
963
-												?>
957
+                                                        if($__video_h->video_exists($_playlist['videos'][0])) {
958
+                                                            $video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
959
+                                                        } else {
960
+                                                            $video = [];
961
+                                                            $video['thumbnail'] = "default.jpg";
962
+                                                        }
963
+                                                ?>
964 964
 												<li class="video-list-item">
965 965
 													<a href="/view_playlist?v=<?php echo $_playlist['rid']; ?>" class="related-playlist yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="ved=CAMQzhooAA%3D%3D&amp;ei=CKf4md_r7rMCFYMfRAodLGlRiA%3D%3D&amp;feature=list_other">
966 966
 														<span class="ux-thumb-wrap">
@@ -1007,16 +1007,16 @@  discard block
 block discarded – undo
1007 1007
 												<?php } ?>
1008 1008
 												<div id="ppv-container" class="hid"></div>
1009 1009
 												<?php
1010
-													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1011
-													$stmt->execute();
1012
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1013
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1014
-														$video['duration'] = $__time_h->timestamp($video['duration']);
1015
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
1016
-														$video['author'] = htmlspecialchars($video['author']);		
1017
-														$video['title'] = htmlspecialchars($video['title']);
1018
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
1019
-												?>
1010
+                                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1011
+                                                    $stmt->execute();
1012
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1013
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1014
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
1015
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
1016
+                                                        $video['author'] = htmlspecialchars($video['author']);		
1017
+                                                        $video['title'] = htmlspecialchars($video['title']);
1018
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
1019
+                                                ?>
1020 1020
 												<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>
1021 1021
 													<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">
1022 1022
 													</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.