Passed
Push — main ( fcdcda...b78c1f )
by chief
02:32
created
s/mod/header.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 	<a id="logo-container" href="/" title="YouTube home">
6 6
 	<img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="YouTube home">
7 7
 	</a>
8
-	<?php if(!isset($_SESSION['siteusername'])) { ?>
8
+	<?php if (!isset($_SESSION['siteusername'])) { ?>
9 9
 	<div id="yt-masthead-signin">
10 10
 		<a style="color: white; text-decoration: none;" href="/sign_in">
11 11
 		<button type="button" class=" yt-uix-button yt-uix-button-primary yt-uix-button-size-default" href="/sign_up" role="button">
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 		<span id="yt-masthead-user-displayname" dir="ltr" class="yt-valign-container" onclick="yt.www.masthead.toggleExpandedMasthead();">
21 21
 		<?php echo htmlspecialchars($_SESSION['siteusername']); ?>
22 22
 		</span>
23
-		<?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
23
+		<?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
24 24
 		<a style="position:relative;top:1px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
25 25
 		<?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?> 
26 26
 		</a>
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 </div>
58 58
 </div>
59 59
 </div>
60
-<?php if(isset($_SESSION['siteusername'])) { ?>
60
+<?php if (isset($_SESSION['siteusername'])) { ?>
61 61
 <div id="masthead-expanded" class="hid" style="display: none;">
62 62
 	<div id="masthead-expanded-container" class="with-sandbar">
63 63
 		<div id="masthead-expanded-menus-container">
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 <?php } ?>
180 180
 </div>
181 181
 <div id="alerts">
182
-	<?php if(isset($error['status'])) { ?>
182
+	<?php if (isset($error['status'])) { ?>
183 183
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error  yt-alert-player">  <div class="yt-alert-icon">
184 184
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
185 185
 		</div>
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 			</div>
190 190
 		</div></div></div>
191 191
 	<?php } ?>
192
-	<?php if(isset($error_legacy)) { ?>
192
+	<?php if (isset($error_legacy)) { ?>
193 193
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error  yt-alert-player">  <div class="yt-alert-icon">
194 194
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
195 195
 		</div>
Please login to merge, or discard this patch.
s/mod/channel_customization.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                         <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>-->
185 185
                     </div><br><br>
186 186
                     <img src="/d/pfp/<?php echo $_user['pfp']; ?>" style="width:100px;height:100px;"><br>
187
-                    <?php if($_user['pfp'] != "default.png") { ?>
187
+                    <?php if ($_user['pfp'] != "default.png") { ?>
188 188
                         <a href="/get/remove_profile_pic">Remove Profile Picture</a><br>
189 189
                     <?php } ?>
190 190
                     <br><hr class="thin-line-darker" style="width:unset;">
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                         <input style="width: 169px;position: relative;top: 10px;" type="file" name="videopagebanner" id="avatar-upload">
194 194
                         <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>-->
195 195
                     </div><br>                   
196
-                    <?php if(!empty($_user['subbutton'])) { ?>
196
+                    <?php if (!empty($_user['subbutton'])) { ?>
197 197
                         <a href="/get/remove_watch_banner">Remove Watch Page Banner</a><br>
198 198
                     <?php } ?><br><hr class="thin-line-darker" style="width:unset;">
199 199
 
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
 
214 214
                     <b>Featured Vid</b>
215 215
                     <div class="customization-module" id="featuredvid" action="/d/post/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
216
-                    <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']);?>" name="videoid">
216
+                    <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']); ?>" name="videoid">
217 217
                     </div><br><br><hr class="thin-line-darker" style="width:unset;">
218 218
 
219 219
                     <b>Website</b>
220 220
                     <div class="customization-module" id="featuredvid" action="/d/post/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -7px;">
221
-                    <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']);?>" name="website">
221
+                    <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']); ?>" name="website">
222 222
                         
223 223
                     </div><br><br><hr class="thin-line-darker" style="width:unset;">
224 224
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                     <span style="font-size: 11px;" class="grey-text">This will show what type of channel you are to other users.</span>
228 228
                     <div class="customization-module" id="channellayout" action="/d/post/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -19px;">
229 229
                         <select style="background: transparent url(/yt/imgbin/spritesheet_main.png) repeat-x scroll 0 -800px;border: 1px solid #333;position:relative;top:6px;"  name="genre">
230
-                            <?php foreach($categories as $category) { ?>
230
+                            <?php foreach ($categories as $category) { ?>
231 231
                                 <option value="<?php echo $category; ?>"><?php echo $category; ?></option>
232 232
                             <?php } ?>
233 233
                         </select>
Please login to merge, or discard this patch.
autos.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4");
142 142
 											$stmt->execute();
143 143
 											$result = $stmt->get_result();
144
-											while($video = $result->fetch_assoc()) {	
144
+											while ($video = $result->fetch_assoc()) {	
145 145
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
146 146
 												$video['duration'] = $__time_h->timestamp($video['duration']);
147 147
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4");
178 178
 											$stmt->execute();
179 179
 											$result = $stmt->get_result();
180
-											while($video = $result->fetch_assoc()) {	
180
+											while ($video = $result->fetch_assoc()) {	
181 181
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
182 182
 												$video['duration'] = $__time_h->timestamp($video['duration']);
183 183
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4");
214 214
 											$stmt->execute();
215 215
 											$result = $stmt->get_result();
216
-											while($video = $result->fetch_assoc()) {	
216
+											while ($video = $result->fetch_assoc()) {	
217 217
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
218 218
 												$video['duration'] = $__time_h->timestamp($video['duration']);
219 219
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4");
250 250
 											$stmt->execute();
251 251
 											$result = $stmt->get_result();
252
-											while($video = $result->fetch_assoc()) {	
252
+											while ($video = $result->fetch_assoc()) {	
253 253
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
254 254
 												$video['duration'] = $__time_h->timestamp($video['duration']);
255 255
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4");
286 286
 											$stmt->execute();
287 287
 											$result = $stmt->get_result();
288
-											while($video = $result->fetch_assoc()) {	
288
+											while ($video = $result->fetch_assoc()) {	
289 289
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
290 290
 												$video['duration'] = $__time_h->timestamp($video['duration']);
291 291
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
guide_ajax.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 <?php $__time_h = new time_helper(); ?>
12 12
 <?php header('Content-Type: application/json'); ?>
13 13
 <?php
14
-    if(!isset($_GET['action_load_user_feed'])) {
15
-        switch(@$_GET['chart_name']) {
14
+    if (!isset($_GET['action_load_user_feed'])) {
15
+        switch (@$_GET['chart_name']) {
16 16
         case "trending":
17 17
             $category = 'Trending';
18 18
             $diviconn = 'trending';
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             break;
48 48
         }
49 49
         
50
-        switch(@$_GET['feed_name']) {
50
+        switch (@$_GET['feed_name']) {
51 51
         case "trending":
52 52
             $category = 'Trending';
53 53
             $diviconn = 'trending';
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 <div class=\'feed-page\'>
110 110
 	<ul>
111 111
         <?php
112
-            while($video = $result->fetch_assoc()) {	
112
+            while ($video = $result->fetch_assoc()) {	
113 113
                 $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
114 114
                 $video['duration'] = $__time_h->timestamp($video['duration']);
115 115
                 $video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
upload_video.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <?php $__user_h = new user_helper($__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
 <!DOCTYPE html>
13 13
 <html>
14 14
 	<head>
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                                 <b>Category</b> <br>
91 91
                                 <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default">
92 92
                                     <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?>
93
-                                    <?php foreach($categories as $categoryTag) { ?>
93
+                                    <?php foreach ($categories as $categoryTag) { ?>
94 94
                                         <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option>
95 95
                                     <?php } ?>
96 96
                                 </select><br><br>
Please login to merge, or discard this patch.
my_videos.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 <?php $__user_h = new user_helper($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <!DOCTYPE html>
15 15
 <html dir="ltr">
16 16
 	<head>
@@ -170,15 +170,15 @@  discard block
 block discarded – undo
170 170
                                     $results = $result->num_rows;
171 171
 
172 172
                                     $number_of_result = $result->num_rows;
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
                                     $stmt->close();
184 184
                                 ?>
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                                     </tr>
205 205
                                     
206 206
                                     <?php
207
-                                        while($video = $result6->fetch_assoc()) { 
207
+                                        while ($video = $result6->fetch_assoc()) { 
208 208
                                             $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
209 209
                                             $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
210 210
                                             $video['duration'] = $__time_h->timestamp($video['duration']);
@@ -213,19 +213,19 @@  discard block
 block discarded – undo
213 213
                                             $video['title'] = htmlspecialchars($video['title']);
214 214
                                             $video['description'] = $__video_h->shorten_description($video['description'], 50);
215 215
 
216
-                                            if($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") {
216
+                                            if ($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") {
217 217
                                                 $status = "Corrupted";
218
-                                            } else if($video['visibility'] == "v") {
218
+                                            } else if ($video['visibility'] == "v") {
219 219
                                                 $status = "Approved";
220
-                                            } else if($video['visibility'] == "n") {
220
+                                            } else if ($video['visibility'] == "n") {
221 221
                                                 $status = "Approved";
222
-                                            } else if($video['visibility'] == "o") {
222
+                                            } else if ($video['visibility'] == "o") {
223 223
                                                 $status = "Disapproved";
224 224
                                             } else {
225 225
                                                 $status = "Unknown";
226 226
                                             }                      
227 227
                                             
228
-                                            if($video['commenting'] == "a") 
228
+                                            if ($video['commenting'] == "a") 
229 229
                                                 $video['commentstatus'] = "Commenting allowed";
230 230
                                             else 
231 231
                                                 $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($result6->num_rows == 0) { echo "
335
+                                    if ($result6->num_rows == 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.
s/classes/video_helper.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,19 +12,19 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function sh_exec(string $cmd, string $outputfile = "", string $pidfile = "", bool $mergestderror = true, bool $bg = false) {
14 14
         $fullcmd = $cmd;
15
-        if(strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile;
16
-        if($mergestderror) $fullcmd .= " 2>&1";
15
+        if (strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile;
16
+        if ($mergestderror) $fullcmd .= " 2>&1";
17 17
         
18
-        if($bg) {
18
+        if ($bg) {
19 19
             $fullcmd = "nohup " . $fullcmd . " &";
20
-            if(strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile;
20
+            if (strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile;
21 21
         } else {
22
-            if(strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile;
22
+            if (strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile;
23 23
         }
24 24
         shell_exec($fullcmd);
25 25
     }
26 26
 
27
-	public function __construct($conn){
27
+	public function __construct($conn) {
28 28
         $this->__db = $conn;
29 29
 	}
30 30
 
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 
50 50
     function shorten_description(string $description, int $limit, bool $newlines = false) {
51 51
         $description = trim($description);
52
-        if(strlen($description) >= $limit) {
52
+        if (strlen($description) >= $limit) {
53 53
             $description = substr($description, 0, $limit) . "...";
54 54
         } 
55 55
 
56 56
         $description = htmlspecialchars($description);
57
-        if($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); }
57
+        if ($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); }
58 58
         return $description;
59 59
     }
60 60
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $result = $stmt->get_result();
77 77
         $video = $result->fetch_assoc();
78 78
 
79
-        if($result->num_rows === 0) 
79
+        if ($result->num_rows === 0) 
80 80
             return 0;
81 81
         else
82 82
             return $video;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             $stmt->execute();
102 102
         $result = $stmt->get_result();
103 103
         $user = $result->fetch_assoc();
104
-        if($result->num_rows === 1) { return true; } else { return false; }
104
+        if ($result->num_rows === 1) { return true; } else { return false; }
105 105
         $stmt->close();
106 106
         
107 107
         return $user;
Please login to merge, or discard this patch.
playlists.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
 <?php $__user_u = new user_update($__db); ?>
13 13
 <?php $__db_h = new db_helper(); ?>
14 14
 <?php $__time_h = new time_helper(); ?>
15
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
15
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
16 16
 <?php
17
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
18
-        if(!isset($_SESSION['siteusername'])){ $error_legacy = "you are not logged in"; goto skipcomment; }
19
-        if(!$_POST['comment']){ $error_legacy = "your description cannot be blank"; goto skipcomment; }
20
-        if(strlen($_POST['comment']) > 1024){ $error_legacy = "your comment must be shorter than 1000 characters"; goto skipcomment; }
21
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error_legacy = "You are on a cooldown! Wait for a minute before posting another comment."; goto skipcomment; }
17
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
18
+        if (!isset($_SESSION['siteusername'])) { $error_legacy = "you are not logged in"; goto skipcomment; }
19
+        if (!$_POST['comment']) { $error_legacy = "your description cannot be blank"; goto skipcomment; }
20
+        if (strlen($_POST['comment']) > 1024) { $error_legacy = "your comment must be shorter than 1000 characters"; goto skipcomment; }
21
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error_legacy = "You are on a cooldown! Wait for a minute before posting another comment."; goto skipcomment; }
22 22
 
23 23
         $stmt = $__db->prepare("INSERT INTO `playlists` (title, description, rid, author) VALUES (?, ?, ?, ?)");
24 24
         $stmt->bind_param("ssss", $_POST['title'], $_POST['comment'], $rid, $_SESSION['siteusername']);
@@ -194,15 +194,15 @@  discard block
 block discarded – undo
194 194
                                     $results = $result->num_rows;
195 195
 
196 196
                                     $number_of_result = $result->num_rows;
197
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
197
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
198 198
 
199
-                                    if (!isset ($_GET['page']) ) {  
199
+                                    if (!isset ($_GET['page'])) {  
200 200
                                         $page = 1;  
201 201
                                     } else {  
202
-                                        $page = (int)$_GET['page'];  
202
+                                        $page = (int) $_GET['page'];  
203 203
                                     }  
204 204
 
205
-                                    $page_first_result = ($page - 1) * $results_per_page;  
205
+                                    $page_first_result = ($page - 1)*$results_per_page;  
206 206
 
207 207
                                     $stmt->close();
208 208
                                 ?>
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
                                     </tr>
249 249
                                     
250 250
                                     <?php
251
-                                        while($playlist = $result->fetch_assoc()) { 
251
+                                        while ($playlist = $result->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']);		
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                                     </div>
303 303
                                 </center>
304 304
 
305
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
305
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
306 306
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button>
307 307
                                 <?php } ?>   
308 308
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                                 </script>
349 349
 
350 350
                                 <?php 
351
-                                    if($result6->num_rows == 0) { echo "
351
+                                    if ($result6->num_rows == 0) { echo "
352 352
                                         <br>Welcome to your playlists! You can make collections of videos for you to share with others.<br>
353 353
                                     "; 
354 354
                                 } ?>
Please login to merge, or discard this patch.
favorite_videos.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 <?php $__user_h = new user_helper($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); error_reporting(E_ERROR | E_PARSE); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <!DOCTYPE html>
15 15
 <html dir="ltr">
16 16
 	<head>
@@ -170,15 +170,15 @@  discard block
 block discarded – undo
170 170
                                     $results = $result->num_rows;
171 171
 
172 172
                                     $number_of_result = $result->num_rows;
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
                                     $stmt->close();
184 184
                                 ?>
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
                                     </tr>
200 200
                                     
201 201
                                     <?php
202
-                                        while($video = $result6->fetch_assoc()) { 
203
-											if($__video_h->video_exists($video['reciever'])) {
202
+                                        while ($video = $result6->fetch_assoc()) { 
203
+											if ($__video_h->video_exists($video['reciever'])) {
204 204
 												$_video = $__video_h->fetch_video_rid($video['reciever']);
205 205
 												$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
206 206
 												$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
@@ -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";
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                                     </div>
269 269
                                 </center>
270 270
 
271
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
271
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
272 272
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button>
273 273
                                 <?php } ?>   
274 274
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                                 </script>
315 315
 
316 316
                                 <?php 
317
-                                    if($result6->num_rows == 0) { echo "
317
+                                    if ($result6->num_rows == 0) { echo "
318 318
                                         <br>Welcome to your Video Manager! You can manage your uploaded videos here.<br>
319 319
                                         <a href=\"upload_video\">
320 320
                                             <button type=\"button\" class=\" yt-uix-button yt-uix-button-default\" role=\"button\">
Please login to merge, or discard this patch.