Test Failed
Push — main ( bc8e2c...7e4e6e )
by chief
03:43 queued 14s
created
web/public/get/feature_video.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
15
-    if(!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15
+    if (!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
16 16
 
17 17
     $request = (object) [
18 18
         "video" => $_GET['v'],
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
 <?php $__user_u = new user_update($__db); ?>
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
18
+	if ($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19 19
 		header("Location: /");
20 20
 
21
-	if(isset($_SESSION['siteusername']))
21
+	if (isset($_SESSION['siteusername']))
22 22
 		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
23 23
 
24 24
 	$_SESSION['current_video'] = $_video['rid'];
@@ -67,20 +67,20 @@  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);
70
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
71 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 76
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
77 77
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
78 78
 
79
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
80 80
 				$_video['likeswidth'] = 0;
81 81
 				$_video['dislikeswidth'] = 0;
82 82
 			} else {
83
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
83
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
84 84
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
85 85
 			}
86 86
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 									</div>
115 115
 									<div id="instream_google_companion_ad_div"></div>
116 116
 								</div>
117
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
117
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
118 118
 									<div id="watch-owner-container">
119 119
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
120 120
 											<ul class="yt-nav-aside">
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 										</div>
134 134
 									</div><br>
135 135
 								<?php } ?>
136
-								<?php if($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?>
136
+								<?php if ($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?>
137 137
 									<div id="watch-owner-container">
138 138
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
139 139
 											<ul class="yt-nav-aside">
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 										$stmt->execute();
163 163
 										$alts = $stmt->rowCount();
164 164
 
165
-										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
165
+										if ($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
166 166
 
167
-										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
168
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
167
+										while ($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
168
+											if ($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
169 169
 												echo "
170 170
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
171 171
 													htmlspecialchars($username['username']) 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 											title="" 
191 191
 											id="subscribe-button"
192 192
 											type="button" 
193
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
193
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
194 194
 											role="button">
195 195
 											<span class="yt-uix-button-icon-wrapper">
196 196
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 						<div id="watch-main-container">
249 249
 							<div id="watch-main">
250 250
 								<div id="watch-panel">
251
-									<?php if($_video['featured'] == "v") { ?>
251
+									<?php if ($_video['featured'] == "v") { ?>
252 252
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn">  <div class="yt-alert-icon">
253 253
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
254 254
 										</div>
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 										</div></div></div>
260 260
 									<?php }  ?>
261 261
 
262
-	  								<?php if($_video['visibility'] == "u") { ?>
262
+	  								<?php if ($_video['visibility'] == "u") { ?>
263 263
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn">  <div class="yt-alert-icon">
264 264
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
265 265
 										</div>
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 												This video is unlisted. Only people who have the link can view this video.
269 269
 											</div>
270 270
 										</div></div></div>
271
-									<?php } else if($_video['visibility'] == "v") { ?>
271
+									<?php } else if ($_video['visibility'] == "v") { ?>
272 272
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
273 273
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
274 274
 										</div>
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 											<button onclick=";window.location.href=this.getAttribute('href');return false;" href="/get/like_video?v=<?php echo $_video['rid']; ?>"
303 303
 											title="I like this" 
304 304
 											type="button" 
305
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
305
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
306 306
 											id="watch-like"  
307 307
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
308 308
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 											type="button" 
317 317
 											style="margin-left: -2px;"
318 318
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
319
-											class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
319
+											class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
320 320
 											id="watch-unlike" 
321 321
 											role="button">
322 322
 												<span class="yt-uix-button-icon-wrapper">
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 												</div>
337 337
 											</div>
338 338
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
339
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
339
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
340 340
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
341 341
 													<div class="yt-alert-icon">
342 342
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 												<?php } else { ?>
353 353
 													<h3>Be friends with the creator</h3>
354 354
 
355
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
355
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
356 356
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
357 357
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
358 358
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -366,8 +366,8 @@  discard block
 block discarded – undo
366 366
 														</span><br><br>
367 367
 													<?php } ?>
368 368
 
369
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
370
-														<?php if($_video['friended'] == false) { ?>
369
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
370
+														<?php if ($_video['friended'] == false) { ?>
371 371
 															<a href="/friends">Send a friend request</a>
372 372
 														<?php } else { ?>
373 373
 															Your friend request is pending.
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 													<?php } ?>
378 378
 													<hr><br>
379 379
 													<h3>Add to Favorites</h3>
380
-													<?php if($_video['favorited'] == false) { ?>
380
+													<?php if ($_video['favorited'] == false) { ?>
381 381
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
382 382
 													<?php } else { ?>
383 383
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -388,10 +388,10 @@  discard block
 block discarded – undo
388 388
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
389 389
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
390 390
 														$stmt->execute();
391
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
392 392
 															$buffer = json_decode($playlist['videos']);
393 393
 															@$rid = $buffer[0];
394
-															if(!empty($rid)) {
394
+															if (!empty($rid)) {
395 395
 																@$video = $__video_h->fetch_video_rid($rid);
396 396
 															} else {
397 397
 																$video['thumbnail'] = "";
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
 												$stmt->execute();
670 670
 											?>
671 671
 
672
-											<?php if($stmt->rowCount() != 0) { ?>
672
+											<?php if ($stmt->rowCount() != 0) { ?>
673 673
 												<div class="comments-section">
674 674
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
675 675
 													see all
@@ -677,8 +677,8 @@  discard block
 block discarded – undo
677 677
 													<h4>Video Responses</h4>
678 678
 													<ul class="video-list">
679 679
 													<?php 
680
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
681
-															if($__video_h->video_exists($video['video'])) { 
680
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
681
+															if ($__video_h->video_exists($video['video'])) { 
682 682
 																$video = $__video_h->fetch_video_rid($video['video']);
683 683
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
684 684
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -709,18 +709,18 @@  discard block
 block discarded – undo
709 709
 														</h4>
710 710
 													</div>
711 711
 												</div>
712
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
712
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
713 713
 													<div class="comments-post-container clearfix">
714 714
 														<div class="comments-post-alert">
715 715
 															<a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span>
716 716
 														</div>
717 717
 													</div>
718
-												<?php } else if($_video['commenting'] == "d") { ?>
718
+												<?php } else if ($_video['commenting'] == "d") { ?>
719 719
 													<div class="comments-disabled-message">
720 720
 														<img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png">
721 721
 														<span>Adding comments has been disabled for this video.</span>
722 722
 													</div>
723
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
723
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
724 724
 													<div class="comments-post-container clearfix">
725 725
 														<div class="comments-post-alert">
726 726
 															This user has blocked you!
@@ -774,15 +774,15 @@  discard block
 block discarded – undo
774 774
 														$stmt->execute();
775 775
 
776 776
 														$number_of_result = $stmt->rowCount();
777
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
777
+														$number_of_page = ceil($number_of_result/$results_per_page);  
778 778
 
779
-														if (!isset ($_GET['page']) ) {  
779
+														if (!isset ($_GET['page'])) {  
780 780
 															$page = 1;  
781 781
 														} else {  
782
-															$page = (int)$_GET['page'];  
782
+															$page = (int) $_GET['page'];  
783 783
 														}  
784 784
 
785
-														$page_first_result = ($page - 1) * $results_per_page;  
785
+														$page_first_result = ($page - 1)*$results_per_page;  
786 786
 
787 787
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
788 788
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -790,10 +790,10 @@  discard block
 block discarded – undo
790 790
 														$stmt->bindParam(":pper", $results_per_page);
791 791
 														$stmt->execute();
792 792
 
793
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
794
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
793
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
794
+															if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
795 795
 																$comment['liked'] = true;
796
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796
+															else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
797 797
 																$comment['disliked'] = true;
798 798
 																
799 799
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 																			<span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span>
816 816
 																			</span>
817 817
 																			</span></span>
818
-																			<?php if($comment['likes'] != 0) { ?>
818
+																			<?php if ($comment['likes'] != 0) { ?>
819 819
 																			<span dir="ltr" class="comments-rating-positive" title="9 up, 1 down">
820 820
 																				<?php echo $comment['likes']; ?>
821 821
 																				<img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif">
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
 																			</button>
844 844
 																		</span>
845 845
 																	</div>
846
-																<?php if(isset($_SESSION['siteusername'])) { ?> 
846
+																<?php if (isset($_SESSION['siteusername'])) { ?> 
847 847
 																	<li id="reply_to_<?php echo $comment['id']; ?>" style="display: none;" class="comment yt-tile-default  child" data-tag="O" data-author-viewing="" data-id="iRV7EkT9us81mDLFDSB6FAsB156Fdn13HUmTm26C3PE" data-score="34" data-author="<?php echo htmlspecialchars($row['author']); ?>">
848 848
 
849 849
 																	<div class="comment-body">
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 															$stmt2->bindParam(":rid", $comment['id']);
869 869
 															$stmt2->execute();
870 870
 
871
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
871
+															while ($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
872 872
 														?>
873 873
 															<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">
874 874
 																<div class="comment-body">
@@ -951,11 +951,11 @@  discard block
 block discarded – undo
951 951
 												<?php
952 952
 													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
953 953
 													$stmt->execute();
954
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
954
+													while ($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
955 955
 														$_playlist['videos'] = json_decode($_playlist['videos']);
956 956
 														$_playlist['count'] = 1;
957 957
 
958
-														if($__video_h->video_exists($_playlist['videos'][0])) {
958
+														if ($__video_h->video_exists($_playlist['videos'][0])) {
959 959
 															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
960 960
 														} else {
961 961
 															$video = [];
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 												<?php
1011 1011
 													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1012 1012
 													$stmt->execute();
1013
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1013
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1014 1014
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1015 1015
 														$video['duration'] = $__time_h->timestamp($video['duration']);
1016 1016
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.