Completed
Push — master ( 9d2f24...fd7e65 )
by mains
12:03
created
index.php 1 patch
Braces   +46 added lines, -13 removed lines patch added patch discarded remove patch
@@ -61,7 +61,8 @@  discard block
 block discarded – undo
61 61
 	//Set View
62 62
 	if(isset($_GET['view']))
63 63
 	{
64
-		switch ($_GET['view']) {
64
+		switch ($_GET['view'])
65
+		{
65 66
 			case 'comment':
66 67
 				$view = 'comment';
67 68
 				break;
@@ -81,7 +82,8 @@  discard block
 block discarded – undo
81 82
 	}
82 83
 	
83 84
 	//Set Location
84
-	if(isset($_GET['city'])) {
85
+	if(isset($_GET['city']))
86
+	{
85 87
 		$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w';
86 88
 		$result = Requests::post($url);
87 89
 		if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
@@ -165,7 +167,8 @@  discard block
 block discarded – undo
165 167
 		if(isset($_POST['color']))
166 168
 		{
167 169
 			$color = $_POST['color'];
168
-			switch ($color) {
170
+			switch ($color)
171
+			{
169 172
 				case '8ABDB0':
170 173
 					$color = '8ABDB0';
171 174
 					break;
@@ -292,7 +295,11 @@  discard block
 block discarded – undo
292 295
 
293 296
 					<div id="location_mobile" class="hidden-sm-up">
294 297
 						<form method="get">
295
-							<input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
298
+							<input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus))
299
+{
300
+	echo $newPositionStatus;
301
+}
302
+?>" required>
296 303
 
297 304
 							<input type="submit" id="submit_mobile" class="fa" value="&#xf0ac;" />
298 305
 						</form>
@@ -319,7 +326,8 @@  discard block
 block discarded – undo
319 326
 								$data = $accountCreator->execute();
320 327
 								
321 328
 								$posts[0] = $data;
322
-								if(array_key_exists('children', $data)) {
329
+								if(array_key_exists('children', $data))
330
+								{
323 331
 									foreach($data['children'] as $key => $child)
324 332
 									{
325 333
 										
@@ -393,7 +401,9 @@  discard block
 block discarded – undo
393 401
 
394 402
 					</content>
395 403
 					
396
-					<?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?>
404
+					<?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails']))
405
+{
406
+?>
397 407
 						<p id="loading">
398 408
 							Loading…
399 409
 						</p>
@@ -406,7 +416,11 @@  discard block
 block discarded – undo
406 416
 							<div>
407 417
 								<h2>Position</h2>
408 418
 								<form method="get">
409
-									<input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
419
+									<input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus))
420
+{
421
+	echo $newPositionStatus;
422
+}
423
+?>" required>
410 424
 
411 425
 									<input type="submit" value="Set Location" /> 
412 426
 								</form>
@@ -422,7 +436,9 @@  discard block
 block discarded – undo
422 436
 
423 437
 						<article>
424 438
 							<div>
425
-								<?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?>
439
+								<?php if(isset($_GET['postID']) && isset($_GET['getPostDetails']))
440
+{
441
+?>
426 442
 								<h2>Comment on Jodel</h2>
427 443
 								<form method="POST">				
428 444
 										<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']);?>" />
@@ -430,7 +446,10 @@  discard block
 block discarded – undo
430 446
 									<br />
431 447
 									<input type="submit" value="SEND" /> 
432 448
 								</form>
433
-									<?php } else { ?>
449
+									<?php }
450
+else
451
+{
452
+?>
434 453
 								<h2>New Jodel</h2>
435 454
 								<form method="POST">
436 455
 									<textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> 
@@ -462,13 +481,25 @@  discard block
 block discarded – undo
462 481
 				<div class="col-xs-12">
463 482
 					<div class="row">
464 483
 						<div class="col-xs-3">
465
-							<a href="index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a>
484
+							<a href="index.php" <?php if($view=='time')
485
+{
486
+	echo 'class="active"';
487
+}
488
+?>><i class="fa fa-clock-o fa-3x"></i></a>
466 489
 						</div>
467 490
 						<div class="col-xs-3">
468
-							<a href="index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a>
491
+							<a href="index.php?view=comment" <?php if($view=='comment')
492
+{
493
+	echo 'class="active"';
494
+}
495
+?>><i class="fa fa-commenting-o fa-3x"></i></a>
469 496
 						</div>
470 497
 						<div class="col-xs-3">
471
-							<a href="index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a>
498
+							<a href="index.php?view=upVote" <?php if($view=='upVote')
499
+{
500
+	echo 'class="active"';
501
+}
502
+?>><i class="fa fa-angle-up fa-3x"></i></a>
472 503
 						</div>
473 504
 						<div class="col-xs-3">
474 505
 							<nav>
@@ -511,7 +542,9 @@  discard block
 block discarded – undo
511 542
 				    $('html,body').animate({scrollTop: aTag.offset().top-90},'slow');
512 543
 				}
513 544
 
514
-				<?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?>
545
+				<?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails']))
546
+{
547
+?>
515 548
 
516 549
 				
517 550
 
Please login to merge, or discard this patch.