Test Failed
Push — main ( 9f2608...2c26f6 )
by chief
03:31
created
web/public/watch.php 1 patch
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
-		header("Location: /");
18
+    if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
+        header("Location: /");
20 20
 
21
-	if(isset($_SESSION['siteusername']))
22
-		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
21
+    if(isset($_SESSION['siteusername']))
22
+        $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
23 23
 
24
-	$_SESSION['current_video'] = $_video['rid'];
24
+    $_SESSION['current_video'] = $_video['rid'];
25 25
 
26
-	/* 
26
+    /* 
27 27
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
28 28
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
29 29
 	Work on this tomorrow or some shit idk lol
30 30
 	*/
31 31
 
32
-	/* 
32
+    /* 
33 33
 	USE THE GOD DAMN __CONFIG MORE -- idiot
34 34
 	Work on this tomorrow or some shit
35 35
 	*/
36 36
 
37
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
38
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
39
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
40
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
37
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
38
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
39
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
40
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
41 41
 ?>
42 42
 <!DOCTYPE html>
43 43
 <html>
@@ -67,29 +67,29 @@  discard block
 block discarded – undo
67 67
          if (window.yt.timing) {yt.timing.tick("ct");}    
68 68
       </script>
69 69
 		<?php
70
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
71
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
70
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
71
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
72 72
 
73
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
74
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
73
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
74
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
75 75
 
76
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
77
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
76
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
77
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
78 78
 
79
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
80
-				$_video['likeswidth'] = 0;
81
-				$_video['dislikeswidth'] = 0;
82
-			} else {
83
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
84
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
85
-			}
79
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
80
+                $_video['likeswidth'] = 0;
81
+                $_video['dislikeswidth'] = 0;
82
+            } else {
83
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
84
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
85
+            }
86 86
 
87
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
88
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
89
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
90
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
91
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
92
-		?>
87
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
88
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
89
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
90
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
91
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
92
+        ?>
93 93
 	</head>
94 94
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
95 95
 		<form name="logoutForm" method="POST" action="/logout">
@@ -353,21 +353,21 @@  discard block
 block discarded – undo
353 353
 													<hr><br>
354 354
 													<h3>Add to a Playlist</h3>
355 355
 													<?php
356
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
357
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
358
-														$stmt->execute();
359
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
360
-															$buffer = json_decode($playlist['videos']);
361
-															@$rid = $buffer[0];
362
-															if(!empty($rid)) {
363
-																@$video = $__video_h->fetch_video_rid($rid);
364
-															} else {
365
-																$video['thumbnail'] = "";
366
-																$video['duration'] = 0;
367
-															}
356
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
357
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
358
+                                                        $stmt->execute();
359
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
360
+                                                            $buffer = json_decode($playlist['videos']);
361
+                                                            @$rid = $buffer[0];
362
+                                                            if(!empty($rid)) {
363
+                                                                @$video = $__video_h->fetch_video_rid($rid);
364
+                                                            } else {
365
+                                                                $video['thumbnail'] = "";
366
+                                                                $video['duration'] = 0;
367
+                                                            }
368 368
 
369
-															$videos = count($buffer);
370
-													?>
369
+                                                            $videos = count($buffer);
370
+                                                    ?>
371 371
 														<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>
372 372
 													<?php } ?>
373 373
 												<?php } ?>
@@ -632,10 +632,10 @@  discard block
 block discarded – undo
632 632
 												</div>
633 633
 											</div>
634 634
 											<?php 
635
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
636
-												$stmt->bindParam(":v", $_GET['v']);
637
-												$stmt->execute();
638
-											?>
635
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
636
+                                                $stmt->bindParam(":v", $_GET['v']);
637
+                                                $stmt->execute();
638
+                                            ?>
639 639
 
640 640
 											<?php if($stmt->rowCount() != 0) { ?>
641 641
 												<div class="comments-section">
@@ -645,16 +645,16 @@  discard block
 block discarded – undo
645 645
 													<h4>Video Responses</h4>
646 646
 													<ul class="video-list">
647 647
 													<?php 
648
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
649
-															if($__video_h->video_exists($video['video'])) { 
650
-																$video = $__video_h->fetch_video_rid($video['video']);
651
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
652
-																$video['duration'] = $__time_h->timestamp($video['duration']);
653
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
654
-																$video['author'] = htmlspecialchars($video['author']);		
655
-																$video['title'] = htmlspecialchars($video['title']);
656
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
657
-													?>
648
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
649
+                                                            if($__video_h->video_exists($video['video'])) { 
650
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
651
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
652
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
653
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
654
+                                                                $video['author'] = htmlspecialchars($video['author']);		
655
+                                                                $video['title'] = htmlspecialchars($video['title']);
656
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
657
+                                                    ?>
658 658
 														<li class="video-list-item yt-tile-default">
659 659
 															<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>
660 660
 															<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">
@@ -735,38 +735,38 @@  discard block
 block discarded – undo
735 735
 												</div>
736 736
 												<ul class="comment-list" id="live_comments">
737 737
 														<?php
738
-														$results_per_page = 20;
738
+                                                        $results_per_page = 20;
739 739
 
740
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
741
-														$stmt->bindParam(":rid", $_video['rid']);
742
-														$stmt->execute();
740
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
741
+                                                        $stmt->bindParam(":rid", $_video['rid']);
742
+                                                        $stmt->execute();
743 743
 
744
-														$number_of_result = $stmt->rowCount();
745
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
744
+                                                        $number_of_result = $stmt->rowCount();
745
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
746 746
 
747
-														if (!isset ($_GET['page']) ) {  
748
-															$page = 1;  
749
-														} else {  
750
-															$page = (int)$_GET['page'];  
751
-														}  
747
+                                                        if (!isset ($_GET['page']) ) {  
748
+                                                            $page = 1;  
749
+                                                        } else {  
750
+                                                            $page = (int)$_GET['page'];  
751
+                                                        }  
752 752
 
753
-														$page_first_result = ($page - 1) * $results_per_page;  
753
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
754 754
 
755
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
756
-														$stmt->bindParam(":rid", $_video['rid']);
757
-														$stmt->bindParam(":pfirst", $page_first_result);
758
-														$stmt->bindParam(":pper", $results_per_page);
759
-														$stmt->execute();
755
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
756
+                                                        $stmt->bindParam(":rid", $_video['rid']);
757
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
758
+                                                        $stmt->bindParam(":pper", $results_per_page);
759
+                                                        $stmt->execute();
760 760
 
761
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
762
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
763
-																$comment['liked'] = true;
764
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
765
-																$comment['disliked'] = true;
761
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
762
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
763
+                                                                $comment['liked'] = true;
764
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
765
+                                                                $comment['disliked'] = true;
766 766
 																
767
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
768
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
769
-													?>
767
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
768
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
769
+                                                    ?>
770 770
 
771 771
 														<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
772 772
 															<div class="comment-body">
@@ -832,12 +832,12 @@  discard block
 block discarded – undo
832 832
 															</div>
833 833
 														</li>
834 834
 														<?php 
835
-															$stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id");
836
-															$stmt2->bindParam(":rid", $comment['id']);
837
-															$stmt2->execute();
835
+                                                            $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id");
836
+                                                            $stmt2->bindParam(":rid", $comment['id']);
837
+                                                            $stmt2->execute();
838 838
 
839
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
840
-														?>
839
+                                                            while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
840
+                                                        ?>
841 841
 															<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">
842 842
 																<div class="comment-body">
843 843
 																	<div class="content-container">
@@ -917,19 +917,19 @@  discard block
 block discarded – undo
917 917
 										<div id="watch-related-container" class="watch-sidebar-body">
918 918
 											<ul id="watch-related" class="video-list">
919 919
 												<?php
920
-													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
921
-													$stmt->execute();
922
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
923
-														$_playlist['videos'] = json_decode($_playlist['videos']);
924
-														$_playlist['count'] = 1;
920
+                                                    $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
921
+                                                    $stmt->execute();
922
+                                                    while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
923
+                                                        $_playlist['videos'] = json_decode($_playlist['videos']);
924
+                                                        $_playlist['count'] = 1;
925 925
 
926
-														if($__video_h->video_exists($_playlist['videos'][0])) {
927
-															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
928
-														} else {
929
-															$video = [];
930
-															$video['thumbnail'] = "default.jpg";
931
-														}
932
-												?>
926
+                                                        if($__video_h->video_exists($_playlist['videos'][0])) {
927
+                                                            $video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
928
+                                                        } else {
929
+                                                            $video = [];
930
+                                                            $video['thumbnail'] = "default.jpg";
931
+                                                        }
932
+                                                ?>
933 933
 												<li class="video-list-item">
934 934
 													<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">
935 935
 														<span class="ux-thumb-wrap">
@@ -976,16 +976,16 @@  discard block
 block discarded – undo
976 976
 												<?php } ?>
977 977
 												<div id="ppv-container" class="hid"></div>
978 978
 												<?php
979
-													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
980
-													$stmt->execute();
981
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
982
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
983
-														$video['duration'] = $__time_h->timestamp($video['duration']);
984
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
985
-														$video['author'] = htmlspecialchars($video['author']);		
986
-														$video['title'] = htmlspecialchars($video['title']);
987
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
988
-												?>
979
+                                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
980
+                                                    $stmt->execute();
981
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
982
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
983
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
984
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
985
+                                                        $video['author'] = htmlspecialchars($video['author']);		
986
+                                                        $video['title'] = htmlspecialchars($video['title']);
987
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
988
+                                                ?>
989 989
 												<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>
990 990
 													<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">
991 991
 													</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
Please login to merge, or discard this patch.
web/public/index.php 1 patch
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -8,64 +8,64 @@  discard block
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	$__server->page_embeds->page_title = "SubRocks - Homepage";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
11
+    $__server->page_embeds->page_title = "SubRocks - Homepage";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 
16
-	function get_server_array_stats() {
17
-		$stat1 = file('/proc/stat'); 
18
-		sleep(1); 
19
-		$stat2 = file('/proc/stat'); 
20
-		$info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); 
21
-		$info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); 
22
-		$dif = array(); 
23
-		$dif['user'] = $info2[0] - $info1[0]; 
24
-		$dif['nice'] = $info2[1] - $info1[1]; 
25
-		$dif['sys'] = $info2[2] - $info1[2]; 
26
-		$dif['idle'] = $info2[3] - $info1[3]; 
27
-		$total = array_sum($dif); 
28
-		$cpu = array(); 
29
-		foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
16
+    function get_server_array_stats() {
17
+        $stat1 = file('/proc/stat'); 
18
+        sleep(1); 
19
+        $stat2 = file('/proc/stat'); 
20
+        $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); 
21
+        $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); 
22
+        $dif = array(); 
23
+        $dif['user'] = $info2[0] - $info1[0]; 
24
+        $dif['nice'] = $info2[1] - $info1[1]; 
25
+        $dif['sys'] = $info2[2] - $info1[2]; 
26
+        $dif['idle'] = $info2[3] - $info1[3]; 
27
+        $total = array_sum($dif); 
28
+        $cpu = array(); 
29
+        foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
30 30
 
31
-		return $cpu;
32
-	}
31
+        return $cpu;
32
+    }
33 33
 
34
-	function adjustBrightness($hexCode, $adjustPercent) {
35
-		$hexCode = ltrim($hexCode, '#');
34
+    function adjustBrightness($hexCode, $adjustPercent) {
35
+        $hexCode = ltrim($hexCode, '#');
36 36
 
37
-		if (strlen($hexCode) == 3) {
38
-			$hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2];
39
-		}
37
+        if (strlen($hexCode) == 3) {
38
+            $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2];
39
+        }
40 40
 
41
-		$hexCode = array_map('hexdec', str_split($hexCode, 2));
41
+        $hexCode = array_map('hexdec', str_split($hexCode, 2));
42 42
 
43
-		foreach ($hexCode as & $color) {
44
-			$adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;
45
-			$adjustAmount = ceil($adjustableLimit * $adjustPercent);
43
+        foreach ($hexCode as & $color) {
44
+            $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;
45
+            $adjustAmount = ceil($adjustableLimit * $adjustPercent);
46 46
 
47
-			$color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);
48
-		}
47
+            $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);
48
+        }
49 49
 
50
-		return '#' . implode($hexCode);
51
-	}
50
+        return '#' . implode($hexCode);
51
+    }
52 52
 
53
-	function get_server_memory_usage() {
54
-		$free = shell_exec('free');
55
-		$free = (string)trim($free);
56
-		$free_arr = explode("\n", $free);
57
-		$mem = explode(" ", $free_arr[1]);
58
-		$mem = array_filter($mem);
59
-		$mem = array_merge($mem);
60
-		$memory_usage = $mem[2]/$mem[1]*100;
53
+    function get_server_memory_usage() {
54
+        $free = shell_exec('free');
55
+        $free = (string)trim($free);
56
+        $free_arr = explode("\n", $free);
57
+        $mem = explode(" ", $free_arr[1]);
58
+        $mem = array_filter($mem);
59
+        $mem = array_merge($mem);
60
+        $memory_usage = $mem[2]/$mem[1]*100;
61 61
 	
62
-		return $memory_usage;
63
-	}
62
+        return $memory_usage;
63
+    }
64 64
 
65
-	function get_server_cpu_usage() {
66
-		$load = sys_getloadavg();
67
-		return $load[0];
68
-	}	
65
+    function get_server_cpu_usage() {
66
+        $load = sys_getloadavg();
67
+        return $load[0];
68
+    }	
69 69
 ?>
70 70
 <!DOCTYPE html>
71 71
 <html>
@@ -110,30 +110,30 @@  discard block
 block discarded – undo
110 110
 						<div class="box-gray" style="width: 95%;margin-bottom: 8px;">
111 111
 							<h3>Statistics</h3>
112 112
 							<?php 
113
-								$stmt = $__db->prepare("SELECT id FROM videos");
114
-								$stmt->execute();
115
-								$videos = $stmt->rowCount();
113
+                                $stmt = $__db->prepare("SELECT id FROM videos");
114
+                                $stmt->execute();
115
+                                $videos = $stmt->rowCount();
116 116
 
117
-								$stmt = $__db->prepare("SELECT id FROM users");
118
-								$stmt->execute();
119
-								$users = $stmt->rowCount();
117
+                                $stmt = $__db->prepare("SELECT id FROM users");
118
+                                $stmt->execute();
119
+                                $users = $stmt->rowCount();
120 120
 
121
-								$stmt = $__db->prepare("SELECT id FROM comments");
122
-								$stmt->execute();
123
-								$comments = $stmt->rowCount();
121
+                                $stmt = $__db->prepare("SELECT id FROM comments");
122
+                                $stmt->execute();
123
+                                $comments = $stmt->rowCount();
124 124
 
125
-								$stmt = $__db->prepare("SELECT id FROM views");
126
-								$stmt->execute();
127
-								$views = $stmt->rowCount();
125
+                                $stmt = $__db->prepare("SELECT id FROM views");
126
+                                $stmt->execute();
127
+                                $views = $stmt->rowCount();
128 128
 
129
-								$stmt = $__db->prepare("SELECT id FROM pms");
130
-								$stmt->execute();
131
-								$pms = $stmt->rowCount();
129
+                                $stmt = $__db->prepare("SELECT id FROM pms");
130
+                                $stmt->execute();
131
+                                $pms = $stmt->rowCount();
132 132
 
133
-								$stmt = $__db->prepare("SELECT id FROM playlists");
134
-								$stmt->execute();
135
-								$playlists = $stmt->rowCount();
136
-							?>
133
+                                $stmt = $__db->prepare("SELECT id FROM playlists");
134
+                                $stmt->execute();
135
+                                $playlists = $stmt->rowCount();
136
+                            ?>
137 137
 							<div style="width: 200px;display:inline-block;">
138 138
 								<?php $server = get_server_array_stats(); ?>
139 139
 								Videos uploaded: <b style="float:right;"><?php echo $videos; ?></b><br>
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 							</div>
182 182
 							<div class="guide">
183 183
 							<?php 
184
-								if(isset($_SESSION['siteusername'])) {
185
-								?>
184
+                                if(isset($_SESSION['siteusername'])) {
185
+                                ?>
186 186
 								<div style="/*! margin-top: 0px; *//*! margin-left: 10px; *//*! margin-bottom: 13px; */height: 99px;" class="guide-section feed-header channel first"><img alt="" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_SESSION['siteusername']); ?>" style="height: 88px;position: relative;top: 4px;left: 4px;" class="feed-header-thumb channel-thumb" width="88px"><div id="links" style="/*! margin-left: 5px; */position: relative;left: 13px;top: 7px;"><div style="font-size: 11px;margin-bottom: 6px;" class="metadata">
187 187
 								<a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel
188 188
 								<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="see-more-arrow" alt=""></a>        
@@ -345,16 +345,16 @@  discard block
 block discarded – undo
345 345
 							</p>
346 346
 							<ul>
347 347
 								<?php
348
-									$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
349
-									$stmt->execute();
350
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
351
-										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
352
-										$video['duration'] = $__time_h->timestamp($video['duration']);
353
-										$video['views'] = $__video_h->fetch_video_views($video['rid']);
354
-										$video['author'] = htmlspecialchars($video['author']);		
355
-										$video['title'] = htmlspecialchars($video['title']);
356
-										$video['description'] = $__video_h->shorten_description($video['description'], 50);
357
-								?>
348
+                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
349
+                                    $stmt->execute();
350
+                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
351
+                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
352
+                                        $video['duration'] = $__time_h->timestamp($video['duration']);
353
+                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
354
+                                        $video['author'] = htmlspecialchars($video['author']);		
355
+                                        $video['title'] = htmlspecialchars($video['title']);
356
+                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
357
+                                ?>
358 358
 								<li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
359 359
 									<button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
360 360
 									</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
@@ -368,16 +368,16 @@  discard block
 block discarded – undo
368 368
 							</h3>
369 369
 							<ul>
370 370
 								<?php
371
-									$stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
372
-									$stmt->execute();
373
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
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
+                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
372
+                                    $stmt->execute();
373
+                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
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 "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
382 382
 									<button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
383 383
 									</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
@@ -401,16 +401,16 @@  discard block
 block discarded – undo
401 401
 									<div class="feed-page">
402 402
 										<ul>
403 403
 											<?php
404
-												$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
405
-												$stmt->execute();
406
-												while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
407
-													$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
408
-													$video['duration'] = $__time_h->timestamp($video['duration']);
409
-													$video['views'] = $__video_h->fetch_video_views($video['rid']);
410
-													$video['author'] = htmlspecialchars($video['author']);		
411
-													$video['title'] = htmlspecialchars($video['title']);
412
-													$video['description'] = $__video_h->shorten_description($video['description'], 50);
413
-											?>
404
+                                                $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
405
+                                                $stmt->execute();
406
+                                                while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
407
+                                                    $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
408
+                                                    $video['duration'] = $__time_h->timestamp($video['duration']);
409
+                                                    $video['views'] = $__video_h->fetch_video_views($video['rid']);
410
+                                                    $video['author'] = htmlspecialchars($video['author']);		
411
+                                                    $video['title'] = htmlspecialchars($video['title']);
412
+                                                    $video['description'] = $__video_h->shorten_description($video['description'], 50);
413
+                                            ?>
414 414
 											<li>
415 415
 												<div class="feed-item-container first " data-channel-key="UCR2A9ZNliJfgC66IvIpe-Zw">
416 416
 													<div class="feed-author-bubble-container">
Please login to merge, or discard this patch.
web/public/admin/index.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -12,64 +12,64 @@  discard block
 block discarded – undo
12 12
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13 13
 <?php if(!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?>
14 14
 <?php
15
-	$__server->page_embeds->page_title = "SubRocks - Admin Panel";
16
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
17
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
18
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
15
+    $__server->page_embeds->page_title = "SubRocks - Admin Panel";
16
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
17
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
18
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
19 19
 
20
-	function get_server_array_stats() {
21
-		$stat1 = file('/proc/stat'); 
22
-		sleep(1); 
23
-		$stat2 = file('/proc/stat'); 
24
-		$info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); 
25
-		$info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); 
26
-		$dif = array(); 
27
-		$dif['user'] = $info2[0] - $info1[0]; 
28
-		$dif['nice'] = $info2[1] - $info1[1]; 
29
-		$dif['sys'] = $info2[2] - $info1[2]; 
30
-		$dif['idle'] = $info2[3] - $info1[3]; 
31
-		$total = array_sum($dif); 
32
-		$cpu = array(); 
33
-		foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
20
+    function get_server_array_stats() {
21
+        $stat1 = file('/proc/stat'); 
22
+        sleep(1); 
23
+        $stat2 = file('/proc/stat'); 
24
+        $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); 
25
+        $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); 
26
+        $dif = array(); 
27
+        $dif['user'] = $info2[0] - $info1[0]; 
28
+        $dif['nice'] = $info2[1] - $info1[1]; 
29
+        $dif['sys'] = $info2[2] - $info1[2]; 
30
+        $dif['idle'] = $info2[3] - $info1[3]; 
31
+        $total = array_sum($dif); 
32
+        $cpu = array(); 
33
+        foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
34 34
 
35
-		return $cpu;
36
-	}
35
+        return $cpu;
36
+    }
37 37
 
38
-	function adjustBrightness($hexCode, $adjustPercent) {
39
-		$hexCode = ltrim($hexCode, '#');
38
+    function adjustBrightness($hexCode, $adjustPercent) {
39
+        $hexCode = ltrim($hexCode, '#');
40 40
 
41
-		if (strlen($hexCode) == 3) {
42
-			$hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2];
43
-		}
41
+        if (strlen($hexCode) == 3) {
42
+            $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2];
43
+        }
44 44
 
45
-		$hexCode = array_map('hexdec', str_split($hexCode, 2));
45
+        $hexCode = array_map('hexdec', str_split($hexCode, 2));
46 46
 
47
-		foreach ($hexCode as & $color) {
48
-			$adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;
49
-			$adjustAmount = ceil($adjustableLimit * $adjustPercent);
47
+        foreach ($hexCode as & $color) {
48
+            $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;
49
+            $adjustAmount = ceil($adjustableLimit * $adjustPercent);
50 50
 
51
-			$color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);
52
-		}
51
+            $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);
52
+        }
53 53
 
54
-		return '#' . implode($hexCode);
55
-	}
54
+        return '#' . implode($hexCode);
55
+    }
56 56
 
57
-	function get_server_memory_usage() {
58
-		$free = shell_exec('free');
59
-		$free = (string)trim($free);
60
-		$free_arr = explode("\n", $free);
61
-		$mem = explode(" ", $free_arr[1]);
62
-		$mem = array_filter($mem);
63
-		$mem = array_merge($mem);
64
-		$memory_usage = $mem[2]/$mem[1]*100;
57
+    function get_server_memory_usage() {
58
+        $free = shell_exec('free');
59
+        $free = (string)trim($free);
60
+        $free_arr = explode("\n", $free);
61
+        $mem = explode(" ", $free_arr[1]);
62
+        $mem = array_filter($mem);
63
+        $mem = array_merge($mem);
64
+        $memory_usage = $mem[2]/$mem[1]*100;
65 65
 	
66
-		return $memory_usage;
67
-	}
66
+        return $memory_usage;
67
+    }
68 68
 
69
-	function get_server_cpu_usage() {
70
-		$load = sys_getloadavg();
71
-		return $load[0];
72
-	}	
69
+    function get_server_cpu_usage() {
70
+        $load = sys_getloadavg();
71
+        return $load[0];
72
+    }	
73 73
 ?>
74 74
 <!DOCTYPE html>
75 75
 <html dir="ltr">
@@ -237,14 +237,14 @@  discard block
 block discarded – undo
237 237
                                         <h3>Statistics</h3>
238 238
                                         <ul class="disc">
239 239
 											<?php 
240
-												$stmt = $__db->prepare("SELECT id FROM videos");
241
-												$stmt->execute();
242
-												$videos = $stmt->rowCount();
240
+                                                $stmt = $__db->prepare("SELECT id FROM videos");
241
+                                                $stmt->execute();
242
+                                                $videos = $stmt->rowCount();
243 243
 
244
-												$stmt = $__db->prepare("SELECT id FROM users");
245
-												$stmt->execute();
246
-												$users = $stmt->rowCount();
247
-											?>
244
+                                                $stmt = $__db->prepare("SELECT id FROM users");
245
+                                                $stmt->execute();
246
+                                                $users = $stmt->rowCount();
247
+                                            ?>
248 248
 											<li>Videos uploaded: <b><?php echo $videos; ?></b></li>
249 249
 											<li>
250 250
 												Users registered: <b><?php echo $users; ?></b>
Please login to merge, or discard this patch.
web/public/admin/bans.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
12 12
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13 13
 <?php if(!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?>
14 14
 <?php
15
-	$__server->page_embeds->page_title = "SubRocks - Ban User";
16
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
17
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
18
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
15
+    $__server->page_embeds->page_title = "SubRocks - Ban User";
16
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
17
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
18
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
19 19
 ?>
20 20
 <!DOCTYPE html>
21 21
 <html dir="ltr">
Please login to merge, or discard this patch.
web/public/view_playlist.php 1 patch
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -25,21 +25,21 @@  discard block
 block discarded – undo
25 25
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
26 26
     }
27 27
 
28
-	function addhttp($url) {
29
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
30
-			$url = "http://" . $url;
31
-		}
32
-		return $url;
33
-	}
28
+    function addhttp($url) {
29
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
30
+            $url = "http://" . $url;
31
+        }
32
+        return $url;
33
+    }
34 34
 
35 35
     function check_valid_colorhex($colorCode) {
36 36
         // If user accidentally passed along the # sign, strip it off
37 37
         $colorCode = ltrim($colorCode, '#');
38 38
     
39 39
         if (
40
-              ctype_xdigit($colorCode) &&
40
+                ctype_xdigit($colorCode) &&
41 41
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
42
-                   return true;
42
+                    return true;
43 43
     
44 44
         else return false;
45 45
     }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7);
65 65
 
66 66
     $_user['genre'] = strtolower($_user['genre']);
67
-	$_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
67
+    $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
68 68
 
69 69
     if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
70 70
     if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
74 74
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
75 75
 
76
-	if(isset($_SESSION['siteusername']))
77
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
76
+    if(isset($_SESSION['siteusername']))
77
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
78 78
 
79 79
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
80 80
         $error = array();
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
89 89
 
90 90
         if(!isset($error['message'])) {
91
-			$text = $_POST['comment'];
91
+            $text = $_POST['comment'];
92 92
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
93
-			$stmt->bindParam(":id", $_user['username']);
94
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
95
-			$stmt->bindParam(":comment", $text);
93
+            $stmt->bindParam(":id", $_user['username']);
94
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
95
+            $stmt->bindParam(":comment", $text);
96 96
             $stmt->execute();
97 97
 
98 98
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
     }
105 105
 ?>
106 106
 <?php
107
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_playlist['title']);
108
-	$__server->page_embeds->page_description = htmlspecialchars($_playlist['description']);
109
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
110
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
107
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_playlist['title']);
108
+    $__server->page_embeds->page_description = htmlspecialchars($_playlist['description']);
109
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
110
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
111 111
 ?>	
112 112
 <!DOCTYPE html>
113 113
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -135,27 +135,27 @@  discard block
 block discarded – undo
135 135
 				background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>);
136 136
 				background-repeat: repeat;
137 137
 				<?php
138
-					switch($_user['2012_bgoption']) {
139
-						case "stretch":
140
-						echo "background-size: cover;";
141
-						break;
142
-						case "solid":
143
-						echo "";
144
-						break;
145
-						case "norepeat":
146
-						echo "background-repeat: no-repeat !important;";
147
-						break;
148
-						case "repeatxy":
149
-						echo "background-repeat: repeat;";
150
-						break;
151
-						case "repeaty":
152
-						echo "background-repeat: repeat-y;";
153
-						break;
154
-						case "repeatx":
155
-						echo "background-repeat: repeat-x;";
156
-						break;
157
-					}
158
-				?>
138
+                    switch($_user['2012_bgoption']) {
139
+                        case "stretch":
140
+                        echo "background-size: cover;";
141
+                        break;
142
+                        case "solid":
143
+                        echo "";
144
+                        break;
145
+                        case "norepeat":
146
+                        echo "background-repeat: no-repeat !important;";
147
+                        break;
148
+                        case "repeatxy":
149
+                        echo "background-repeat: repeat;";
150
+                        break;
151
+                        case "repeaty":
152
+                        echo "background-repeat: repeat-y;";
153
+                        break;
154
+                        case "repeatx":
155
+                        echo "background-repeat: repeat-x;";
156
+                        break;
157
+                    }
158
+                ?>
159 159
 			}
160 160
    		</style>
161 161
 	</head>
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
173 173
 				<?php } ?>
174 174
 				<?php
175
-					if(empty(trim($_user['bio'])))
176
-						$_user['bio'] = "This user has no description.";
177
-				?>
175
+                    if(empty(trim($_user['bio'])))
176
+                        $_user['bio'] = "This user has no description.";
177
+                ?>
178 178
 				<div id="content">
179 179
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
180 180
 						<div class="content" id="recommended-channels-list"></div>
@@ -306,20 +306,20 @@  discard block
 block discarded – undo
306 306
                                                         </div>
307 307
                                                         <ol>
308 308
 															<?php
309
-																$_playlist['videos'] = json_decode($_playlist['videos']);
310
-																$_playlist['count'] = 1;
311
-																foreach($_playlist['videos'] as $video) {
312
-																	if($__video_h->video_exists($video)) {
313
-																		$_video = $__video_h->fetch_video_rid($video);
314
-																		$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
315
-																		$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
316
-																		$_video['duration'] = $__time_h->timestamp($_video['duration']);
317
-																		$_video['views'] = $__video_h->fetch_video_views($_video['rid']);
318
-																		$_video['author'] = htmlspecialchars($_video['author']);		
319
-																		$_video['title'] = htmlspecialchars($_video['title']);
320
-																		$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
321
-																		$_playlist['title'] = htmlspecialchars($_playlist['title']);
322
-																	?>
309
+                                                                $_playlist['videos'] = json_decode($_playlist['videos']);
310
+                                                                $_playlist['count'] = 1;
311
+                                                                foreach($_playlist['videos'] as $video) {
312
+                                                                    if($__video_h->video_exists($video)) {
313
+                                                                        $_video = $__video_h->fetch_video_rid($video);
314
+                                                                        $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
315
+                                                                        $_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
316
+                                                                        $_video['duration'] = $__time_h->timestamp($_video['duration']);
317
+                                                                        $_video['views'] = $__video_h->fetch_video_views($_video['rid']);
318
+                                                                        $_video['author'] = htmlspecialchars($_video['author']);		
319
+                                                                        $_video['title'] = htmlspecialchars($_video['title']);
320
+                                                                        $_video['description'] = $__video_h->shorten_description($_video['description'], 50);
321
+                                                                        $_playlist['title'] = htmlspecialchars($_playlist['title']);
322
+                                                                    ?>
323 323
 																	<li class="playlist-video-item
324 324
 																		odd
325 325
 																		"> 
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 													<h2>Featured Channels</h2>
478 478
 													<ul class="channel-summary-list ">
479 479
 														<?php 
480
-															foreach($_user['featured_channels'] as $user) {
481
-																if($__user_h->user_exists($user)) {
482
-														?>
480
+                                                            foreach($_user['featured_channels'] as $user) {
481
+                                                                if($__user_h->user_exists($user)) {
482
+                                                        ?>
483 483
 															<li class="yt-tile-visible yt-uix-tile">
484 484
 																<div class="channel-summary clearfix channel-summary-compact">
485 485
 																	<div class="channel-summary-thumb">
@@ -503,19 +503,19 @@  discard block
 block discarded – undo
503 503
 											</div>
504 504
 
505 505
 											<?php 
506
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
507
-												$stmt->bindParam(":search", $_user['username']);
508
-												$stmt->execute();
506
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
507
+                                                $stmt->bindParam(":search", $_user['username']);
508
+                                                $stmt->execute();
509 509
 
510
-												if($stmt->rowCount() != 0) {
511
-											?>
510
+                                                if($stmt->rowCount() != 0) {
511
+                                            ?>
512 512
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
513 513
 													<div class="module-view gh-featured">
514 514
 														<h2>Featured Playlists</h2>     
515 515
 														<?php
516
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
517
-															$playlist['videos'] = json_decode($playlist['videos']);
518
-														?> 
516
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
517
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
518
+                                                        ?> 
519 519
 															<div class="playlist yt-tile-visible yt-uix-tile">
520 520
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
521 521
 																<span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering">
Please login to merge, or discard this patch.
web/public/channel_feed.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(isset($_SESSION['siteusername']))
16
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
15
+    if(isset($_SESSION['siteusername']))
16
+        $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
17 17
 
18 18
     if(!$__user_h->user_exists($_GET['n']))
19 19
         header("Location: /?userdoesntexist");
@@ -26,21 +26,21 @@  discard block
 block discarded – undo
26 26
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
27 27
     }
28 28
 
29
-	function addhttp($url) {
30
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
31
-			$url = "http://" . $url;
32
-		}
33
-		return $url;
34
-	}
29
+    function addhttp($url) {
30
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
31
+            $url = "http://" . $url;
32
+        }
33
+        return $url;
34
+    }
35 35
 
36 36
     function check_valid_colorhex($colorCode) {
37 37
         // If user accidentally passed along the # sign, strip it off
38 38
         $colorCode = ltrim($colorCode, '#');
39 39
     
40 40
         if (
41
-              ctype_xdigit($colorCode) &&
41
+                ctype_xdigit($colorCode) &&
42 42
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
43
-                   return true;
43
+                    return true;
44 44
     
45 45
         else return false;
46 46
     }
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
76 76
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
77 77
 
78
-	if(isset($_SESSION['siteusername']))
79
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
78
+    if(isset($_SESSION['siteusername']))
79
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
80 80
 
81 81
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
82 82
         $error = array();
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
91 91
 
92 92
         if(!isset($error['message'])) {
93
-			$text = $_POST['comment'];
93
+            $text = $_POST['comment'];
94 94
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
95
-			$stmt->bindParam(":id", $_user['username']);
96
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
97
-			$stmt->bindParam(":comment", $text);
95
+            $stmt->bindParam(":id", $_user['username']);
96
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
97
+            $stmt->bindParam(":comment", $text);
98 98
             $stmt->execute();
99 99
 
100 100
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
     }
107 107
 ?>
108 108
 <?php
109
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
110
-	$__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
111
-	$__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
112
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
109
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
110
+    $__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
111
+    $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
112
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
113 113
 ?>
114 114
 <!DOCTYPE html>
115 115
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -137,27 +137,27 @@  discard block
 block discarded – undo
137 137
 				background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>);
138 138
 				background-repeat: repeat;
139 139
 				<?php
140
-					switch($_user['2012_bgoption']) {
141
-						case "stretch":
142
-						echo "background-size: cover;";
143
-						break;
144
-						case "solid":
145
-						echo "";
146
-						break;
147
-						case "norepeat":
148
-						echo "background-repeat: no-repeat !important;";
149
-						break;
150
-						case "repeatxy":
151
-						echo "background-repeat: repeat;";
152
-						break;
153
-						case "repeaty":
154
-						echo "background-repeat: repeat-y;";
155
-						break;
156
-						case "repeatx":
157
-						echo "background-repeat: repeat-x;";
158
-						break;
159
-					}
160
-				?>
140
+                    switch($_user['2012_bgoption']) {
141
+                        case "stretch":
142
+                        echo "background-size: cover;";
143
+                        break;
144
+                        case "solid":
145
+                        echo "";
146
+                        break;
147
+                        case "norepeat":
148
+                        echo "background-repeat: no-repeat !important;";
149
+                        break;
150
+                        case "repeatxy":
151
+                        echo "background-repeat: repeat;";
152
+                        break;
153
+                        case "repeaty":
154
+                        echo "background-repeat: repeat-y;";
155
+                        break;
156
+                        case "repeatx":
157
+                        echo "background-repeat: repeat-x;";
158
+                        break;
159
+                    }
160
+                ?>
161 161
 			}
162 162
    		</style>
163 163
 	</head>
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
175 175
 				<?php } ?> 
176 176
 				<?php
177
-					if(empty(trim($_user['bio'])))
178
-						$_user['bio'] = "This user has no description.";
179
-				?>
177
+                    if(empty(trim($_user['bio'])))
178
+                        $_user['bio'] = "This user has no description.";
179
+                ?>
180 180
 				<div id="content">
181 181
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
182 182
 						<div class="content" id="recommended-channels-list"></div>
Please login to merge, or discard this patch.
web/public/channel_videos.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(isset($_SESSION['siteusername']))
16
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
15
+    if(isset($_SESSION['siteusername']))
16
+        $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
17 17
 
18 18
     if(!$__user_h->user_exists($_GET['n']))
19 19
         header("Location: /?userdoesntexist");
@@ -26,21 +26,21 @@  discard block
 block discarded – undo
26 26
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
27 27
     }
28 28
 
29
-	function addhttp($url) {
30
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
31
-			$url = "http://" . $url;
32
-		}
33
-		return $url;
34
-	}
29
+    function addhttp($url) {
30
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
31
+            $url = "http://" . $url;
32
+        }
33
+        return $url;
34
+    }
35 35
 
36 36
     function check_valid_colorhex($colorCode) {
37 37
         // If user accidentally passed along the # sign, strip it off
38 38
         $colorCode = ltrim($colorCode, '#');
39 39
     
40 40
         if (
41
-              ctype_xdigit($colorCode) &&
41
+                ctype_xdigit($colorCode) &&
42 42
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
43
-                   return true;
43
+                    return true;
44 44
     
45 45
         else return false;
46 46
     }
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
76 76
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
77 77
 
78
-	if(isset($_SESSION['siteusername']))
79
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
78
+    if(isset($_SESSION['siteusername']))
79
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
80 80
 
81 81
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
82 82
         $error = array();
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
91 91
 
92 92
         if(!isset($error['message'])) {
93
-			$text = $_POST['comment'];
93
+            $text = $_POST['comment'];
94 94
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
95
-			$stmt->bindParam(":id", $_user['username']);
96
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
97
-			$stmt->bindParam(":comment", $text);
95
+            $stmt->bindParam(":id", $_user['username']);
96
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
97
+            $stmt->bindParam(":comment", $text);
98 98
             $stmt->execute();
99 99
 
100 100
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
     }
107 107
 ?>
108 108
 <?php
109
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
110
-	$__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
111
-	$__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
112
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
109
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
110
+    $__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
111
+    $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
112
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
113 113
 ?>
114 114
 <!DOCTYPE html>
115 115
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -137,27 +137,27 @@  discard block
 block discarded – undo
137 137
 				background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>);
138 138
 				background-repeat: repeat;
139 139
 				<?php
140
-					switch($_user['2012_bgoption']) {
141
-						case "stretch":
142
-						echo "background-size: cover;";
143
-						break;
144
-						case "solid":
145
-						echo "";
146
-						break;
147
-						case "norepeat":
148
-						echo "background-repeat: no-repeat !important;";
149
-						break;
150
-						case "repeatxy":
151
-						echo "background-repeat: repeat;";
152
-						break;
153
-						case "repeaty":
154
-						echo "background-repeat: repeat-y;";
155
-						break;
156
-						case "repeatx":
157
-						echo "background-repeat: repeat-x;";
158
-						break;
159
-					}
160
-				?>
140
+                    switch($_user['2012_bgoption']) {
141
+                        case "stretch":
142
+                        echo "background-size: cover;";
143
+                        break;
144
+                        case "solid":
145
+                        echo "";
146
+                        break;
147
+                        case "norepeat":
148
+                        echo "background-repeat: no-repeat !important;";
149
+                        break;
150
+                        case "repeatxy":
151
+                        echo "background-repeat: repeat;";
152
+                        break;
153
+                        case "repeaty":
154
+                        echo "background-repeat: repeat-y;";
155
+                        break;
156
+                        case "repeatx":
157
+                        echo "background-repeat: repeat-x;";
158
+                        break;
159
+                    }
160
+                ?>
161 161
 			}
162 162
    		</style>
163 163
 	</head>
@@ -330,17 +330,17 @@  discard block
 block discarded – undo
330 330
                                             <div class="channel-filtered-content">
331 331
                                                 <ol class="channel-videos-list">
332 332
 													<?php
333
-														$stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
334
-														$stmt->bindParam(":username", $_user['username']);
335
-														$stmt->execute();
336
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
337
-															$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
338
-															$video['duration'] = $__time_h->timestamp($video['duration']);
339
-															$video['views'] = $__video_h->fetch_video_views($video['rid']);
340
-															$video['author'] = htmlspecialchars($video['author']);		
341
-															$video['title'] = htmlspecialchars($video['title']);
342
-															$video['description'] = $__video_h->shorten_description($video['description'], 50);
343
-													?>
333
+                                                        $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
334
+                                                        $stmt->bindParam(":username", $_user['username']);
335
+                                                        $stmt->execute();
336
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
337
+                                                            $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
338
+                                                            $video['duration'] = $__time_h->timestamp($video['duration']);
339
+                                                            $video['views'] = $__video_h->fetch_video_views($video['rid']);
340
+                                                            $video['author'] = htmlspecialchars($video['author']);		
341
+                                                            $video['title'] = htmlspecialchars($video['title']);
342
+                                                            $video['description'] = $__video_h->shorten_description($video['description'], 50);
343
+                                                    ?>
344 344
                                                     <li class="yt-c3-grid-item">
345 345
                                                         <a href="/watch?v=<?php echo htmlspecialchars($video['rid']); ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="feature=plcp&amp;context=C4e80d7cVDvjVQa1PpcFPHxNkhfeSQg8_nJHnhVurQf82C2OenNiw%3D"><span class="video-thumb ux-thumb yt-thumb-default-234 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" width="234"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
346 346
                                                         <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="yBlvNSfqAj0" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
Please login to merge, or discard this patch.