Test Failed
Push — main ( 0abb31...a47605 )
by
unknown
02:55
created
web/public/watch.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
         if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
24 24
 
25 25
         if(!isset($error['message'])) {
26
-			$text = $_POST['comment'];
26
+            $text = $_POST['comment'];
27 27
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
28 28
             $stmt->bindParam(":v", $_GET['v']);
29
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
30
-			$stmt->bindParam(":comment", $text);
29
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
30
+            $stmt->bindParam(":comment", $text);
31 31
             $stmt->execute();
32 32
 
33
-			$__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
33
+            $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
34 34
         }
35 35
     }
36 36
 ?>
@@ -62,28 +62,28 @@  discard block
 block discarded – undo
62 62
          if (window.yt.timing) {yt.timing.tick("ct");}    
63 63
       </script>
64 64
 		<?php
65
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
66
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
65
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
66
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
67 67
 
68
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
69
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
68
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
69
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
70 70
 
71
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
72
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
71
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
72
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
73 73
 
74
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
75
-				$_video['likeswidth'] = 50;
76
-				$_video['dislikeswidth'] = 50;
77
-			} else {
78
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
79
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
80
-			}
74
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
75
+                $_video['likeswidth'] = 50;
76
+                $_video['dislikeswidth'] = 50;
77
+            } else {
78
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
79
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
80
+            }
81 81
 
82
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
83
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
84
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
85
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
86
-		?>
82
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
83
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
84
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
85
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
86
+        ?>
87 87
 	</head>
88 88
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
89 89
 		<form name="logoutForm" method="POST" action="/logout">
@@ -355,10 +355,10 @@  discard block
 block discarded – undo
355 355
 												</div>
356 356
 											</div>
357 357
 											<?php 
358
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
359
-												$stmt->bindParam(":v", $_GET['v']);
360
-												$stmt->execute();
361
-											?>
358
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
359
+                                                $stmt->bindParam(":v", $_GET['v']);
360
+                                                $stmt->execute();
361
+                                            ?>
362 362
 
363 363
 											<?php if($stmt->rowCount() != 0) { ?>
364 364
 												<div class="comments-section">
@@ -368,16 +368,16 @@  discard block
 block discarded – undo
368 368
 													<h4>Video Responses</h4>
369 369
 													<ul class="video-list">
370 370
 													<?php 
371
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
372
-															if($__video_h->video_exists($video['video'])) { 
373
-																$video = $__video_h->fetch_video_rid($video['video']);
374
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
375
-																$video['duration'] = $__time_h->timestamp($video['duration']);
376
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
377
-																$video['author'] = htmlspecialchars($video['author']);		
378
-																$video['title'] = htmlspecialchars($video['title']);
379
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
380
-													?>
371
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
372
+                                                            if($__video_h->video_exists($video['video'])) { 
373
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
374
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
375
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
376
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
377
+                                                                $video['author'] = htmlspecialchars($video['author']);		
378
+                                                                $video['title'] = htmlspecialchars($video['title']);
379
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
380
+                                                    ?>
381 381
 														<li class="video-list-item yt-tile-default">
382 382
 															<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>
383 383
 															<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">
@@ -459,31 +459,31 @@  discard block
 block discarded – undo
459 459
 												</div>
460 460
 												<ul class="comment-list" id="live_comments">
461 461
 														<?php
462
-														$results_per_page = 20;
462
+                                                        $results_per_page = 20;
463 463
 
464
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
465
-														$stmt->bindParam(":rid", $_video['rid']);
466
-														$stmt->execute();
464
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
465
+                                                        $stmt->bindParam(":rid", $_video['rid']);
466
+                                                        $stmt->execute();
467 467
 
468
-														$number_of_result = $stmt->rowCount();
469
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
468
+                                                        $number_of_result = $stmt->rowCount();
469
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
470 470
 
471
-														if (!isset ($_GET['page']) ) {  
472
-															$page = 1;  
473
-														} else {  
474
-															$page = (int)$_GET['page'];  
475
-														}  
471
+                                                        if (!isset ($_GET['page']) ) {  
472
+                                                            $page = 1;  
473
+                                                        } else {  
474
+                                                            $page = (int)$_GET['page'];  
475
+                                                        }  
476 476
 
477
-														$page_first_result = ($page - 1) * $results_per_page;  
477
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
478 478
 
479
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
480
-														$stmt->bindParam(":rid", $_video['rid']);
481
-														$stmt->bindParam(":pfirst", $page_first_result);
482
-														$stmt->bindParam(":pper", $results_per_page);
483
-														$stmt->execute();
479
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
480
+                                                        $stmt->bindParam(":rid", $_video['rid']);
481
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
482
+                                                        $stmt->bindParam(":pper", $results_per_page);
483
+                                                        $stmt->execute();
484 484
 
485
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
486
-													?>
485
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
486
+                                                    ?>
487 487
 
488 488
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
489 489
 														<div class="comment-body">
@@ -562,16 +562,16 @@  discard block
 block discarded – undo
562 562
 											<ul id="watch-related" class="video-list">
563 563
 												<div id="ppv-container" class="hid"></div>
564 564
 												<?php
565
-													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
566
-													$stmt->execute();
567
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
568
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
569
-														$video['duration'] = $__time_h->timestamp($video['duration']);
570
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
571
-														$video['author'] = htmlspecialchars($video['author']);		
572
-														$video['title'] = htmlspecialchars($video['title']);
573
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
574
-												?>
565
+                                                    $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
566
+                                                    $stmt->execute();
567
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
568
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
569
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
570
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
571
+                                                        $video['author'] = htmlspecialchars($video['author']);		
572
+                                                        $video['title'] = htmlspecialchars($video['title']);
573
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
574
+                                                ?>
575 575
 												<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']; ?>" 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>
576 576
 													<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">
577 577
 													</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@  discard block
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
13
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14 14
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
15 15
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
16 16
 <?php
17
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
17
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
18 18
         $error = array();
19 19
 
20
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
21
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
22
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
23
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
20
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
21
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
22
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
23
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
24 24
 
25
-        if(!isset($error['message'])) {
25
+        if (!isset($error['message'])) {
26 26
 			$text = $_POST['comment'];
27 27
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
28 28
             $stmt->bindParam(":v", $_GET['v']);
@@ -62,20 +62,20 @@  discard block
 block discarded – undo
62 62
          if (window.yt.timing) {yt.timing.tick("ct");}    
63 63
       </script>
64 64
 		<?php
65
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
65
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
66 66
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
67 67
 
68
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
69
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
68
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
69
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
70 70
 
71 71
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
72 72
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
73 73
 
74
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
74
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
75 75
 				$_video['likeswidth'] = 50;
76 76
 				$_video['dislikeswidth'] = 50;
77 77
 			} else {
78
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
78
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
79 79
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
80 80
 			}
81 81
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 									</div>
109 109
 									<div id="instream_google_companion_ad_div"></div>
110 110
 								</div>
111
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
111
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
112 112
 									<div id="watch-owner-container">
113 113
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
114 114
 											<ul class="yt-nav-aside">
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 											title="" 
144 144
 											id="subscribe-button"
145 145
 											type="button" 
146
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
146
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
147 147
 											role="button">
148 148
 											<span class="yt-uix-button-icon-wrapper">
149 149
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 											<button onclick=";window.location.href=this.getAttribute('href');return false;"
222 222
 											title="I like this" 
223 223
 											type="button" 
224
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
224
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
225 225
 											id="watch-like"  
226 226
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
227 227
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 											type="button" 
236 236
 											style="margin-left: -2px;"
237 237
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
238
-											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" 
238
+											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" 
239 239
 											id="watch-unlike" 
240 240
 											role="button">
241 241
 												<span class="yt-uix-button-icon-wrapper">
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 												$stmt->execute();
361 361
 											?>
362 362
 
363
-											<?php if($stmt->rowCount() != 0) { ?>
363
+											<?php if ($stmt->rowCount() != 0) { ?>
364 364
 												<div class="comments-section">
365 365
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
366 366
 													see all
@@ -368,8 +368,8 @@  discard block
 block discarded – undo
368 368
 													<h4>Video Responses</h4>
369 369
 													<ul class="video-list">
370 370
 													<?php 
371
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
372
-															if($__video_h->video_exists($video['video'])) { 
371
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
372
+															if ($__video_h->video_exists($video['video'])) { 
373 373
 																$video = $__video_h->fetch_video_rid($video['video']);
374 374
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
375 375
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -400,19 +400,19 @@  discard block
 block discarded – undo
400 400
 														</h4>
401 401
 													</div>
402 402
 												</div>
403
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
403
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
404 404
 													<div class="comments-post-container clearfix">
405 405
 														<div class="comments-post-alert">
406 406
 															<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>
407 407
 														</div>
408 408
 													</div>
409
-												<?php } else if($_video['commenting'] == "d") { ?>
409
+												<?php } else if ($_video['commenting'] == "d") { ?>
410 410
 													<div class="comments-post-container clearfix">
411 411
 														<div class="comments-post-alert">
412 412
 															This video has comemnting disabled!
413 413
 														</div>
414 414
 													</div>
415
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
415
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
416 416
 													<div class="comments-post-container clearfix">
417 417
 														<div class="comments-post-alert">
418 418
 															This user has blocked you!
@@ -466,15 +466,15 @@  discard block
 block discarded – undo
466 466
 														$stmt->execute();
467 467
 
468 468
 														$number_of_result = $stmt->rowCount();
469
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
469
+														$number_of_page = ceil($number_of_result/$results_per_page);  
470 470
 
471
-														if (!isset ($_GET['page']) ) {  
471
+														if (!isset ($_GET['page'])) {  
472 472
 															$page = 1;  
473 473
 														} else {  
474
-															$page = (int)$_GET['page'];  
474
+															$page = (int) $_GET['page'];  
475 475
 														}  
476 476
 
477
-														$page_first_result = ($page - 1) * $results_per_page;  
477
+														$page_first_result = ($page - 1)*$results_per_page;  
478 478
 
479 479
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
480 480
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 														$stmt->bindParam(":pper", $results_per_page);
483 483
 														$stmt->execute();
484 484
 
485
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
485
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
486 486
 													?>
487 487
 
488 488
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 												<?php
565 565
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
566 566
 													$stmt->execute();
567
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
567
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
568 568
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
569 569
 														$video['duration'] = $__time_h->timestamp($video['duration']);
570 570
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/get_video_info.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
 
38 38
 // these are all the videos, with their settings, and formats
39 39
 $fmt_stream_map = [
40
-	[
41
-	"itag" => "43",
40
+    [
41
+    "itag" => "43",
42 42
     "url" => $_video['fmtPath'],
43 43
     "sig" => "aintnothinggonnabreakmystrideaintnothinggonnaslowmedownnooigottakeeponmovin",
44 44
     "fallback_host" => "tc.v14.cache3.c.youtube.com",
45 45
     "quality" => "hd720",
46 46
     "type" => "video/webm; codecs=\"vp8.0, vorbis\""
47
-	],
47
+    ],
48 48
 ];
49 49
 
50 50
 $count = 0;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     "avg_rating" => "5.0",
70 70
     "ttsurl" => "http://www.youtube.com/api/timedtext?signature=E949556D4478C57B95F0E4268F8D85D460D27DF6.1EC1679B0E1466625B2A029D836BE9C135A0B300&hl=en_US&caps=asr&expire=1361228889&sparams=asr_langs%2Ccaps%2Cv%2Cexpire&v=LHdA7Yc-8Rg&key=yttt1&asr_langs=ko%2Cde%2Cpt%2Cen%2Cnl%2Cja%2Cru%2Ces%2Cfr%2Cit",
71 71
     "url_encoded_fmt_stream_map" => $url_encoded_fmt_stream_map,
72
-	"plid" => "AATWAe5iQ_FjAV-I",
72
+    "plid" => "AATWAe5iQ_FjAV-I",
73 73
     "view_count" => "24465",
74 74
     "cc_asr" => "1",
75 75
     "token" => "vjVQa1PpcFPQw_h19VxFJZdJZbKkh5-obrhC9M93j-E=",
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_update.php"); ?>
31 31
 <?php $__video_h = new video_helper($__db); ?>
32 32
 <?php $__db_h = new db_helper(); ?>
33
-<?php if(!$__video_h->video_exists($_GET['video_id'])) { header("Location: /?error=This video doesn't exist!"); } ?>
33
+<?php if (!$__video_h->video_exists($_GET['video_id'])) { header("Location: /?error=This video doesn't exist!"); } ?>
34 34
 <?php $_video = $__video_h->fetch_video_rid($_GET['video_id']); ?>
35
-<?php @$_video['fmtPath'] = "/dynamic/videos/".$_video['filename']; ?>
35
+<?php @$_video['fmtPath'] = "/dynamic/videos/" . $_video['filename']; ?>
36 36
 <?php
37 37
 
38 38
 // these are all the videos, with their settings, and formats
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 $count = 0;
51 51
 $url_encoded_fmt_stream_map;
52
-foreach($fmt_stream_map as $stream) {
53
-    if($count == 0)
52
+foreach ($fmt_stream_map as $stream) {
53
+    if ($count == 0)
54 54
         $url_encoded_fmt_stream_map = http_build_query($stream);
55 55
     else
56 56
         $url_encoded_fmt_stream_map = $url_encoded_fmt_stream_map . "," . http_build_query($stream);
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,10 +50,11 @@
 block discarded – undo
50 50
 $count = 0;
51 51
 $url_encoded_fmt_stream_map;
52 52
 foreach($fmt_stream_map as $stream) {
53
-    if($count == 0)
54
-        $url_encoded_fmt_stream_map = http_build_query($stream);
55
-    else
56
-        $url_encoded_fmt_stream_map = $url_encoded_fmt_stream_map . "," . http_build_query($stream);
53
+    if($count == 0) {
54
+            $url_encoded_fmt_stream_map = http_build_query($stream);
55
+    } else {
56
+            $url_encoded_fmt_stream_map = $url_encoded_fmt_stream_map . "," . http_build_query($stream);
57
+    }
57 58
     $count++;
58 59
 }
59 60
 
Please login to merge, or discard this patch.