Test Failed
Push — main ( 2f6890...e57cdf )
by chief
02:56
created
web/public/d/edit_video.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         "description" => $_POST['description'],
24 24
         "tags" => $_POST['tags'],
25 25
         "privacy" => $_POST['privacy'],
26
-         /* 
26
+            /* 
27 27
             Public   : n
28 28
             Unlisted : u
29 29
             Private  : v
Please login to merge, or discard this patch.
web/public/index.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  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 16
 <!DOCTYPE html>
17 17
 <html>
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 							</div>
62 62
 							<div class="guide">
63 63
 							<?php 
64
-								if(isset($_SESSION['siteusername'])) {
65
-								?>
64
+                                if(isset($_SESSION['siteusername'])) {
65
+                                ?>
66 66
 								<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">
67 67
 								<a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel
68 68
 								<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="see-more-arrow" alt=""></a>        
@@ -225,16 +225,16 @@  discard block
 block discarded – undo
225 225
 							</p>
226 226
 							<ul>
227 227
 								<?php
228
-									$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
229
-									$stmt->execute();
230
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
231
-										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
232
-										$video['duration'] = $__time_h->timestamp($video['duration']);
233
-										$video['views'] = $__video_h->fetch_video_views($video['rid']);
234
-										$video['author'] = htmlspecialchars($video['author']);		
235
-										$video['title'] = htmlspecialchars($video['title']);
236
-										$video['description'] = $__video_h->shorten_description($video['description'], 50);
237
-								?>
228
+                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
229
+                                    $stmt->execute();
230
+                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
231
+                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
232
+                                        $video['duration'] = $__time_h->timestamp($video['duration']);
233
+                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
234
+                                        $video['author'] = htmlspecialchars($video['author']);		
235
+                                        $video['title'] = htmlspecialchars($video['title']);
236
+                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
237
+                                ?>
238 238
 								<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>
239 239
 									<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">
240 240
 									</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
@@ -248,16 +248,16 @@  discard block
 block discarded – undo
248 248
 							</h3>
249 249
 							<ul>
250 250
 								<?php
251
-									$stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
252
-									$stmt->execute();
253
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
254
-										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
255
-										$video['duration'] = $__time_h->timestamp($video['duration']);
256
-										$video['views'] = $__video_h->fetch_video_views($video['rid']);
257
-										$video['author'] = htmlspecialchars($video['author']);		
258
-										$video['title'] = htmlspecialchars($video['title']);
259
-										$video['description'] = $__video_h->shorten_description($video['description'], 50);
260
-								?>
251
+                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
252
+                                    $stmt->execute();
253
+                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
254
+                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
255
+                                        $video['duration'] = $__time_h->timestamp($video['duration']);
256
+                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
257
+                                        $video['author'] = htmlspecialchars($video['author']);		
258
+                                        $video['title'] = htmlspecialchars($video['title']);
259
+                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
260
+                                ?>
261 261
 								<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>
262 262
 									<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">
263 263
 									</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
@@ -281,16 +281,16 @@  discard block
 block discarded – undo
281 281
 									<div class="feed-page">
282 282
 										<ul>
283 283
 											<?php
284
-												$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
285
-												$stmt->execute();
286
-												while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
287
-													$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
288
-													$video['duration'] = $__time_h->timestamp($video['duration']);
289
-													$video['views'] = $__video_h->fetch_video_views($video['rid']);
290
-													$video['author'] = htmlspecialchars($video['author']);		
291
-													$video['title'] = htmlspecialchars($video['title']);
292
-													$video['description'] = $__video_h->shorten_description($video['description'], 50);
293
-											?>
284
+                                                $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
285
+                                                $stmt->execute();
286
+                                                while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
287
+                                                    $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
288
+                                                    $video['duration'] = $__time_h->timestamp($video['duration']);
289
+                                                    $video['views'] = $__video_h->fetch_video_views($video['rid']);
290
+                                                    $video['author'] = htmlspecialchars($video['author']);		
291
+                                                    $video['title'] = htmlspecialchars($video['title']);
292
+                                                    $video['description'] = $__video_h->shorten_description($video['description'], 50);
293
+                                            ?>
294 294
 											<li>
295 295
 												<div class="feed-item-container first " data-channel-key="UCR2A9ZNliJfgC66IvIpe-Zw">
296 296
 													<div class="feed-author-bubble-container">
Please login to merge, or discard this patch.
web/public/s/mod/channel_featured.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 												<div class="module-view other-channels-view">
216 216
 													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
217 217
 													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
218
-														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
-													} ?>
218
+                                                        echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
+                                                    } ?>
220 220
 													<ul class="channel-summary-list ">
221 221
 														<?php 
222
-															foreach($_user['featured_channels'] as $user) {
223
-																if($__user_h->user_exists($user)) {
224
-														?>
222
+                                                            foreach($_user['featured_channels'] as $user) {
223
+                                                                if($__user_h->user_exists($user)) {
224
+                                                        ?>
225 225
 															<li class="yt-tile-visible yt-uix-tile">
226 226
 																<div class="channel-summary clearfix channel-summary-compact">
227 227
 																	<div class="channel-summary-thumb">
@@ -245,19 +245,19 @@  discard block
 block discarded – undo
245 245
 											</div>
246 246
 
247 247
 											<?php 
248
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
-												$stmt->bindParam(":search", $_user['username']);
250
-												$stmt->execute();
248
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
+                                                $stmt->bindParam(":search", $_user['username']);
250
+                                                $stmt->execute();
251 251
 
252
-												if($stmt->rowCount() != 0) {
253
-											?>
252
+                                                if($stmt->rowCount() != 0) {
253
+                                            ?>
254 254
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
255 255
 													<div class="module-view gh-featured">
256 256
 														<h2>Featured Playlists</h2>     
257 257
 														<?php
258
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
-															$playlist['videos'] = json_decode($playlist['videos']);
260
-														?> 
258
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
260
+                                                        ?> 
261 261
 															<div class="playlist yt-tile-visible yt-uix-tile">
262 262
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
263 263
 																<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/s/mod/channel_playlists.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 												<div class="module-view other-channels-view">
216 216
 													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
217 217
 													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
218
-														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
-													} ?>
218
+                                                        echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
+                                                    } ?>
220 220
 													<ul class="channel-summary-list ">
221 221
 														<?php 
222
-															foreach($_user['featured_channels'] as $user) {
223
-																if($__user_h->user_exists($user)) {
224
-														?>
222
+                                                            foreach($_user['featured_channels'] as $user) {
223
+                                                                if($__user_h->user_exists($user)) {
224
+                                                        ?>
225 225
 															<li class="yt-tile-visible yt-uix-tile">
226 226
 																<div class="channel-summary clearfix channel-summary-compact">
227 227
 																	<div class="channel-summary-thumb">
@@ -245,19 +245,19 @@  discard block
 block discarded – undo
245 245
 											</div>
246 246
 
247 247
 											<?php 
248
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
-												$stmt->bindParam(":search", $_user['username']);
250
-												$stmt->execute();
248
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
+                                                $stmt->bindParam(":search", $_user['username']);
250
+                                                $stmt->execute();
251 251
 
252
-												if($stmt->rowCount() != 0) {
253
-											?>
252
+                                                if($stmt->rowCount() != 0) {
253
+                                            ?>
254 254
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
255 255
 													<div class="module-view gh-featured">
256 256
 														<h2>Featured Playlists</h2>     
257 257
 														<?php
258
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
-															$playlist['videos'] = json_decode($playlist['videos']);
260
-														?> 
258
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
260
+                                                        ?> 
261 261
 															<div class="playlist yt-tile-visible yt-uix-tile">
262 262
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
263 263
 																<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/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/admin/index.php 1 patch
Indentation   +66 added lines, -66 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">
@@ -236,30 +236,30 @@  discard block
 block discarded – undo
236 236
 									<div class="box-gray" style="width: 95%;margin-bottom: 8px;">
237 237
 										<h3>Statistics</h3>
238 238
 										<?php 
239
-											$stmt = $__db->prepare("SELECT id FROM videos");
240
-											$stmt->execute();
241
-											$videos = $stmt->rowCount();
239
+                                            $stmt = $__db->prepare("SELECT id FROM videos");
240
+                                            $stmt->execute();
241
+                                            $videos = $stmt->rowCount();
242 242
 
243
-											$stmt = $__db->prepare("SELECT id FROM users");
244
-											$stmt->execute();
245
-											$users = $stmt->rowCount();
243
+                                            $stmt = $__db->prepare("SELECT id FROM users");
244
+                                            $stmt->execute();
245
+                                            $users = $stmt->rowCount();
246 246
 
247
-											$stmt = $__db->prepare("SELECT id FROM comments");
248
-											$stmt->execute();
249
-											$comments = $stmt->rowCount();
247
+                                            $stmt = $__db->prepare("SELECT id FROM comments");
248
+                                            $stmt->execute();
249
+                                            $comments = $stmt->rowCount();
250 250
 
251
-											$stmt = $__db->prepare("SELECT id FROM views");
252
-											$stmt->execute();
253
-											$views = $stmt->rowCount();
251
+                                            $stmt = $__db->prepare("SELECT id FROM views");
252
+                                            $stmt->execute();
253
+                                            $views = $stmt->rowCount();
254 254
 
255
-											$stmt = $__db->prepare("SELECT id FROM pms");
256
-											$stmt->execute();
257
-											$pms = $stmt->rowCount();
255
+                                            $stmt = $__db->prepare("SELECT id FROM pms");
256
+                                            $stmt->execute();
257
+                                            $pms = $stmt->rowCount();
258 258
 
259
-											$stmt = $__db->prepare("SELECT id FROM playlists");
260
-											$stmt->execute();
261
-											$playlists = $stmt->rowCount();
262
-										?>
259
+                                            $stmt = $__db->prepare("SELECT id FROM playlists");
260
+                                            $stmt->execute();
261
+                                            $playlists = $stmt->rowCount();
262
+                                        ?>
263 263
 										<div style="width: 200px;display:inline-block;">
264 264
 											<?php $server = get_server_array_stats(); ?>
265 265
 											Videos uploaded: <b style="float:right;"><?php echo $videos; ?></b><br>
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Indentation   +122 added lines, -122 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">
@@ -154,21 +154,21 @@  discard block
 block discarded – undo
154 154
 
155 155
 									<?php $_user = $__user_h->fetch_user_username($_video['author']); ?>
156 156
 									<?php
157
-										$stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip");
158
-										$stmt->bindParam(":ip", $_user['ip']);
159
-										$stmt->execute();
160
-										$alts = $stmt->rowCount();
157
+                                        $stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip");
158
+                                        $stmt->bindParam(":ip", $_user['ip']);
159
+                                        $stmt->execute();
160
+                                        $alts = $stmt->rowCount();
161 161
 
162
-										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
162
+                                        if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
163 163
 
164
-										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
165
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
166
-												echo "
164
+                                        while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
165
+                                            if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
166
+                                                echo "
167 167
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
168
-													htmlspecialchars($username['username']) 
169
-												. "</a><br>";
170
-										}
171
-									?>
168
+                                                    htmlspecialchars($username['username']) 
169
+                                                . "</a><br>";
170
+                                        }
171
+                                    ?>
172 172
 									<hr>
173 173
 								<?php } ?>
174 174
 								<h1 id="watch-headline-title">
@@ -371,21 +371,21 @@  discard block
 block discarded – undo
371 371
 													<hr><br>
372 372
 													<h3>Add to a Playlist</h3>
373 373
 													<?php
374
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
375
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
376
-														$stmt->execute();
377
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
378
-															$buffer = json_decode($playlist['videos']);
379
-															@$rid = $buffer[0];
380
-															if(!empty($rid)) {
381
-																@$video = $__video_h->fetch_video_rid($rid);
382
-															} else {
383
-																$video['thumbnail'] = "";
384
-																$video['duration'] = 0;
385
-															}
374
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
375
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
376
+                                                        $stmt->execute();
377
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
378
+                                                            $buffer = json_decode($playlist['videos']);
379
+                                                            @$rid = $buffer[0];
380
+                                                            if(!empty($rid)) {
381
+                                                                @$video = $__video_h->fetch_video_rid($rid);
382
+                                                            } else {
383
+                                                                $video['thumbnail'] = "";
384
+                                                                $video['duration'] = 0;
385
+                                                            }
386 386
 
387
-															$videos = count($buffer);
388
-													?>
387
+                                                            $videos = count($buffer);
388
+                                                    ?>
389 389
 														<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>
390 390
 													<?php } ?>
391 391
 												<?php } ?>
@@ -650,10 +650,10 @@  discard block
 block discarded – undo
650 650
 												</div>
651 651
 											</div>
652 652
 											<?php 
653
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
654
-												$stmt->bindParam(":v", $_GET['v']);
655
-												$stmt->execute();
656
-											?>
653
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
654
+                                                $stmt->bindParam(":v", $_GET['v']);
655
+                                                $stmt->execute();
656
+                                            ?>
657 657
 
658 658
 											<?php if($stmt->rowCount() != 0) { ?>
659 659
 												<div class="comments-section">
@@ -663,16 +663,16 @@  discard block
 block discarded – undo
663 663
 													<h4>Video Responses</h4>
664 664
 													<ul class="video-list">
665 665
 													<?php 
666
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
667
-															if($__video_h->video_exists($video['video'])) { 
668
-																$video = $__video_h->fetch_video_rid($video['video']);
669
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
670
-																$video['duration'] = $__time_h->timestamp($video['duration']);
671
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
672
-																$video['author'] = htmlspecialchars($video['author']);		
673
-																$video['title'] = htmlspecialchars($video['title']);
674
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
675
-													?>
666
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
667
+                                                            if($__video_h->video_exists($video['video'])) { 
668
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
669
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
670
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
671
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
672
+                                                                $video['author'] = htmlspecialchars($video['author']);		
673
+                                                                $video['title'] = htmlspecialchars($video['title']);
674
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
675
+                                                    ?>
676 676
 														<li class="video-list-item yt-tile-default">
677 677
 															<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>
678 678
 															<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">
@@ -753,38 +753,38 @@  discard block
 block discarded – undo
753 753
 												</div>
754 754
 												<ul class="comment-list" id="live_comments">
755 755
 														<?php
756
-														$results_per_page = 20;
756
+                                                        $results_per_page = 20;
757 757
 
758
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
759
-														$stmt->bindParam(":rid", $_video['rid']);
760
-														$stmt->execute();
758
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
759
+                                                        $stmt->bindParam(":rid", $_video['rid']);
760
+                                                        $stmt->execute();
761 761
 
762
-														$number_of_result = $stmt->rowCount();
763
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
762
+                                                        $number_of_result = $stmt->rowCount();
763
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
764 764
 
765
-														if (!isset ($_GET['page']) ) {  
766
-															$page = 1;  
767
-														} else {  
768
-															$page = (int)$_GET['page'];  
769
-														}  
765
+                                                        if (!isset ($_GET['page']) ) {  
766
+                                                            $page = 1;  
767
+                                                        } else {  
768
+                                                            $page = (int)$_GET['page'];  
769
+                                                        }  
770 770
 
771
-														$page_first_result = ($page - 1) * $results_per_page;  
771
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
772 772
 
773
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
774
-														$stmt->bindParam(":rid", $_video['rid']);
775
-														$stmt->bindParam(":pfirst", $page_first_result);
776
-														$stmt->bindParam(":pper", $results_per_page);
777
-														$stmt->execute();
773
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
774
+                                                        $stmt->bindParam(":rid", $_video['rid']);
775
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
776
+                                                        $stmt->bindParam(":pper", $results_per_page);
777
+                                                        $stmt->execute();
778 778
 
779
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
780
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
781
-																$comment['liked'] = true;
782
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
783
-																$comment['disliked'] = true;
779
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
780
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
781
+                                                                $comment['liked'] = true;
782
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
783
+                                                                $comment['disliked'] = true;
784 784
 																
785
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
786
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
787
-													?>
785
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
786
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
787
+                                                    ?>
788 788
 
789 789
 														<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
790 790
 															<div class="comment-body">
@@ -850,12 +850,12 @@  discard block
 block discarded – undo
850 850
 															</div>
851 851
 														</li>
852 852
 														<?php 
853
-															$stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
854
-															$stmt2->bindParam(":rid", $comment['id']);
855
-															$stmt2->execute();
853
+                                                            $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
854
+                                                            $stmt2->bindParam(":rid", $comment['id']);
855
+                                                            $stmt2->execute();
856 856
 
857
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
858
-														?>
857
+                                                            while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
858
+                                                        ?>
859 859
 															<li class="comment yt-tile-default " style="margin-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0">
860 860
 																<div class="comment-body">
861 861
 																	<div class="content-container">
@@ -935,19 +935,19 @@  discard block
 block discarded – undo
935 935
 										<div id="watch-related-container" class="watch-sidebar-body">
936 936
 											<ul id="watch-related" class="video-list">
937 937
 												<?php
938
-													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
939
-													$stmt->execute();
940
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
941
-														$_playlist['videos'] = json_decode($_playlist['videos']);
942
-														$_playlist['count'] = 1;
938
+                                                    $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
939
+                                                    $stmt->execute();
940
+                                                    while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
941
+                                                        $_playlist['videos'] = json_decode($_playlist['videos']);
942
+                                                        $_playlist['count'] = 1;
943 943
 
944
-														if($__video_h->video_exists($_playlist['videos'][0])) {
945
-															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
946
-														} else {
947
-															$video = [];
948
-															$video['thumbnail'] = "default.jpg";
949
-														}
950
-												?>
944
+                                                        if($__video_h->video_exists($_playlist['videos'][0])) {
945
+                                                            $video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
946
+                                                        } else {
947
+                                                            $video = [];
948
+                                                            $video['thumbnail'] = "default.jpg";
949
+                                                        }
950
+                                                ?>
951 951
 												<li class="video-list-item">
952 952
 													<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">
953 953
 														<span class="ux-thumb-wrap">
@@ -994,16 +994,16 @@  discard block
 block discarded – undo
994 994
 												<?php } ?>
995 995
 												<div id="ppv-container" class="hid"></div>
996 996
 												<?php
997
-													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
998
-													$stmt->execute();
999
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1000
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1001
-														$video['duration'] = $__time_h->timestamp($video['duration']);
1002
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
1003
-														$video['author'] = htmlspecialchars($video['author']);		
1004
-														$video['title'] = htmlspecialchars($video['title']);
1005
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
1006
-												?>
997
+                                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
998
+                                                    $stmt->execute();
999
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1000
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1001
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
1002
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
1003
+                                                        $video['author'] = htmlspecialchars($video['author']);		
1004
+                                                        $video['title'] = htmlspecialchars($video['title']);
1005
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
1006
+                                                ?>
1007 1007
 												<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>
1008 1008
 													<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">
1009 1009
 													</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/s/mod/header.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2
-	if(isset($_SESSION['siteusername'])) {
2
+    if(isset($_SESSION['siteusername'])) {
3 3
         $stmt = $__db->prepare("UPDATE users SET ip = :ip WHERE username = :username");
4 4
         $stmt->bindParam(":username", $_SESSION['siteusername']);
5
-		$stmt->bindParam(":ip",       $_SERVER["HTTP_CF_CONNECTING_IP"]);
5
+        $stmt->bindParam(":ip",       $_SERVER["HTTP_CF_CONNECTING_IP"]);
6 6
         $stmt->execute();
7
-	}
7
+    }
8 8
 ?>
9 9
 <!-- begin masthead -->
10 10
 <div id="masthead" class="" dir="ltr">
Please login to merge, or discard this patch.