Test Failed
Push — main ( 00747d...5f665f )
by chief
03:00
created
web/public/d/edit_playlist.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14 14
     $_playlist = $__video_h->fetch_playlist_rid($_GET['v']);
15
-    if($_playlist['author'] != @$_SESSION['siteusername']) {
15
+    if ($_playlist['author'] != @$_SESSION['siteusername']) {
16 16
         die();
17 17
     }
18 18
 
Please login to merge, or discard this patch.
web/public/s/mod/sidebar.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@
 block discarded – undo
39 39
 ?>
40 40
 <div id="browse-side-column" class="ytg-2col ytg-last">
41 41
     <ol class="navigation-menu">
42
-        <?php foreach($__tabs as $_tab) { 
43
-            if(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url)
42
+        <?php foreach ($__tabs as $_tab) { 
43
+            if (parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url)
44 44
                 $_tab->selected = true;
45 45
             ?>
46 46
             <li class="menu-item">
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@
 block discarded – undo
40 40
 <div id="browse-side-column" class="ytg-2col ytg-last">
41 41
     <ol class="navigation-menu">
42 42
         <?php foreach($__tabs as $_tab) { 
43
-            if(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url)
44
-                $_tab->selected = true;
43
+            if(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url) {
44
+                            $_tab->selected = true;
45
+            }
45 46
             ?>
46 47
             <li class="menu-item">
47 48
                 <a class="<?php echo $_tab->selected ? true : "selected"; ?>" href="<?php echo $_tab->url; ?>">
Please login to merge, or discard this patch.
web/public/uploaded_video.php 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(!$__video_h->video_exists($_GET['v']))
16
-		header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
15
+    if(!$__video_h->video_exists($_GET['v']))
16
+        header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
17 17
 
18
-	$_video = $__video_h->fetch_video_rid($_GET['v']); 
19
-	$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
20
-	$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
21
-	$_video['duration'] = $__time_h->timestamp($_video['duration']);
22
-	$_video['views'] = $__video_h->fetch_video_views($_video['rid']);
23
-	$_video['author'] = htmlspecialchars($_video['author']);		
24
-	$_video['title'] = htmlspecialchars($_video['title']);
25
-	$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
18
+    $_video = $__video_h->fetch_video_rid($_GET['v']); 
19
+    $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
20
+    $_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
21
+    $_video['duration'] = $__time_h->timestamp($_video['duration']);
22
+    $_video['views'] = $__video_h->fetch_video_views($_video['rid']);
23
+    $_video['author'] = htmlspecialchars($_video['author']);		
24
+    $_video['title'] = htmlspecialchars($_video['title']);
25
+    $_video['description'] = $__video_h->shorten_description($_video['description'], 50);
26 26
 
27 27
     if($_SESSION['siteusername'] != $_video['author'])
28 28
         header("Location: /");
29 29
 ?>
30 30
 <?php
31
-	$__server->page_embeds->page_title = "SubRocks - Uploaded Video";
32
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
33
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
34
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
31
+    $__server->page_embeds->page_title = "SubRocks - Uploaded Video";
32
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
33
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
34
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
35 35
 ?>
36 36
 <!DOCTYPE html>
37 37
 <html>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  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(!$__video_h->video_exists($_GET['v']))
15
+	if (!$__video_h->video_exists($_GET['v']))
16 16
 		header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
17 17
 
18 18
 	$_video = $__video_h->fetch_video_rid($_GET['v']); 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	$_video['title'] = htmlspecialchars($_video['title']);
25 25
 	$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
26 26
 
27
-    if($_SESSION['siteusername'] != $_video['author'])
27
+    if ($_SESSION['siteusername'] != $_video['author'])
28 28
         header("Location: /");
29 29
 ?>
30 30
 <?php
Please login to merge, or discard this patch.
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,8 +12,9 @@  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(!$__video_h->video_exists($_GET['v']))
16
-		header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
15
+	if(!$__video_h->video_exists($_GET['v'])) {
16
+			header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
17
+	}
17 18
 
18 19
 	$_video = $__video_h->fetch_video_rid($_GET['v']); 
19 20
 	$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
@@ -24,9 +25,10 @@  discard block
 block discarded – undo
24 25
 	$_video['title'] = htmlspecialchars($_video['title']);
25 26
 	$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
26 27
 
27
-    if($_SESSION['siteusername'] != $_video['author'])
28
-        header("Location: /");
29
-?>
28
+    if($_SESSION['siteusername'] != $_video['author']) {
29
+            header("Location: /");
30
+    }
31
+    ?>
30 32
 <?php
31 33
 	$__server->page_embeds->page_title = "SubRocks - Uploaded Video";
32 34
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
Please login to merge, or discard this patch.
web/public/inbox/pm.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - Personal Messages";
14
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
13
+    $__server->page_embeds->page_title = "SubRocks - Personal Messages";
14
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <?php $__user_u = new user_update($__db); ?>
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13 13
 	$__server->page_embeds->page_title = "SubRocks - Personal Messages";
14 14
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
                                     $stmt->execute();
179 179
 
180 180
                                     $number_of_result = $stmt->rowCount();
181
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
181
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
182 182
 
183
-                                    if (!isset ($_GET['page']) ) {  
183
+                                    if (!isset ($_GET['page'])) {  
184 184
                                         $page = 1;  
185 185
                                     } else {  
186
-                                        $page = (int)$_GET['page'];  
186
+                                        $page = (int) $_GET['page'];  
187 187
                                     }  
188 188
 
189
-                                    $page_first_result = ($page - 1) * $results_per_page;  
189
+                                    $page_first_result = ($page - 1)*$results_per_page;  
190 190
 
191 191
                                     $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nm' AND readed = 'y'  ORDER BY id DESC LIMIT :pfirst, :pper");
192 192
                                     $stmt6->bindParam(":search", $search);
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
                                     </tr>
212 212
                                     
213 213
                                     <?php
214
-                                        while($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
215
-                                            if($__video_h->video_exists($inbox['video_attribute'])) {
214
+                                        while ($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
215
+                                            if ($__video_h->video_exists($inbox['video_attribute'])) {
216 216
                                                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
217 217
                                                 $inbox['video_attr_exists'] = true;
218 218
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                                     ?> 
227 227
                                     <tr style="margin-top: 5px;" id="videoslist">
228 228
                                             <!--
229
-                                            <?php if($inbox['readed'] == "n") { ?>
229
+                                            <?php if ($inbox['readed'] == "n") { ?>
230 230
                                                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
231 231
                                                 NEW
232 232
                                                 </a>
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 											<p style="width:475px;">
258 258
                                             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
259 259
 											</p>
260
-                                            <?php if($inbox['video_attr_exists']) { ?>
260
+                                            <?php if ($inbox['video_attr_exists']) { ?>
261 261
                                                 <hr>
262 262
                                                 <ul>
263 263
                                                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['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 $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                                     </div>
285 285
                                 </center><br>
286 286
 
287
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
287
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
288 288
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch(<?php echo $page; ?>)"><?php echo $page; ?></button>
289 289
                                 <?php } ?>   
290 290
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                                 </script>
309 309
 
310 310
                                 <?php 
311
-                                    if($stmt6->rowCount() == 0) { echo "
311
+                                    if ($stmt6->rowCount() == 0) { echo "
312 312
                                         You currently have no personal messages in your inbox.
313 313
                                     "; 
314 314
                                 } ?>
Please login to merge, or discard this patch.
web/public/inbox/notifications.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php
12
-	$__server->page_embeds->page_title = "SubRocks - Notifications";
13
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
14
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
12
+    $__server->page_embeds->page_title = "SubRocks - Notifications";
13
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
14
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
16 16
 ?>
17 17
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
18 18
 <!DOCTYPE html>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15 15
 	$__server->page_embeds->page_url = "https://subrock.rocks/";
16 16
 ?>
17
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
20 20
 	<head>
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
                                     $stmt->execute();
179 179
 
180 180
                                     $number_of_result = $stmt->rowCount();
181
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
181
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
182 182
 
183
-                                    if (!isset ($_GET['page']) ) {  
183
+                                    if (!isset ($_GET['page'])) {  
184 184
                                         $page = 1;  
185 185
                                     } else {  
186
-                                        $page = (int)$_GET['page'];  
186
+                                        $page = (int) $_GET['page'];  
187 187
                                     }  
188 188
 
189
-                                    $page_first_result = ($page - 1) * $results_per_page;  
189
+                                    $page_first_result = ($page - 1)*$results_per_page;  
190 190
 
191 191
                                     $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nt' AND readed = 'y' ORDER BY id DESC LIMIT :pfirst, :pper");
192 192
                                     $stmt6->bindParam(":search", $search);
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
                                     </tr>
212 212
                                     
213 213
                                     <?php
214
-                                        while($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
215
-                                            if($__video_h->video_exists($inbox['video_attribute'])) {
214
+                                        while ($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
215
+                                            if ($__video_h->video_exists($inbox['video_attribute'])) {
216 216
                                                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
217 217
                                                 $inbox['video_attr_exists'] = true;
218 218
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                                     ?> 
227 227
                                     <tr style="margin-top: 5px;" id="videoslist">
228 228
                                             <!--
229
-                                            <?php if($inbox['readed'] == "n") { ?>
229
+                                            <?php if ($inbox['readed'] == "n") { ?>
230 230
                                                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
231 231
                                                 NEW
232 232
                                                 </a>
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 											<p style="width:475px;">
258 258
                                             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
259 259
 											</p>
260
-                                            <?php if($inbox['video_attr_exists']) { ?>
260
+                                            <?php if ($inbox['video_attr_exists']) { ?>
261 261
                                                 <hr>
262 262
                                                 <ul>
263 263
                                                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['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 $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                                     </div>
285 285
                                 </center><br>
286 286
 
287
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
287
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
288 288
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch(<?php echo $page; ?>)"><?php echo $page; ?></button>
289 289
                                 <?php } ?>   
290 290
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                                 </script>
309 309
 
310 310
                                 <?php 
311
-                                    if($stmt6->rowCount() == 0) { echo "
311
+                                    if ($stmt6->rowCount() == 0) { echo "
312 312
                                         You currently have no notifications in your inbox.
313 313
                                     "; 
314 314
                                 } ?>
Please login to merge, or discard this patch.
web/public/inbox/compose.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - Compose";
14
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
13
+    $__server->page_embeds->page_title = "SubRocks - Compose";
14
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <?php
19 19
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <?php $__user_u = new user_update($__db); ?>
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13 13
 	$__server->page_embeds->page_title = "SubRocks - Compose";
14 14
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 	$__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <?php
19
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
19
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
20 20
         $error = array();
21 21
 
22
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "You are not logged in"; $error['status'] = true; }
23
-        if(!$_POST['contents']){ $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
24
-        if(empty(trim($_POST['subject']))){ $error['message'] = "Your subject cannot be blank"; $error['status'] = true; }
25
-        if(strlen($_POST['contents']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
26
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before sending a private message."; $error['status'] = true; }
22
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "You are not logged in"; $error['status'] = true; }
23
+        if (!$_POST['contents']) { $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
24
+        if (empty(trim($_POST['subject']))) { $error['message'] = "Your subject cannot be blank"; $error['status'] = true; }
25
+        if (strlen($_POST['contents']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
26
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before sending a private message."; $error['status'] = true; }
27 27
 
28
-        if(!isset($error['message'])) {
28
+        if (!isset($error['message'])) {
29 29
             $stmt = $__db->prepare("INSERT INTO pms (touser, subject, message, owner) VALUES (:touser, :subject, :message, :owner)");
30 30
             $stmt->bindParam(":subject", $_POST['subject']);
31 31
             $stmt->bindParam(":message", $_POST['contents']);
Please login to merge, or discard this patch.
web/public/inbox/index.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 <?php $__time_h = new time_helper(); ?>
12 12
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13 13
 <?php
14
-	$__server->page_embeds->page_title = "SubRocks - Inbox";
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 - Inbox";
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 dir="ltr">
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 <?php $__user_u = new user_update($__db); ?>
10 10
 <?php $__db_h = new db_helper(); ?>
11 11
 <?php $__time_h = new time_helper(); ?>
12
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13 13
 <?php
14 14
 	$__server->page_embeds->page_title = "SubRocks - Inbox";
15 15
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -179,15 +179,15 @@  discard block
 block discarded – undo
179 179
                                     $stmt->execute();
180 180
 
181 181
                                     $number_of_result = $stmt->rowCount();
182
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
182
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
183 183
 
184
-                                    if (!isset ($_GET['page']) ) {  
184
+                                    if (!isset ($_GET['page'])) {  
185 185
                                         $page = 1;  
186 186
                                     } else {  
187
-                                        $page = (int)$_GET['page'];  
187
+                                        $page = (int) $_GET['page'];  
188 188
                                     }  
189 189
 
190
-                                    $page_first_result = ($page - 1) * $results_per_page;  
190
+                                    $page_first_result = ($page - 1)*$results_per_page;  
191 191
 
192 192
                                     $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND readed = 'y' ORDER BY id DESC LIMIT :pfirst, :pper");
193 193
                                     $stmt6->bindParam(":search", $search);
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
                                     </tr>
213 213
                                     
214 214
                                     <?php
215
-                                        while($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
216
-                                            if($__video_h->video_exists($inbox['video_attribute'])) {
215
+                                        while ($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
216
+                                            if ($__video_h->video_exists($inbox['video_attribute'])) {
217 217
                                                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
218 218
                                                 $inbox['video_attr_exists'] = true;
219 219
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                                     ?> 
228 228
                                     <tr style="margin-top: 5px;" id="videoslist">
229 229
                                             <!--
230
-                                            <?php if($inbox['readed'] == "n") { ?>
230
+                                            <?php if ($inbox['readed'] == "n") { ?>
231 231
                                                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
232 232
                                                 NEW
233 233
                                                 </a>
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 											<p style="width:475px;">
259 259
                                             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
260 260
 											</p>
261
-                                            <?php if($inbox['video_attr_exists']) { ?>
261
+                                            <?php if ($inbox['video_attr_exists']) { ?>
262 262
                                                 <hr>
263 263
                                                 <ul>
264 264
                                                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['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 $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
                                     </div>
286 286
                                 </center><br>
287 287
 
288
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
288
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
289 289
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch(<?php echo $page; ?>)"><?php echo $page; ?></button>
290 290
                                 <?php } ?>   
291 291
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
                                 </script>
310 310
 
311 311
                                 <?php 
312
-                                    if($stmt6->rowCount() == 0) { echo "
312
+                                    if ($stmt6->rowCount() == 0) { echo "
313 313
                                         You currently have no messages in your inbox.
314 314
                                     "; 
315 315
                                 } ?>
Please login to merge, or discard this patch.
web/public/inbox/sent.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - Sent Messages";
14
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
13
+    $__server->page_embeds->page_title = "SubRocks - Sent Messages";
14
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <?php $__user_u = new user_update($__db); ?>
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13 13
 	$__server->page_embeds->page_title = "SubRocks - Sent Messages";
14 14
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
                                     $stmt->execute();
179 179
 
180 180
                                     $number_of_result = $stmt->rowCount();
181
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
181
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
182 182
 
183
-                                    if (!isset ($_GET['page']) ) {  
183
+                                    if (!isset ($_GET['page'])) {  
184 184
                                         $page = 1;  
185 185
                                     } else {  
186
-                                        $page = (int)$_GET['page'];  
186
+                                        $page = (int) $_GET['page'];  
187 187
                                     }  
188 188
 
189
-                                    $page_first_result = ($page - 1) * $results_per_page;  
189
+                                    $page_first_result = ($page - 1)*$results_per_page;  
190 190
 
191 191
                                     $stmt6 = $__db->prepare("SELECT * FROM pms WHERE owner = :search AND readed = 'y' ORDER BY id DESC LIMIT :pfirst, :pper");
192 192
                                     $stmt6->bindParam(":search", $search);
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
                                     </tr>
212 212
                                     
213 213
                                     <?php
214
-                                        while($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
215
-                                            if($__video_h->video_exists($inbox['video_attribute'])) {
214
+                                        while ($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
215
+                                            if ($__video_h->video_exists($inbox['video_attribute'])) {
216 216
                                                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
217 217
                                                 $inbox['video_attr_exists'] = true;
218 218
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                                     ?> 
227 227
                                     <tr style="margin-top: 5px;" id="videoslist">
228 228
                                             <!--
229
-                                            <?php if($inbox['readed'] == "n") { ?>
229
+                                            <?php if ($inbox['readed'] == "n") { ?>
230 230
                                                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
231 231
                                                 NEW
232 232
                                                 </a>
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 											<p style="width:475px;">
258 258
                                             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
259 259
 											</p>
260
-                                            <?php if($inbox['video_attr_exists']) { ?>
260
+                                            <?php if ($inbox['video_attr_exists']) { ?>
261 261
                                                 <hr>
262 262
                                                 <ul>
263 263
                                                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['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 $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                                     </div>
285 285
                                 </center><br>
286 286
 
287
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
287
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
288 288
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch(<?php echo $page; ?>)"><?php echo $page; ?></button>
289 289
                                 <?php } ?>   
290 290
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                                 </script>
309 309
 
310 310
                                 <?php 
311
-                                    if($stmt6->rowCount() == 0) { echo "
311
+                                    if ($stmt6->rowCount() == 0) { echo "
312 312
                                         You currently have no sent messages in your inbox.
313 313
                                     "; 
314 314
                                 } ?>
Please login to merge, or discard this patch.
web/public/d/edit_video.php 2 patches
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.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14 14
     $_video = $__video_h->fetch_video_rid($_GET['v']);
15
-    if($_video['author'] != @$_SESSION['siteusername']) {
15
+    if ($_video['author'] != @$_SESSION['siteusername']) {
16 16
         die();
17 17
     }
18 18
 
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
     // $__video_u->update_row($_GET['v'], "thumbnail", $request->thumbnail);
45 45
     $__video_u->update_row($_GET['v'], "category", $request->category);
46 46
 
47
-    if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) {
48
-        if(!empty($_FILES["thumbnail"]["name"])) {
47
+    if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) {
48
+        if (!empty($_FILES["thumbnail"]["name"])) {
49 49
             $target_dir = "../dynamic/thumbs/";
50 50
             $imageFileType = strtolower(pathinfo($_FILES["thumbnail"]["name"], PATHINFO_EXTENSION));
51 51
             $target_name = md5_file($_FILES["thumbnail"]["tmp_name"]) . "." . $imageFileType;
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
             $uploadOk = true;
56 56
             $movedFile = false;
57 57
     
58
-            if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
59
-                && $imageFileType != "gif" ) {
58
+            if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
59
+                && $imageFileType != "gif") {
60 60
                 $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
61 61
                 $uploadOk = false;
62 62
                 goto skip;
Please login to merge, or discard this patch.