Passed
Push — main ( 17bea0...d9df25 )
by chief
02:43
created
travel.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 										<?php
141 141
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Travel & Events' ORDER BY rand() LIMIT 4");
142 142
 											$stmt->execute();
143
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
143
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
144 144
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
145 145
 												$video['duration'] = $__time_h->timestamp($video['duration']);
146 146
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 										<?php
176 176
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Travel & Events' ORDER BY rand() LIMIT 4");
177 177
 											$stmt->execute();
178
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
178
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
179 179
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
180 180
 												$video['duration'] = $__time_h->timestamp($video['duration']);
181 181
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 										<?php
211 211
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Travel & Events' ORDER BY rand() LIMIT 4");
212 212
 											$stmt->execute();
213
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
213
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
214 214
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
215 215
 												$video['duration'] = $__time_h->timestamp($video['duration']);
216 216
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 										<?php
246 246
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Travel & Events' ORDER BY rand() LIMIT 4");
247 247
 											$stmt->execute();
248
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
248
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
249 249
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
250 250
 												$video['duration'] = $__time_h->timestamp($video['duration']);
251 251
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 										<?php
281 281
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Travel & Events' ORDER BY rand() LIMIT 4");
282 282
 											$stmt->execute();
283
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
283
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
284 284
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
285 285
 												$video['duration'] = $__time_h->timestamp($video['duration']);
286 286
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
watch.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -15,15 +15,15 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
18
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
19 19
         $error = array();
20 20
 
21
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
22
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
23
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
24
-        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; }
21
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
22
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
23
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
24
+        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; }
25 25
 
26
-        if(!isset($error['message'])) {
26
+        if (!isset($error['message'])) {
27 27
 			$text = $_POST['comment'];
28 28
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
29 29
             $stmt->bindParam(":v", $_GET['v']);
@@ -58,17 +58,17 @@  discard block
 block discarded – undo
58 58
 			if (window.yt.timing) {yt.timing.tick("ct");}    
59 59
 		</script>
60 60
 		<?php
61
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
61
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
62 62
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
63 63
 
64
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
65
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
64
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
65
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
66 66
 
67
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
67
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
68 68
 				$_video['likeswidth'] = 50;
69 69
 				$_video['dislikeswidth'] = 50;
70 70
 			} else {
71
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
71
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
72 72
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
73 73
 			}
74 74
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 												$stmt->execute();
302 302
 											?>
303 303
 
304
-											<?php if($stmt->rowCount() != 0) { ?>
304
+											<?php if ($stmt->rowCount() != 0) { ?>
305 305
 												<div class="comments-section">
306 306
 													<a class="comments-section-see-all" href="/video_response_view_all?v=rLHU-_OhT8g">
307 307
 													see all
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 													<h4>Video Responses</h4>
310 310
 													<ul class="video-list">
311 311
 													<?php 
312
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
313
-															if($__video_h->video_exists($video['video'])) { 
312
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
313
+															if ($__video_h->video_exists($video['video'])) { 
314 314
 																$video = $__video_h->fetch_video_rid($video['video']);
315 315
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
316 316
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -341,19 +341,19 @@  discard block
 block discarded – undo
341 341
 														</h4>
342 342
 													</div>
343 343
 												</div>
344
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
344
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
345 345
 													<div class="comments-post-container clearfix">
346 346
 														<div class="comments-post-alert">
347 347
 															<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>
348 348
 														</div>
349 349
 													</div>
350
-												<?php } else if($_video['commenting'] == "d") { ?>
350
+												<?php } else if ($_video['commenting'] == "d") { ?>
351 351
 													<div class="comments-post-container clearfix">
352 352
 														<div class="comments-post-alert">
353 353
 															This video has comemnting disabled!
354 354
 														</div>
355 355
 													</div>
356
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
356
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
357 357
 													<div class="comments-post-container clearfix">
358 358
 														<div class="comments-post-alert">
359 359
 															This user has blocked you!
@@ -407,15 +407,15 @@  discard block
 block discarded – undo
407 407
 														$stmt->execute();
408 408
 
409 409
 														$number_of_result = $stmt->rowCount();
410
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
410
+														$number_of_page = ceil($number_of_result/$results_per_page);  
411 411
 
412
-														if (!isset ($_GET['page']) ) {  
412
+														if (!isset ($_GET['page'])) {  
413 413
 															$page = 1;  
414 414
 														} else {  
415
-															$page = (int)$_GET['page'];  
415
+															$page = (int) $_GET['page'];  
416 416
 														}  
417 417
 
418
-														$page_first_result = ($page - 1) * $results_per_page;  
418
+														$page_first_result = ($page - 1)*$results_per_page;  
419 419
 
420 420
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
421 421
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 														$stmt->bindParam(":pper", $results_per_page);
424 424
 														$stmt->execute();
425 425
 
426
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC))) { 
426
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC))) { 
427 427
 													?>
428 428
 
429 429
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 												<?php
504 504
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
505 505
 													$stmt->execute();
506
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
506
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
507 507
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
508 508
 														$video['duration'] = $__time_h->timestamp($video['duration']);
509 509
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 				<div id="content">
38 38
 					<div class="guide-layout-container enable-fancy-subscribe-button">
39 39
 						<div class="guide-container">
40
-						<?php if(!isset($_SESSION['siteusername'])) { ?>
40
+						<?php if (!isset($_SESSION['siteusername'])) { ?>
41 41
 									<div id="guide-builder-promo">
42 42
 								<h2>
43 43
 							Sign in to add channels to your homepage
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 							</div>
57 57
 							<div class="guide">
58 58
 							<?php 
59
-								if(isset($_SESSION['siteusername'])) {
59
+								if (isset($_SESSION['siteusername'])) {
60 60
 								?>
61 61
 								<div style="/*! margin-top: 0px; *//*! margin-left: 10px; *//*! margin-bottom: 13px; */height: 99px;" class="guide-section feed-header channel first"><img alt="" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_SESSION['siteusername']); ?>" style="height: 88px;position: relative;top: 4px;left: 4px;" class="feed-header-thumb channel-thumb" width="88px"><div id="links" style="/*! margin-left: 5px; */position: relative;left: 13px;top: 7px;"><div style="font-size: 11px;margin-bottom: 6px;" class="metadata">
62 62
 							<a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 											</span>
175 175
 											</a>
176 176
 										</li>
177
-										<?php foreach($__server->featured_channels as $channel) { ?>
177
+										<?php foreach ($__server->featured_channels as $channel) { ?>
178 178
 											<li class="guide-item-container ">
179 179
 												<a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user">
180 180
 												<span class="thumb">  <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span>
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 								<?php
213 213
 									$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 4");
214 214
 									$stmt->execute();
215
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
215
+									while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
216 216
 										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
217 217
 										$video['duration'] = $__time_h->timestamp($video['duration']);
218 218
 										$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 								<?php
236 236
 									$stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' ORDER BY id DESC LIMIT 4");
237 237
 									$stmt->execute();
238
-									while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
238
+									while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
239 239
 										$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
240 240
 										$video['duration'] = $__time_h->timestamp($video['duration']);
241 241
 										$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 											<?php
269 269
 												$stmt = $__db->prepare("SELECT * FROM videos ORDER BY id DESC LIMIT 20");
270 270
 												$stmt->execute();
271
-												while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
271
+												while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
272 272
 													$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
273 273
 													$video['duration'] = $__time_h->timestamp($video['duration']);
274 274
 													$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
people.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 										<?php
141 141
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'People & Blogs' ORDER BY rand() LIMIT 4");
142 142
 											$stmt->execute();
143
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
143
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
144 144
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
145 145
 												$video['duration'] = $__time_h->timestamp($video['duration']);
146 146
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 										<?php
176 176
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'People & Blogs' ORDER BY rand() LIMIT 4");
177 177
 											$stmt->execute();
178
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
178
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
179 179
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
180 180
 												$video['duration'] = $__time_h->timestamp($video['duration']);
181 181
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 										<?php
211 211
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'People & Blogs' ORDER BY rand() LIMIT 4");
212 212
 											$stmt->execute();
213
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
213
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
214 214
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
215 215
 												$video['duration'] = $__time_h->timestamp($video['duration']);
216 216
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 										<?php
246 246
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'People & Blogs' ORDER BY rand() LIMIT 4");
247 247
 											$stmt->execute();
248
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
248
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
249 249
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
250 250
 												$video['duration'] = $__time_h->timestamp($video['duration']);
251 251
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 										<?php
281 281
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'People & Blogs' ORDER BY rand() LIMIT 4");
282 282
 											$stmt->execute();
283
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
283
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
284 284
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
285 285
 												$video['duration'] = $__time_h->timestamp($video['duration']);
286 286
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
comedy.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 										<?php
141 141
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Comedy' ORDER BY rand() LIMIT 4");
142 142
 											$stmt->execute();
143
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
143
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
144 144
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
145 145
 												$video['duration'] = $__time_h->timestamp($video['duration']);
146 146
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 										<?php
176 176
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Comedy' ORDER BY rand() LIMIT 4");
177 177
 											$stmt->execute();
178
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
178
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
179 179
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
180 180
 												$video['duration'] = $__time_h->timestamp($video['duration']);
181 181
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 										<?php
211 211
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Comedy' ORDER BY rand() LIMIT 4");
212 212
 											$stmt->execute();
213
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
213
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
214 214
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
215 215
 												$video['duration'] = $__time_h->timestamp($video['duration']);
216 216
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 										<?php
246 246
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Comedy' ORDER BY rand() LIMIT 4");
247 247
 											$stmt->execute();
248
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
248
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
249 249
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
250 250
 												$video['duration'] = $__time_h->timestamp($video['duration']);
251 251
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 										<?php
281 281
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Comedy' ORDER BY rand() LIMIT 4");
282 282
 											$stmt->execute();
283
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
283
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
284 284
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
285 285
 												$video['duration'] = $__time_h->timestamp($video['duration']);
286 286
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
playlists_ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 <?php
12 12
     $search = $_SESSION['siteusername'];
13 13
 
14
-    if($_GET['filter'] == "time") {
14
+    if ($_GET['filter'] == "time") {
15 15
         $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC");
16 16
         $stmt->bindParam(":username", $_SESSION['siteusername']);
17 17
         $stmt->execute();
18 18
         $result = $stmt->get_result();
19 19
         $results = $result->num_rows;
20
-    } else if($_GET['filter'] == "title") {
20
+    } else if ($_GET['filter'] == "title") {
21 21
         $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY title DESC");
22 22
         $stmt->bindParam(":username", $_SESSION['siteusername']);
23 23
         $stmt->execute();
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
         <th style="width: 80%;">
31 31
             <small class="video-filter-options">
32 32
                 Sort by:  
33
-                <a id="selector-title" onclick="changeFilter_Title();" <?php if($_GET['filter'] == "title") { ?>class="selected"<?php } ?>>Title</a> | 
34
-                    <a id="selector-time" onclick="changeFilter_Time();" <?php if($_GET['filter'] == "time") { ?>class="selected"<?php } ?>>Time</a>
33
+                <a id="selector-title" onclick="changeFilter_Title();" <?php if ($_GET['filter'] == "title") { ?>class="selected"<?php } ?>>Title</a> | 
34
+                    <a id="selector-time" onclick="changeFilter_Time();" <?php if ($_GET['filter'] == "time") { ?>class="selected"<?php } ?>>Time</a>
35 35
             </small>
36 36
         </th>
37 37
         <th style="margin: 5px; width: 20%;"></th>
38 38
     </tr>
39 39
     
40 40
     <?php
41
-        while($playlist = $result->fetch_assoc()) { 
41
+        while ($playlist = $result->fetch_assoc()) { 
42 42
             $playlist['videos'] = json_decode($playlist['videos']);
43
-            if($__video_h->video_exists(@$playlist['videos'][0])) {
44
-                if(count($playlist['videos']) != 0) {
43
+            if ($__video_h->video_exists(@$playlist['videos'][0])) {
44
+                if (count($playlist['videos']) != 0) {
45 45
                     $video = $__video_h->fetch_video_rid($playlist['videos'][0]);
46 46
                     $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
47 47
                     $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
Please login to merge, or discard this patch.
video_manager_ajax.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 <?php
12 12
     $search = $_SESSION['siteusername'];
13 13
 
14
-    if($_GET['filter'] == "time") {
14
+    if ($_GET['filter'] == "time") {
15 15
         $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
16 16
         $stmt->bindParam(":username", $_SESSION['siteusername']);
17 17
         $stmt->execute();
18
-    } else if($_GET['filter'] == "title") {
18
+    } else if ($_GET['filter'] == "title") {
19 19
         $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY title DESC");
20 20
         $stmt->bindParam(":username", $_SESSION['siteusername']);
21 21
         $stmt->execute();
@@ -23,23 +23,23 @@  discard block
 block discarded – undo
23 23
 
24 24
     $results_per_page = 12;
25 25
     $number_of_result = $stmt->rowCount();
26
-    $number_of_page = ceil ($number_of_result / $results_per_page);  
26
+    $number_of_page = ceil($number_of_result/$results_per_page);  
27 27
 
28
-    if (!isset ($_GET['page']) ) {  
28
+    if (!isset ($_GET['page'])) {  
29 29
         $page = 1;  
30 30
     } else {  
31
-        $page = (int)$_GET['page'];  
31
+        $page = (int) $_GET['page'];  
32 32
     }  
33 33
 
34
-    $page_first_result = ($page - 1) * $results_per_page;  
34
+    $page_first_result = ($page - 1)*$results_per_page;  
35 35
 
36
-    if($_GET['filter'] == "time") {
36
+    if ($_GET['filter'] == "time") {
37 37
         $stmt6 = $__db->prepare("SELECT * FROM videos WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper");
38 38
         $stmt6->bindParam(":search", $search);
39 39
         $stmt6->bindParam(":pfirst", $page_first_result);
40 40
         $stmt6->bindParam(":pper", $results_per_page);
41 41
         $stmt6->execute();
42
-    } else if($_GET['filter'] == "title") {
42
+    } else if ($_GET['filter'] == "title") {
43 43
         $stmt6 = $__db->prepare("SELECT * FROM videos WHERE author = :search ORDER BY title LIMIT :pfirst, :pper");
44 44
         $stmt6->bindParam(":search", $search);
45 45
         $stmt6->bindParam(":pfirst", $page_first_result);
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
         <th style="width: 80%;">
53 53
             <small class="video-filter-options">
54 54
                 Sort by:  
55
-                <a id="selector-title" onclick="changeFilter_Title();" <?php if($_GET['filter'] == "title") { ?>class="selected"<?php } ?>>Title</a> | 
56
-                    <a id="selector-time" onclick="changeFilter_Time();" <?php if($_GET['filter'] == "time") { ?>class="selected"<?php } ?>>Time</a>
55
+                <a id="selector-title" onclick="changeFilter_Title();" <?php if ($_GET['filter'] == "title") { ?>class="selected"<?php } ?>>Title</a> | 
56
+                    <a id="selector-time" onclick="changeFilter_Time();" <?php if ($_GET['filter'] == "time") { ?>class="selected"<?php } ?>>Time</a>
57 57
             </small>
58 58
         </th>
59 59
         <th style="margin: 5px; width: 20%;"></th>
60 60
     </tr>
61 61
     
62 62
     <?php
63
-        while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
63
+        while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
64 64
             $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
65 65
             $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
66 66
             $video['duration'] = $__time_h->timestamp($video['duration']);
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
             $video['title'] = htmlspecialchars($video['title']);
70 70
             $video['description'] = $__video_h->shorten_description($video['description'], 50);
71 71
 
72
-            if($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") {
72
+            if ($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") {
73 73
                 $status = "Corrupted";
74
-            } else if($video['visibility'] == "v") {
74
+            } else if ($video['visibility'] == "v") {
75 75
                 $status = "Approved";
76
-            } else if($video['visibility'] == "n") {
76
+            } else if ($video['visibility'] == "n") {
77 77
                 $status = "Approved";
78
-            } else if($video['visibility'] == "o") {
78
+            } else if ($video['visibility'] == "o") {
79 79
                 $status = "Disapproved";
80 80
             } else {
81 81
                 $status = "Unknown";
82 82
             }                      
83 83
             
84
-            if($video['commenting'] == "a") 
84
+            if ($video['commenting'] == "a") 
85 85
                 $video['commentstatus'] = "Commenting allowed";
86 86
             else 
87 87
                 $video['commentstatus'] = "Commenting disallowed";
Please login to merge, or discard this patch.
howto.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 										<?php
141 141
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Howto & Style' ORDER BY rand() LIMIT 4");
142 142
 											$stmt->execute();
143
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
143
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
144 144
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
145 145
 												$video['duration'] = $__time_h->timestamp($video['duration']);
146 146
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 										<?php
176 176
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Howto & Style' ORDER BY rand() LIMIT 4");
177 177
 											$stmt->execute();
178
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
178
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
179 179
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
180 180
 												$video['duration'] = $__time_h->timestamp($video['duration']);
181 181
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 										<?php
211 211
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Howto & Style' ORDER BY rand() LIMIT 4");
212 212
 											$stmt->execute();
213
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
213
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
214 214
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
215 215
 												$video['duration'] = $__time_h->timestamp($video['duration']);
216 216
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 										<?php
246 246
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Howto & Style' ORDER BY rand() LIMIT 4");
247 247
 											$stmt->execute();
248
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
248
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
249 249
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
250 250
 												$video['duration'] = $__time_h->timestamp($video['duration']);
251 251
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 										<?php
281 281
 											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Howto & Style' ORDER BY rand() LIMIT 4");
282 282
 											$stmt->execute();
283
-											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
283
+											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
284 284
 												$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
285 285
 												$video['duration'] = $__time_h->timestamp($video['duration']);
286 286
 												$video['views'] = $__video_h->fetch_video_views($video['rid']);
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>
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
                                     $stmt->execute();
164 164
 
165 165
                                     $number_of_result = $stmt->rowCount();
166
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
166
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
167 167
 
168
-                                    if (!isset ($_GET['page']) ) {  
168
+                                    if (!isset ($_GET['page'])) {  
169 169
                                         $page = 1;  
170 170
                                     } else {  
171
-                                        $page = (int)$_GET['page'];  
171
+                                        $page = (int) $_GET['page'];  
172 172
                                     }  
173 173
 
174
-                                    $page_first_result = ($page - 1) * $results_per_page;  
174
+                                    $page_first_result = ($page - 1)*$results_per_page;  
175 175
                                 ?>
176 176
                                 <?php 
177 177
                                     $stmt6 = $__db->prepare("SELECT * FROM videos WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper");
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                                     </tr>
197 197
                                     
198 198
                                     <?php
199
-                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
199
+                                        while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
200 200
                                             $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
201 201
                                             $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
202 202
                                             $video['duration'] = $__time_h->timestamp($video['duration']);
@@ -205,19 +205,19 @@  discard block
 block discarded – undo
205 205
                                             $video['title'] = htmlspecialchars($video['title']);
206 206
                                             $video['description'] = $__video_h->shorten_description($video['description'], 50);
207 207
 
208
-                                            if($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") {
208
+                                            if ($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") {
209 209
                                                 $status = "Corrupted";
210
-                                            } else if($video['visibility'] == "v") {
210
+                                            } else if ($video['visibility'] == "v") {
211 211
                                                 $status = "Approved";
212
-                                            } else if($video['visibility'] == "n") {
212
+                                            } else if ($video['visibility'] == "n") {
213 213
                                                 $status = "Approved";
214
-                                            } else if($video['visibility'] == "o") {
214
+                                            } else if ($video['visibility'] == "o") {
215 215
                                                 $status = "Disapproved";
216 216
                                             } else {
217 217
                                                 $status = "Unknown";
218 218
                                             }                      
219 219
                                             
220
-                                            if($video['commenting'] == "a") 
220
+                                            if ($video['commenting'] == "a") 
221 221
                                                 $video['commentstatus'] = "Commenting allowed";
222 222
                                             else 
223 223
                                                 $video['commentstatus'] = "Commenting disallowed";
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                                     </div>
279 279
                                 </center>
280 280
 
281
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
281
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
282 282
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button>
283 283
                                 <?php } ?>   
284 284
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
                                 </script>
325 325
 
326 326
                                 <?php 
327
-                                    if($stmt6->rowCount() == 0) { echo "
327
+                                    if ($stmt6->rowCount() == 0) { echo "
328 328
                                         <br>Welcome to your Video Manager! You can manage your uploaded videos here.<br>
329 329
                                         <a href=\"upload_video\">
330 330
                                             <button type=\"button\" class=\" yt-uix-button yt-uix-button-default\" role=\"button\">
Please login to merge, or discard this patch.