Test Failed
Push — main ( 9ed252...2dd05d )
by chief
08:07 queued 12s
created
web/public/my_videos.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14 14
 	$__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
16
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <!DOCTYPE html>
18 18
 <html dir="ltr">
19 19
 	<head>
@@ -168,15 +168,15 @@  discard block
 block discarded – undo
168 168
                                     $search = $_SESSION['siteusername'];
169 169
                                     $results_per_page = 12;
170 170
                                     $number_of_result = $stmt->rowCount();
171
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
171
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
172 172
 
173
-                                    if (!isset ($_GET['page']) ) {  
173
+                                    if (!isset ($_GET['page'])) {  
174 174
                                         $page = 1;  
175 175
                                     } else {  
176
-                                        $page = (int)$_GET['page'];  
176
+                                        $page = (int) $_GET['page'];  
177 177
                                     }  
178 178
 
179
-                                    $page_first_result = ($page - 1) * $results_per_page;  
179
+                                    $page_first_result = ($page - 1)*$results_per_page;  
180 180
                                 ?>
181 181
                                 <?php 
182 182
                                     $stmt6 = $__db->prepare("SELECT * FROM videos WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper");
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                                     </tr>
202 202
                                     
203 203
                                     <?php
204
-                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
204
+                                        while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
205 205
                                             $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
206 206
                                             $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
207 207
                                             $video['duration'] = $__time_h->timestamp($video['duration']);
@@ -210,19 +210,19 @@  discard block
 block discarded – undo
210 210
                                             $video['title'] = htmlspecialchars($video['title']);
211 211
                                             $video['description'] = $__video_h->shorten_description($video['description'], 50);
212 212
 
213
-                                            if($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") {
213
+                                            if ($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") {
214 214
                                                 $status = "Corrupted";
215
-                                            } else if($video['visibility'] == "v") {
215
+                                            } else if ($video['visibility'] == "v") {
216 216
                                                 $status = "Approved";
217
-                                            } else if($video['visibility'] == "n") {
217
+                                            } else if ($video['visibility'] == "n") {
218 218
                                                 $status = "Approved";
219
-                                            } else if($video['visibility'] == "o") {
219
+                                            } else if ($video['visibility'] == "o") {
220 220
                                                 $status = "Disapproved";
221 221
                                             } else {
222 222
                                                 $status = "Unknown";
223 223
                                             }                      
224 224
                                             
225
-                                            if($video['commenting'] == "a") 
225
+                                            if ($video['commenting'] == "a") 
226 226
                                                 $video['commentstatus'] = "Commenting allowed";
227 227
                                             else 
228 228
                                                 $video['commentstatus'] = "Commenting disallowed";
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                                     </div>
287 287
                                 </center>
288 288
 
289
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
289
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
290 290
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button>
291 291
                                 <?php } ?>   
292 292
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
                                 </script>
333 333
 
334 334
                                 <?php 
335
-                                    if($stmt6->rowCount() == 0) { echo "
335
+                                    if ($stmt6->rowCount() == 0) { echo "
336 336
                                         <br>Welcome to your Video Manager! You can manage your uploaded videos here.<br>
337 337
                                         <a href=\"upload_video\">
338 338
                                             <button type=\"button\" class=\" yt-uix-button yt-uix-button-default\" role=\"button\">
Please login to merge, or discard this patch.
web/public/subscriptions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 <?php $__user_h = new user_helper($__db); ?>
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
10
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11 11
 <?php
12 12
 	$__server->page_embeds->page_title = "SubRocks - Subscriptions";
13 13
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 								<hr><br>
167 167
                                 
168 168
                                 <div class="my_videos_ajax">                                  
169
-                                    <?php while($user = $stmt->fetch(PDO::FETCH_ASSOC)) {  ?> 
169
+                                    <?php while ($user = $stmt->fetch(PDO::FETCH_ASSOC)) {  ?> 
170 170
                                         <div style="width: 33%;display: inline-block;">
171 171
                                             <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($user['reciever']); ?>">
172 172
                                             <span style="display: inline-block; vertical-align:top;width: 100px;font-size: 11px;">
Please login to merge, or discard this patch.
web/public/d/signup.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     }
37 37
 
38 38
 
39
-    if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
39
+    if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
40 40
         $request = (object) [
41 41
             "username" => $_POST['username'],
42 42
             "password" => $_POST['password'],
@@ -56,30 +56,30 @@  discard block
 block discarded – undo
56 56
         $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]);
57 57
         $stmt->execute();
58 58
 
59
-        if($stmt->rowCount() >= 3) { $request->error->message = "You cannot make alt accounts."; $request->error->status = "";  }
59
+        if ($stmt->rowCount() >= 3) { $request->error->message = "You cannot make alt accounts."; $request->error->status = ""; }
60 60
 
61 61
         if (!filter_var($request->email, FILTER_VALIDATE_EMAIL)) 
62
-            { $request->error->message = "Your email is invalid!"; $request->error->status = "";  }
63
-        if(strlen($request->username) > 21) 
62
+            { $request->error->message = "Your email is invalid!"; $request->error->status = ""; }
63
+        if (strlen($request->username) > 21) 
64 64
             { $request->error->message = "Your username must be shorter than 20 characters."; $request->error->status = ""; }
65
-        if(strlen($request->password) < 8) 
65
+        if (strlen($request->password) < 8) 
66 66
             { $request->error->message = "Your password must at least be 8 characters long."; $request->error->status = ""; }
67
-        if(!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) 
67
+        if (!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) 
68 68
             { $request->error->message = "Include numbers and letters in your password!"; $request->error->status = ""; }
69
-        if(preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $request->username))
69
+        if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $request->username))
70 70
             { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; }
71
-        if(!preg_match('/^\S+\w\S{1,}/', $request->username)) 
71
+        if (!preg_match('/^\S+\w\S{1,}/', $request->username)) 
72 72
             { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; }
73
-        if(empty(trim($request->username))) 
73
+        if (empty(trim($request->username))) 
74 74
             { $request->error->message = "Your username cannot be empty!"; $request->error->status = ""; }
75 75
         
76 76
         $stmt = $__db->prepare("SELECT username FROM users WHERE username = lower(:username)");
77 77
         $stmt->bindParam(":username", $request->username);
78 78
         $stmt->execute();
79
-        if($stmt->rowCount()) 
79
+        if ($stmt->rowCount()) 
80 80
             { $request->error->message = "There's already a user with that same username!"; $request->error->status = ""; }
81 81
         
82
-        if($request->error->status == "OK") {
82
+        if ($request->error->status == "OK") {
83 83
             $stmt = $__db->prepare("INSERT INTO users (username, email, password) VALUES (:username, :email, :password)");
84 84
             $stmt->bindParam(":username", $request->username);
85 85
             $stmt->bindParam(":email", $request->email);
Please login to merge, or discard this patch.
web/public/channel_videos.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@  discard block
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(isset($_SESSION['siteusername']))
16
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
15
+    if(isset($_SESSION['siteusername']))
16
+        $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
17 17
 
18 18
     if(!$__user_h->user_exists($_GET['n']))
19 19
         header("Location: /?userdoesntexist");
20 20
 
21 21
     $_user = $__user_h->fetch_user_username($_GET['n']);
22 22
 
23
-	$stmt = $__db->prepare("SELECT * FROM bans WHERE username = :username ORDER BY id DESC");
24
-	$stmt->bindParam(":username", $_user['username']);
25
-	$stmt->execute();
23
+    $stmt = $__db->prepare("SELECT * FROM bans WHERE username = :username ORDER BY id DESC");
24
+    $stmt->bindParam(":username", $_user['username']);
25
+    $stmt->execute();
26 26
 
27
-	while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28
-		header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines.");
29
-	}
27
+    while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28
+        header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines.");
29
+    }
30 30
 
31 31
     function clean($string) {
32 32
         $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
@@ -34,21 +34,21 @@  discard block
 block discarded – undo
34 34
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
35 35
     }
36 36
 
37
-	function addhttp($url) {
38
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
39
-			$url = "http://" . $url;
40
-		}
41
-		return $url;
42
-	}
37
+    function addhttp($url) {
38
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
39
+            $url = "http://" . $url;
40
+        }
41
+        return $url;
42
+    }
43 43
 
44 44
     function check_valid_colorhex($colorCode) {
45 45
         // If user accidentally passed along the # sign, strip it off
46 46
         $colorCode = ltrim($colorCode, '#');
47 47
     
48 48
         if (
49
-              ctype_xdigit($colorCode) &&
49
+                ctype_xdigit($colorCode) &&
50 50
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
51
-                   return true;
51
+                    return true;
52 52
     
53 53
         else return false;
54 54
     }
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
84 84
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
85 85
 
86
-	if(isset($_SESSION['siteusername']))
87
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
86
+    if(isset($_SESSION['siteusername']))
87
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
88 88
 
89 89
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
90 90
         $error = array();
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
99 99
 
100 100
         if(!isset($error['message'])) {
101
-			$text = $_POST['comment'];
101
+            $text = $_POST['comment'];
102 102
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
103
-			$stmt->bindParam(":id", $_user['username']);
104
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
105
-			$stmt->bindParam(":comment", $text);
103
+            $stmt->bindParam(":id", $_user['username']);
104
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
105
+            $stmt->bindParam(":comment", $text);
106 106
             $stmt->execute();
107 107
 
108 108
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
     }
115 115
 ?>
116 116
 <?php
117
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
118
-	$__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
119
-	$__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
120
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
117
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
118
+    $__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
119
+    $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
120
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
121 121
 ?>
122 122
 <!DOCTYPE html>
123 123
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -145,27 +145,27 @@  discard block
 block discarded – undo
145 145
 				background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>);
146 146
 				background-repeat: repeat;
147 147
 				<?php
148
-					switch($_user['2012_bgoption']) {
149
-						case "stretch":
150
-						echo "background-size: cover;";
151
-						break;
152
-						case "solid":
153
-						echo "";
154
-						break;
155
-						case "norepeat":
156
-						echo "background-repeat: no-repeat !important;";
157
-						break;
158
-						case "repeatxy":
159
-						echo "background-repeat: repeat;";
160
-						break;
161
-						case "repeaty":
162
-						echo "background-repeat: repeat-y;";
163
-						break;
164
-						case "repeatx":
165
-						echo "background-repeat: repeat-x;";
166
-						break;
167
-					}
168
-				?>
148
+                    switch($_user['2012_bgoption']) {
149
+                        case "stretch":
150
+                        echo "background-size: cover;";
151
+                        break;
152
+                        case "solid":
153
+                        echo "";
154
+                        break;
155
+                        case "norepeat":
156
+                        echo "background-repeat: no-repeat !important;";
157
+                        break;
158
+                        case "repeatxy":
159
+                        echo "background-repeat: repeat;";
160
+                        break;
161
+                        case "repeaty":
162
+                        echo "background-repeat: repeat-y;";
163
+                        break;
164
+                        case "repeatx":
165
+                        echo "background-repeat: repeat-x;";
166
+                        break;
167
+                    }
168
+                ?>
169 169
 			}
170 170
    		</style>
171 171
 	</head>
@@ -346,19 +346,19 @@  discard block
 block discarded – undo
346 346
                                             <div class="channel-filtered-content">
347 347
                                                 <ol class="channel-videos-list">
348 348
 													<?php
349
-														$stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
350
-														$stmt->bindParam(":username", $_user['username']);
351
-														$stmt->execute();
352
-														if($stmt->rowCount() == 0) { echo '<span style="font-size:11px;color:grey;">This user has no videos uploaded.</span>'; }
349
+                                                        $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
350
+                                                        $stmt->bindParam(":username", $_user['username']);
351
+                                                        $stmt->execute();
352
+                                                        if($stmt->rowCount() == 0) { echo '<span style="font-size:11px;color:grey;">This user has no videos uploaded.</span>'; }
353 353
 
354
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
355
-															$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
356
-															$video['duration'] = $__time_h->timestamp($video['duration']);
357
-															$video['views'] = $__video_h->fetch_video_views($video['rid']);
358
-															$video['author'] = htmlspecialchars($video['author']);		
359
-															$video['title'] = htmlspecialchars($video['title']);
360
-															$video['description'] = $__video_h->shorten_description($video['description'], 50);
361
-													?>
354
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
355
+                                                            $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
356
+                                                            $video['duration'] = $__time_h->timestamp($video['duration']);
357
+                                                            $video['views'] = $__video_h->fetch_video_views($video['rid']);
358
+                                                            $video['author'] = htmlspecialchars($video['author']);		
359
+                                                            $video['title'] = htmlspecialchars($video['title']);
360
+                                                            $video['description'] = $__video_h->shorten_description($video['description'], 50);
361
+                                                    ?>
362 362
                                                     <li class="yt-c3-grid-item">
363 363
                                                         <a href="/watch?v=<?php echo htmlspecialchars($video['rid']); ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="feature=plcp&amp;context=C4e80d7cVDvjVQa1PpcFPHxNkhfeSQg8_nJHnhVurQf82C2OenNiw%3D"><span class="video-thumb ux-thumb yt-thumb-default-234 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" width="234"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
364 364
                                                         <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="yBlvNSfqAj0" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(isset($_SESSION['siteusername']))
15
+	if (isset($_SESSION['siteusername']))
16 16
 	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
17 17
 
18
-    if(!$__user_h->user_exists($_GET['n']))
18
+    if (!$__user_h->user_exists($_GET['n']))
19 19
         header("Location: /?userdoesntexist");
20 20
 
21 21
     $_user = $__user_h->fetch_user_username($_GET['n']);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	$stmt->bindParam(":username", $_user['username']);
25 25
 	$stmt->execute();
26 26
 
27
-	while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
27
+	while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28 28
 		header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines.");
29 29
 	}
30 30
 
@@ -76,28 +76,28 @@  discard block
 block discarded – undo
76 76
     $_user['genre'] = strtolower($_user['genre']);
77 77
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
78 78
 
79
-    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
80
-    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
81
-    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
82
-    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
83
-    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
84
-    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
79
+    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
80
+    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
81
+    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
82
+    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
83
+    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
84
+    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
85 85
 
86
-	if(isset($_SESSION['siteusername']))
86
+	if (isset($_SESSION['siteusername']))
87 87
     	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
88 88
 
89
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
89
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
90 90
         $error = array();
91 91
 
92
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
93
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
94
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
92
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
93
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
94
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
95 95
         //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; }
96 96
         //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; }
97
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
97
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
98 98
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
99 99
 
100
-        if(!isset($error['message'])) {
100
+        if (!isset($error['message'])) {
101 101
 			$text = $_POST['comment'];
102 102
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
103 103
 			$stmt->bindParam(":id", $_user['username']);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
109 109
 
110
-            if(@$_SESSION['siteusername'] != $_user['username']) { 
110
+            if (@$_SESSION['siteusername'] != $_user['username']) { 
111 111
                 $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']);
112 112
             }
113 113
         }
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
 		<link rel="stylesheet" href="/yt/cssbin/www-extra.css">
142 142
 		<style>
143 143
 			#content-container {
144
-				background-color: <?php echo $_user['primary_color'];  ?>;
144
+				background-color: <?php echo $_user['primary_color']; ?>;
145 145
 				background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>);
146 146
 				background-repeat: repeat;
147 147
 				<?php
148
-					switch($_user['2012_bgoption']) {
148
+					switch ($_user['2012_bgoption']) {
149 149
 						case "stretch":
150 150
 						echo "background-size: cover;";
151 151
 						break;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 			<div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div>
179 179
 			<div id="content-container">
180 180
 				<!-- begin content -->
181
-				<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
181
+				<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
182 182
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
183 183
 				<?php } ?> 
184 184
 				<div id="content">
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 												<h1><?php echo htmlspecialchars($_user['username']); ?></h1>
234 234
 											</div>
235 235
 											<div class="upper-left-section enable-fancy-subscribe-button">
236
-											<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
236
+											<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
237 237
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
238 238
 														<button 
239 239
 															href="#" 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 															title="" 
242 242
 															id="subscribe-button"
243 243
 															type="button" 
244
-															class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
244
+															class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
245 245
 															role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" 
246 246
 															src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
247 247
 														<span class="subscribed-label">Subscribed</span>
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 												<?php } else { ?>
258 258
 
259 259
 												<?php } ?>
260
-												<?php if($__user_h->if_partner($_user['username'])) { ?>
260
+												<?php if ($__user_h->if_partner($_user['username'])) { ?>
261 261
 													<img style="width: 29px;vertical-align: middle;margin-left: 10px;" title="This user is a SubRocks partner" src="/yt/imgbin/RenderedImage.png">
262 262
 												<?php } ?>
263 263
 											</div>
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 									</div>
316 316
 								</div>
317 317
 							</div>
318
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
318
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
319 319
 							<div id="branded-page-body">
320 320
                                 <div class="channel-tab-content channel-layout-full-width">
321 321
                                     <div class="tab-content-body">
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 														$stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
350 350
 														$stmt->bindParam(":username", $_user['username']);
351 351
 														$stmt->execute();
352
-														if($stmt->rowCount() == 0) { echo '<span style="font-size:11px;color:grey;">This user has no videos uploaded.</span>'; }
352
+														if ($stmt->rowCount() == 0) { echo '<span style="font-size:11px;color:grey;">This user has no videos uploaded.</span>'; }
353 353
 
354
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
354
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
355 355
 															$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
356 356
 															$video['duration'] = $__time_h->timestamp($video['duration']);
357 357
 															$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/playlists.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@  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
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
13
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
14 14
         $error = array();
15 15
 
16
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "You are not logged in"; $error['status'] = true; }
17
-        if(!$_POST['comment']){ $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
18
-        if(empty(trim($_POST['title']))){ $error['message'] = "Your title cannot be blank"; $error['status'] = true; }
19
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
20
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; }
16
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "You are not logged in"; $error['status'] = true; }
17
+        if (!$_POST['comment']) { $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
18
+        if (empty(trim($_POST['title']))) { $error['message'] = "Your title cannot be blank"; $error['status'] = true; }
19
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
20
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; }
21 21
 
22
-        if(!isset($error['message'])) {
22
+        if (!isset($error['message'])) {
23 23
             $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_';
24 24
             $result = '';
25 25
             for ($i = 0; $i < 11; $i++)
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
                                 <?php
200 200
 
201 201
                                     $number_of_result = $stmt->rowCount();
202
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
202
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
203 203
 
204
-                                    if (!isset ($_GET['page']) ) {  
204
+                                    if (!isset ($_GET['page'])) {  
205 205
                                         $page = 1;  
206 206
                                     } else {  
207
-                                        $page = (int)$_GET['page'];  
207
+                                        $page = (int) $_GET['page'];  
208 208
                                     }  
209 209
 
210
-                                    $page_first_result = ($page - 1) * $results_per_page;  
210
+                                    $page_first_result = ($page - 1)*$results_per_page;  
211 211
                                 ?>
212 212
                                 <?php 
213 213
                                     $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper");
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
                                     </tr>
249 249
                                     
250 250
                                     <?php
251
-                                        while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
251
+                                        while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
252 252
                                             $playlist['videos'] = json_decode($playlist['videos']);
253
-                                            if($__video_h->video_exists(@$playlist['videos'][0])) {
254
-                                                if(count($playlist['videos']) != 0) {
253
+                                            if ($__video_h->video_exists(@$playlist['videos'][0])) {
254
+                                                if (count($playlist['videos']) != 0) {
255 255
                                                     $video = $__video_h->fetch_video_rid($playlist['videos'][0]);
256 256
                                                     $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
257 257
                                                     $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                                     </div>
334 334
                                 </center>
335 335
                                         
336
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
336
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
337 337
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button>
338 338
                                 <?php } ?>   
339 339
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                                 </script>
380 380
 
381 381
                                 <?php 
382
-                                    if($stmt6->rowCount() == 0) { echo "
382
+                                    if ($stmt6->rowCount() == 0) { echo "
383 383
                                         <br>Welcome to your playlists! You can make collections of videos for you to share with others.<br>
384 384
                                     "; 
385 385
                                 } ?>
Please login to merge, or discard this patch.
web/public/s/mod/channel_featured.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template">
3 3
 									<div class="tab-content-body">
4 4
 										<div class="primary-pane">
5
-                                            <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?>
5
+                                            <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?>
6 6
 											<div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge">
7 7
 												<div class="module-view featured-video-view-module">
8 8
 												<div id="watch-video" >
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 														}
72 72
 													</style>
73 73
 													<div class="playlist-info">
74
-	  													<?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>
74
+	  													<?php if (@$_SESSION['siteusername'] == $_user['username']) { ?>
75 75
 															<div class="box-gray" style="display:none;height: 130px;" id="custom_labels" style="margin-bottom: 8px;">
76 76
 																<h2>Edit custom labels</h2>
77 77
 																<input type="text" id="custom_title" style="margin-bottom:3px;width: 96.6%;" placeholder="Uploaded Videos Custom Text" value="<?php echo htmlspecialchars($_user['uploaded_videos_title']); ?>" class="yt-uix-form-input-text" name="custom_uploaded_videos_title"><br>
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 														<span class="blogger-video-count">1-10 of <?php echo $stmt->rowCount(); ?></span>
85 85
 														<p id="custom_label_description_change" class="playlist-description"><?php echo htmlspecialchars($_user['uploaded_videos_description']); ?></p>
86 86
 														<div class="yt-horizontal-rule "><span class="first"></span><span class="second"></span><span class="third"></span></div>
87
-														<?php if($_user['videos'] == 0) { ?>
87
+														<?php if ($_user['videos'] == 0) { ?>
88 88
 															<span style="font-size:11px;color:grey;">This user has not uploaded a video yet.</span>
89 89
 														<?php } ?>
90 90
 														<script>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 													</div>
126 126
 													<ul class="gh-single-playlist">
127 127
                                                         <?php 
128
-                                                            while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
128
+                                                            while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
129 129
                                                         ?>
130 130
 														<li class="blogger-video">
131 131
 															<div class="video yt-tile-visible">
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 <?php $__user_u = new user_update($__db); ?>
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
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'])
18
+	if ($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19 19
 		header("Location: /");
20 20
 
21 21
 	$__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
@@ -66,20 +66,20 @@  discard block
 block discarded – undo
66 66
          if (window.yt.timing) {yt.timing.tick("ct");}    
67 67
       </script>
68 68
 		<?php
69
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
69
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
70 70
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
71 71
 
72
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
73
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
72
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
73
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
74 74
 
75 75
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
76 76
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
77 77
 
78
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
78
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79 79
 				$_video['likeswidth'] = 0;
80 80
 				$_video['dislikeswidth'] = 0;
81 81
 			} else {
82
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
82
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
83 83
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
84 84
 			}
85 85
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 									</div>
114 114
 									<div id="instream_google_companion_ad_div"></div>
115 115
 								</div>
116
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
116
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
117 117
 									<div id="watch-owner-container">
118 118
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
119 119
 											<ul class="yt-nav-aside">
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 										</div>
133 133
 									</div><br>
134 134
 								<?php } ?>
135
-								<?php if($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?>
135
+								<?php if ($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?>
136 136
 									<div id="watch-owner-container">
137 137
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
138 138
 											<ul class="yt-nav-aside">
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 										$stmt->execute();
162 162
 										$alts = $stmt->rowCount();
163 163
 
164
-										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
164
+										if ($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
165 165
 
166
-										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
166
+										while ($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
+											if ($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168 168
 												echo "
169 169
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
170 170
 													htmlspecialchars($username['username']) 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 											title="" 
190 190
 											id="subscribe-button"
191 191
 											type="button" 
192
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
192
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
193 193
 											role="button">
194 194
 											<span class="yt-uix-button-icon-wrapper">
195 195
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 						<div id="watch-main-container">
248 248
 							<div id="watch-main">
249 249
 								<div id="watch-panel">
250
-									<?php if($_video['featured'] == "v") { ?>
250
+									<?php if ($_video['featured'] == "v") { ?>
251 251
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn">  <div class="yt-alert-icon">
252 252
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
253 253
 										</div>
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 										</div></div></div>
259 259
 									<?php }  ?>
260 260
 
261
-	  								<?php if($_video['visibility'] == "u") { ?>
261
+	  								<?php if ($_video['visibility'] == "u") { ?>
262 262
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn">  <div class="yt-alert-icon">
263 263
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
264 264
 										</div>
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 												This video is unlisted. Only people who have the link can view this video.
268 268
 											</div>
269 269
 										</div></div></div>
270
-									<?php } else if($_video['visibility'] == "v") { ?>
270
+									<?php } else if ($_video['visibility'] == "v") { ?>
271 271
 										<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
272 272
 											<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
273 273
 										</div>
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 											<button onclick=";window.location.href=this.getAttribute('href');return false;" href="/get/like_video?v=<?php echo $_video['rid']; ?>"
302 302
 											title="I like this" 
303 303
 											type="button" 
304
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
304
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
305 305
 											id="watch-like"  
306 306
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
307 307
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 											type="button" 
316 316
 											style="margin-left: -2px;"
317 317
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
318
-											class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
318
+											class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
319 319
 											id="watch-unlike" 
320 320
 											role="button">
321 321
 												<span class="yt-uix-button-icon-wrapper">
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 												</div>
336 336
 											</div>
337 337
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
338
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
338
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
339 339
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
340 340
 													<div class="yt-alert-icon">
341 341
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 												<?php } else { ?>
352 352
 													<h3>Be friends with the creator</h3>
353 353
 
354
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
354
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
355 355
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
356 356
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
357 357
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 														</span><br><br>
366 366
 													<?php } ?>
367 367
 
368
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
369
-														<?php if($_video['friended'] == false) { ?>
368
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
369
+														<?php if ($_video['friended'] == false) { ?>
370 370
 															<a href="/friends">Send a friend request</a>
371 371
 														<?php } else { ?>
372 372
 															Your friend request is pending.
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 													<?php } ?>
377 377
 													<hr><br>
378 378
 													<h3>Add to Favorites</h3>
379
-													<?php if($_video['favorited'] == false) { ?>
379
+													<?php if ($_video['favorited'] == false) { ?>
380 380
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
381 381
 													<?php } else { ?>
382 382
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -387,10 +387,10 @@  discard block
 block discarded – undo
387 387
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
388 388
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
389 389
 														$stmt->execute();
390
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
390
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391 391
 															$buffer = json_decode($playlist['videos']);
392 392
 															@$rid = $buffer[0];
393
-															if(!empty($rid)) {
393
+															if (!empty($rid)) {
394 394
 																@$video = $__video_h->fetch_video_rid($rid);
395 395
 															} else {
396 396
 																$video['thumbnail'] = "";
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 												$stmt->execute();
669 669
 											?>
670 670
 
671
-											<?php if($stmt->rowCount() != 0) { ?>
671
+											<?php if ($stmt->rowCount() != 0) { ?>
672 672
 												<div class="comments-section">
673 673
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
674 674
 													see all
@@ -676,8 +676,8 @@  discard block
 block discarded – undo
676 676
 													<h4>Video Responses</h4>
677 677
 													<ul class="video-list">
678 678
 													<?php 
679
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
-															if($__video_h->video_exists($video['video'])) { 
679
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
+															if ($__video_h->video_exists($video['video'])) { 
681 681
 																$video = $__video_h->fetch_video_rid($video['video']);
682 682
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
683 683
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -708,18 +708,18 @@  discard block
 block discarded – undo
708 708
 														</h4>
709 709
 													</div>
710 710
 												</div>
711
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
711
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
712 712
 													<div class="comments-post-container clearfix">
713 713
 														<div class="comments-post-alert">
714 714
 															<a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span>
715 715
 														</div>
716 716
 													</div>
717
-												<?php } else if($_video['commenting'] == "d") { ?>
717
+												<?php } else if ($_video['commenting'] == "d") { ?>
718 718
 													<div class="comments-disabled-message">
719 719
 														<img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png">
720 720
 														<span>Adding comments has been disabled for this video.</span>
721 721
 													</div>
722
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
722
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
723 723
 													<div class="comments-post-container clearfix">
724 724
 														<div class="comments-post-alert">
725 725
 															This user has blocked you!
@@ -773,15 +773,15 @@  discard block
 block discarded – undo
773 773
 														$stmt->execute();
774 774
 
775 775
 														$number_of_result = $stmt->rowCount();
776
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
776
+														$number_of_page = ceil($number_of_result/$results_per_page);  
777 777
 
778
-														if (!isset ($_GET['page']) ) {  
778
+														if (!isset ($_GET['page'])) {  
779 779
 															$page = 1;  
780 780
 														} else {  
781
-															$page = (int)$_GET['page'];  
781
+															$page = (int) $_GET['page'];  
782 782
 														}  
783 783
 
784
-														$page_first_result = ($page - 1) * $results_per_page;  
784
+														$page_first_result = ($page - 1)*$results_per_page;  
785 785
 
786 786
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
787 787
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -789,10 +789,10 @@  discard block
 block discarded – undo
789 789
 														$stmt->bindParam(":pper", $results_per_page);
790 790
 														$stmt->execute();
791 791
 
792
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
792
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
+															if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794 794
 																$comment['liked'] = true;
795
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
795
+															else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796 796
 																$comment['disliked'] = true;
797 797
 																
798 798
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
@@ -814,10 +814,10 @@  discard block
 block discarded – undo
814 814
 																			<span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span>
815 815
 																			</span>
816 816
 																			</span></span>
817
-																			<?php if($comment['likes'] != 0) { ?>
818
-																				<?php if($comment['likes'] < 0) { ?>
817
+																			<?php if ($comment['likes'] != 0) { ?>
818
+																				<?php if ($comment['likes'] < 0) { ?>
819 819
 																				<span dir="ltr" class="comments-rating-positive" title="9 up, 1 down" style="color:#c16a6a;">
820
-																					<?php echo abs($comment['likes']);; ?>
820
+																					<?php echo abs($comment['likes']); ; ?>
821 821
 																					<img src="/yt/imgbin/dislike.png">
822 822
 																				</span>
823 823
 																				<?php } else { ?>
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
 																			</button>
850 850
 																		</span>
851 851
 																	</div>
852
-																<?php if(isset($_SESSION['siteusername'])) { ?> 
852
+																<?php if (isset($_SESSION['siteusername'])) { ?> 
853 853
 																	<li id="reply_to_<?php echo $comment['id']; ?>" style="display: none;" class="comment yt-tile-default  child" data-tag="O" data-author-viewing="" data-id="iRV7EkT9us81mDLFDSB6FAsB156Fdn13HUmTm26C3PE" data-score="34" data-author="<?php echo htmlspecialchars($row['author']); ?>">
854 854
 
855 855
 																	<div class="comment-body">
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 															$stmt2->bindParam(":rid", $comment['id']);
875 875
 															$stmt2->execute();
876 876
 
877
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
877
+															while ($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
878 878
 														?>
879 879
 															<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">
880 880
 																<div class="comment-body">
@@ -957,11 +957,11 @@  discard block
 block discarded – undo
957 957
 												<?php
958 958
 													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
959 959
 													$stmt->execute();
960
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
960
+													while ($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
961 961
 														$_playlist['videos'] = json_decode($_playlist['videos']);
962 962
 														$_playlist['count'] = 1;
963 963
 
964
-														if($__video_h->video_exists($_playlist['videos'][0])) {
964
+														if ($__video_h->video_exists($_playlist['videos'][0])) {
965 965
 															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
966 966
 														} else {
967 967
 															$video = [];
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 												<?php
1017 1017
 													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1018 1018
 													$stmt->execute();
1019
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1019
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1020 1020
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1021 1021
 														$video['duration'] = $__time_h->timestamp($video['duration']);
1022 1022
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/favorite_videos.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 <?php $__time_h = new time_helper(); error_reporting(E_ERROR | E_PARSE); ?>
10 10
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11 11
 <?php
12
-	$__server->page_embeds->page_title = "SubRocks - Favorite Videos";
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 - Favorite Videos";
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
 <!DOCTYPE html>
18 18
 <html dir="ltr">
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 							<div id="browse-main-column" style="float: right;margin: 0px 0 0 14px;" class="ytg-4col">
158 158
 								<div class="browse-collection  has-box-ad">
159 159
 								<?php 
160
-									$stmt = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :username ORDER BY id DESC");
161
-									$stmt->bindParam(":username", $_SESSION['siteusername']);
162
-									$stmt->execute();									
163
-								?>
160
+                                    $stmt = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :username ORDER BY id DESC");
161
+                                    $stmt->bindParam(":username", $_SESSION['siteusername']);
162
+                                    $stmt->execute();									
163
+                                ?>
164 164
 								<h1 style="display:inline-block;">Favorite Videos</h1><br>
165 165
 								<span style="font-size:11px;color:grey;">You currently have <b><?php echo $stmt->rowCount(); ?></b> favorite videos</span><br>
166 166
 								<hr><br>
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                                 ?>
183 183
                                 <?php 
184 184
                                     $stmt6 = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :search ORDER BY id DESC LIMIT :pfirst, :pper");
185
-									$stmt6->bindParam(":search", $search);
185
+                                    $stmt6->bindParam(":search", $search);
186 186
                                     $stmt6->bindParam(":pfirst", $page_first_result);
187 187
                                     $stmt6->bindParam(":pper", $results_per_page);
188 188
                                     $stmt6->execute();
@@ -199,32 +199,32 @@  discard block
 block discarded – undo
199 199
                                     
200 200
                                     <?php
201 201
                                         while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
202
-											if($__video_h->video_exists($video['reciever'])) {
203
-												$_video = $__video_h->fetch_video_rid($video['reciever']);
204
-												$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
205
-												$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
206
-												$_video['duration'] = $__time_h->timestamp($_video['duration']);
207
-												$_video['views'] = $__video_h->fetch_video_views($_video['rid']);
208
-												$_video['author'] = htmlspecialchars($_video['author']);		
209
-												$_video['title'] = htmlspecialchars($_video['title']);
210
-												$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
211
-
212
-												if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") {
213
-													$status = "Corrupted";
214
-												} else if($_video['visibility'] == "v") {
215
-													$status = "Approved";
216
-												} else if($_video['visibility'] == "n") {
217
-													$status = "Approved";
218
-												} else if($_video['visibility'] == "o") {
219
-													$status = "Disapproved";
220
-												} else {
221
-													$status = "Unknown";
222
-												}                      
202
+                                            if($__video_h->video_exists($video['reciever'])) {
203
+                                                $_video = $__video_h->fetch_video_rid($video['reciever']);
204
+                                                $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
205
+                                                $_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
206
+                                                $_video['duration'] = $__time_h->timestamp($_video['duration']);
207
+                                                $_video['views'] = $__video_h->fetch_video_views($_video['rid']);
208
+                                                $_video['author'] = htmlspecialchars($_video['author']);		
209
+                                                $_video['title'] = htmlspecialchars($_video['title']);
210
+                                                $_video['description'] = $__video_h->shorten_description($_video['description'], 50);
211
+
212
+                                                if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") {
213
+                                                    $status = "Corrupted";
214
+                                                } else if($_video['visibility'] == "v") {
215
+                                                    $status = "Approved";
216
+                                                } else if($_video['visibility'] == "n") {
217
+                                                    $status = "Approved";
218
+                                                } else if($_video['visibility'] == "o") {
219
+                                                    $status = "Disapproved";
220
+                                                } else {
221
+                                                    $status = "Unknown";
222
+                                                }                      
223 223
 												
224
-												if($_video['commenting'] == "a") 
225
-													$_video['commentstatus'] = "Commenting allowed";
226
-												else 
227
-													$_video['commentstatus'] = "Commenting disallowed";
224
+                                                if($_video['commenting'] == "a") 
225
+                                                    $_video['commentstatus'] = "Commenting allowed";
226
+                                                else 
227
+                                                    $_video['commentstatus'] = "Commenting disallowed";
228 228
                                     ?> 
229 229
                                     <tr style="margin-top: 5px;" id="videoslist">
230 230
                                         <td class="video-manager-left">
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 <?php $__user_h = new user_helper($__db); ?>
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); error_reporting(E_ERROR | E_PARSE); ?>
10
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
10
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11 11
 <?php
12 12
 	$__server->page_embeds->page_title = "SubRocks - Favorite Videos";
13 13
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -170,15 +170,15 @@  discard block
 block discarded – undo
170 170
                                     $results_per_page = 12;
171 171
 
172 172
                                     $number_of_result = $stmt->rowCount();
173
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
173
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
174 174
 
175
-                                    if (!isset ($_GET['page']) ) {  
175
+                                    if (!isset ($_GET['page'])) {  
176 176
                                         $page = 1;  
177 177
                                     } else {  
178
-                                        $page = (int)$_GET['page'];  
178
+                                        $page = (int) $_GET['page'];  
179 179
                                     }  
180 180
 
181
-                                    $page_first_result = ($page - 1) * $results_per_page;  
181
+                                    $page_first_result = ($page - 1)*$results_per_page;  
182 182
                                 ?>
183 183
                                 <?php 
184 184
                                     $stmt6 = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :search ORDER BY id DESC LIMIT :pfirst, :pper");
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
                                     </tr>
199 199
                                     
200 200
                                     <?php
201
-                                        while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
202
-											if($__video_h->video_exists($video['reciever'])) {
201
+                                        while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
202
+											if ($__video_h->video_exists($video['reciever'])) {
203 203
 												$_video = $__video_h->fetch_video_rid($video['reciever']);
204 204
 												$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
205 205
 												$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
@@ -209,19 +209,19 @@  discard block
 block discarded – undo
209 209
 												$_video['title'] = htmlspecialchars($_video['title']);
210 210
 												$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
211 211
 
212
-												if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") {
212
+												if ($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") {
213 213
 													$status = "Corrupted";
214
-												} else if($_video['visibility'] == "v") {
214
+												} else if ($_video['visibility'] == "v") {
215 215
 													$status = "Approved";
216
-												} else if($_video['visibility'] == "n") {
216
+												} else if ($_video['visibility'] == "n") {
217 217
 													$status = "Approved";
218
-												} else if($_video['visibility'] == "o") {
218
+												} else if ($_video['visibility'] == "o") {
219 219
 													$status = "Disapproved";
220 220
 												} else {
221 221
 													$status = "Unknown";
222 222
 												}                      
223 223
 												
224
-												if($_video['commenting'] == "a") 
224
+												if ($_video['commenting'] == "a") 
225 225
 													$_video['commentstatus'] = "Commenting allowed";
226 226
 												else 
227 227
 													$_video['commentstatus'] = "Commenting disallowed";
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                                     </div>
268 268
                                 </center>
269 269
 
270
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
270
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
271 271
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button>
272 272
                                 <?php } ?>   
273 273
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                                 </script>
314 314
 
315 315
                                 <?php 
316
-                                    if($stmt6->rowCount() == 0) { echo "
316
+                                    if ($stmt6->rowCount() == 0) { echo "
317 317
                                         <br>Welcome to your favorite videos page.<br>
318 318
 										You can add videos that you like and the video will be added here!
319 319
                                     "; 
Please login to merge, or discard this patch.