Test Failed
Push — main ( 293eda...53929d )
by chief
02:58
created
web/public/s/classes/page_builder.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@
 block discarded – undo
10 10
 class page_builder {
11 11
     public $__root;
12 12
 
13
-	public function __construct($templates){
13
+    public function __construct($templates){
14 14
         $this->__root = $templates;
15
-	}
15
+    }
16 16
 
17 17
     function return_template_replace(string $template, array $inputs) {
18 18
         $__template_file = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $this->__root . "/" . $template);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@
 block discarded – undo
10 10
 class page_builder {
11 11
     public $__root;
12 12
 
13
-	public function __construct($templates){
13
+	public function __construct($templates) {
14 14
         $this->__root = $templates;
15 15
 	}
16 16
 
17 17
     function return_template_replace(string $template, array $inputs) {
18 18
         $__template_file = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $this->__root . "/" . $template);
19 19
 
20
-        foreach($inputs as $key => $input) {
20
+        foreach ($inputs as $key => $input) {
21 21
             $__template_file = str_replace("{{" . $key . "}}", $input, $__template_file);
22 22
         }
23 23
 
Please login to merge, or discard this patch.
web/public/index.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
 <?php $__time_h = new time_helper(); ?>
12 12
 <?php ob_start(); ?>
13 13
 <?php
14
-	$__server->page_embeds->page_title = "SubRocks - Homepage";
15
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
16
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
17
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
14
+    $__server->page_embeds->page_title = "SubRocks - Homepage";
15
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
16
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
17
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
18 18
 ?>
19 19
 <!DOCTYPE html>
20 20
 <html>
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 							</div>
64 64
 							<div class="guide">
65 65
 							<?php 
66
-								if(isset($_SESSION['siteusername'])) {
67
-								?>
66
+                                if(isset($_SESSION['siteusername'])) {
67
+                                ?>
68 68
 								<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">
69 69
 								<a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel
70 70
 								<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="see-more-arrow" alt=""></a>        
@@ -227,16 +227,16 @@  discard block
 block discarded – undo
227 227
 							</p>
228 228
 							<ul>
229 229
 								<?php
230
-									$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
231
-									$stmt->execute();
232
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
233
-										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
234
-										$video['duration'] = $__time_h->timestamp($video['duration']);
235
-										$video['views'] = $__video_h->fetch_video_views($video['rid']);
236
-										$video['author'] = htmlspecialchars($video['author']);		
237
-										$video['title'] = htmlspecialchars($video['title']);
238
-										$video['description'] = $__video_h->shorten_description($video['description'], 50);
239
-								?>
230
+                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
231
+                                    $stmt->execute();
232
+                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
233
+                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
234
+                                        $video['duration'] = $__time_h->timestamp($video['duration']);
235
+                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
236
+                                        $video['author'] = htmlspecialchars($video['author']);		
237
+                                        $video['title'] = htmlspecialchars($video['title']);
238
+                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
239
+                                ?>
240 240
 								<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>
241 241
 									<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">
242 242
 									</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
@@ -250,16 +250,16 @@  discard block
 block discarded – undo
250 250
 							</h3>
251 251
 							<ul>
252 252
 								<?php
253
-									$stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
254
-									$stmt->execute();
255
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
256
-										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
257
-										$video['duration'] = $__time_h->timestamp($video['duration']);
258
-										$video['views'] = $__video_h->fetch_video_views($video['rid']);
259
-										$video['author'] = htmlspecialchars($video['author']);		
260
-										$video['title'] = htmlspecialchars($video['title']);
261
-										$video['description'] = $__video_h->shorten_description($video['description'], 50);
262
-								?>
253
+                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
254
+                                    $stmt->execute();
255
+                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
256
+                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
257
+                                        $video['duration'] = $__time_h->timestamp($video['duration']);
258
+                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
259
+                                        $video['author'] = htmlspecialchars($video['author']);		
260
+                                        $video['title'] = htmlspecialchars($video['title']);
261
+                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
262
+                                ?>
263 263
 								<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>
264 264
 									<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">
265 265
 									</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
@@ -283,20 +283,20 @@  discard block
 block discarded – undo
283 283
 									<div class="feed-page">
284 284
 										<ul>
285 285
 											<?php
286
-												$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
287
-												$stmt->execute();
288
-												while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
289
-													$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
290
-													$video['duration'] = $__time_h->timestamp($video['duration']);
291
-													$video['views'] = $__video_h->fetch_video_views($video['rid']);
292
-													$video['author'] = htmlspecialchars($video['author']);		
293
-													$video['title'] = htmlspecialchars($video['title']);
294
-													$video['description'] = $__video_h->shorten_description($video['description'], 50);
295
-													$video['pfp'] = $__user_h->fetch_pfp($video['author']);
286
+                                                $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
287
+                                                $stmt->execute();
288
+                                                while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
289
+                                                    $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
290
+                                                    $video['duration'] = $__time_h->timestamp($video['duration']);
291
+                                                    $video['views'] = $__video_h->fetch_video_views($video['rid']);
292
+                                                    $video['author'] = htmlspecialchars($video['author']);		
293
+                                                    $video['title'] = htmlspecialchars($video['title']);
294
+                                                    $video['description'] = $__video_h->shorten_description($video['description'], 50);
295
+                                                    $video['pfp'] = $__user_h->fetch_pfp($video['author']);
296 296
 
297
-													echo $__page_b->return_template_replace("index_video_1.module", $video);
298
-												} 
299
-											?>
297
+                                                    echo $__page_b->return_template_replace("index_video_1.module", $video);
298
+                                                } 
299
+                                            ?>
300 300
 										</ul>
301 301
 									</div>
302 302
 								</div>
@@ -571,18 +571,18 @@  discard block
 block discarded – undo
571 571
 
572 572
 $__template = ob_get_clean();
573 573
 $__template_inputs = [
574
-	'header' => '',
575
-	'test2' => '',
576
-	'test3' => '',
574
+    'header' => '',
575
+    'test2' => '',
576
+    'test3' => '',
577 577
 ];
578 578
 
579 579
 foreach($__template_inputs as $key => $input) {
580
-	$__template = 
581
-		str_replace(
582
-			"{{" . $key . "}}", 
583
-			$input, 
584
-			$__template
585
-		);
580
+    $__template = 
581
+        str_replace(
582
+            "{{" . $key . "}}", 
583
+            $input, 
584
+            $__template
585
+        );
586 586
 }
587 587
 
588 588
 echo $__template;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 				<div id="content">
46 46
 					<div class="guide-layout-container enable-fancy-subscribe-button">
47 47
 						<div class="guide-container">
48
-						<?php if(!isset($_SESSION['siteusername'])) { ?>
48
+						<?php if (!isset($_SESSION['siteusername'])) { ?>
49 49
 									<div id="guide-builder-promo">
50 50
 								<h2>
51 51
 							Sign in to add channels to your homepage
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 							</div>
64 64
 							<div class="guide">
65 65
 							<?php 
66
-								if(isset($_SESSION['siteusername'])) {
66
+								if (isset($_SESSION['siteusername'])) {
67 67
 								?>
68 68
 								<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">
69 69
 								<a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 											</span>
175 175
 											</a>
176 176
 										</li>
177
-                                        <?php if(!isset($_SESSION['siteusername'])) { ?>
178
-                                            <?php foreach($__server->featured_channels as $channel) { ?>
177
+                                        <?php if (!isset($_SESSION['siteusername'])) { ?>
178
+                                            <?php foreach ($__server->featured_channels as $channel) { ?>
179 179
                                                 <li class="guide-item-container ">
180 180
                                                     <a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user">
181 181
                                                     <span class="thumb">  <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span>
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
                                                 $stmt = $__db->prepare("SELECT * FROM subscribers WHERE sender = :username ORDER BY id DESC LIMIT 20");
191 191
                                                 $stmt->bindParam(":username", $_SESSION['siteusername']);
192 192
                                                 $stmt->execute();
193
-                                                while($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?>
193
+                                                while ($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?>
194 194
                                                 <li class="guide-item-container ">
195 195
                                                     <a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user">
196 196
                                                     <span class="thumb">  <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span>
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 								<?php
230 230
 									$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4");
231 231
 									$stmt->execute();
232
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
232
+									while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
233 233
 										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
234 234
 										$video['duration'] = $__time_h->timestamp($video['duration']);
235 235
 										$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 								<?php
253 253
 									$stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4");
254 254
 									$stmt->execute();
255
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
255
+									while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
256 256
 										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
257 257
 										$video['duration'] = $__time_h->timestamp($video['duration']);
258 258
 										$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 											<?php
286 286
 												$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20");
287 287
 												$stmt->execute();
288
-												while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
288
+												while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
289 289
 													$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
290 290
 													$video['duration'] = $__time_h->timestamp($video['duration']);
291 291
 													$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	'test3' => '',
577 577
 ];
578 578
 
579
-foreach($__template_inputs as $key => $input) {
579
+foreach ($__template_inputs as $key => $input) {
580 580
 	$__template = 
581 581
 		str_replace(
582 582
 			"{{" . $key . "}}", 
Please login to merge, or discard this patch.