Completed
Push — master ( b85380...87612b )
by mains
02:54
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')
@@ -172,7 +174,8 @@  discard block
 block discarded – undo
172 174
 		if(isset($_POST['color']))
173 175
 		{
174 176
 			$color = $_POST['color'];
175
-			switch ($color) {
177
+			switch ($color)
178
+			{
176 179
 				case '8ABDB0':
177 180
 					$color = '8ABDB0';
178 181
 					break;
@@ -235,7 +238,8 @@  discard block
 block discarded – undo
235 238
 		$data = $accountCreator->execute();
236 239
 		
237 240
 		$posts[0] = $data;
238
-		if(array_key_exists('children', $data)) {
241
+		if(array_key_exists('children', $data))
242
+		{
239 243
 			foreach($data['children'] as $key => $child)
240 244
 			{
241 245
 				
@@ -371,7 +375,11 @@  discard block
 block discarded – undo
371 375
 
372 376
 					<div id="location_mobile" class="hidden-sm-up">
373 377
 						<form method="get">
374
-							<input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
378
+							<input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus))
379
+{
380
+	echo $newPositionStatus;
381
+}
382
+?>" required>
375 383
 
376 384
 							<input type="submit" id="submit_mobile" class="fa" value="&#xf0ac;" />
377 385
 						</form>
@@ -398,7 +406,9 @@  discard block
 block discarded – undo
398 406
 
399 407
 					</content>
400 408
 					
401
-					<?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?>
409
+					<?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails']))
410
+{
411
+?>
402 412
 						<p id="loading">
403 413
 							Loading…
404 414
 						</p>
@@ -411,7 +421,11 @@  discard block
 block discarded – undo
411 421
 							<div>
412 422
 								<h2>Position</h2>
413 423
 								<form method="get">
414
-									<input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
424
+									<input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus))
425
+{
426
+	echo $newPositionStatus;
427
+}
428
+?>" required>
415 429
 
416 430
 									<input type="submit" value="Set Location" /> 
417 431
 								</form>
@@ -427,7 +441,9 @@  discard block
 block discarded – undo
427 441
 
428 442
 						<article>
429 443
 							<div>
430
-								<?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?>
444
+								<?php if(isset($_GET['postID']) && isset($_GET['getPostDetails']))
445
+{
446
+?>
431 447
 								<h2>Comment on Jodel</h2>
432 448
 								<form method="POST">				
433 449
 										<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']);?>" />
@@ -435,7 +451,10 @@  discard block
 block discarded – undo
435 451
 									<br />
436 452
 									<input type="submit" value="SEND" /> 
437 453
 								</form>
438
-									<?php } else { ?>
454
+									<?php }
455
+else
456
+{
457
+?>
439 458
 								<h2>New Jodel</h2>
440 459
 								<form method="POST">
441 460
 									<textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> 
@@ -467,13 +486,25 @@  discard block
 block discarded – undo
467 486
 				<div class="col-xs-12">
468 487
 					<div class="row">
469 488
 						<div class="col-xs-3">
470
-							<a href="index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a>
489
+							<a href="index.php" <?php if($view=='time')
490
+{
491
+	echo 'class="active"';
492
+}
493
+?>><i class="fa fa-clock-o fa-3x"></i></a>
471 494
 						</div>
472 495
 						<div class="col-xs-3">
473
-							<a href="index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a>
496
+							<a href="index.php?view=comment" <?php if($view=='comment')
497
+{
498
+	echo 'class="active"';
499
+}
500
+?>><i class="fa fa-commenting-o fa-3x"></i></a>
474 501
 						</div>
475 502
 						<div class="col-xs-3">
476
-							<a href="index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a>
503
+							<a href="index.php?view=upVote" <?php if($view=='upVote')
504
+{
505
+	echo 'class="active"';
506
+}
507
+?>><i class="fa fa-angle-up fa-3x"></i></a>
477 508
 						</div>
478 509
 						<div class="col-xs-3">
479 510
 							<nav>
@@ -516,7 +547,9 @@  discard block
 block discarded – undo
516 547
 				    $('html,body').animate({scrollTop: aTag.offset().top-90},'slow');
517 548
 				}
518 549
 
519
-				<?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?>
550
+				<?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails']))
551
+{
552
+?>
520 553
 
521 554
 				
522 555
 
Please login to merge, or discard this patch.