@@ -57,7 +57,8 @@ discard block |
||
57 | 57 | //Set View |
58 | 58 | if(isset($_GET['view'])) |
59 | 59 | { |
60 | - switch ($_GET['view']) { |
|
60 | + switch ($_GET['view']) |
|
61 | + { |
|
61 | 62 | case 'comment': |
62 | 63 | $view = 'comment'; |
63 | 64 | break; |
@@ -77,7 +78,8 @@ discard block |
||
77 | 78 | } |
78 | 79 | |
79 | 80 | //Set Location |
80 | - if(isset($_GET['city'])) { |
|
81 | + if(isset($_GET['city'])) |
|
82 | + { |
|
81 | 83 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w'; |
82 | 84 | $result = Requests::post($url); |
83 | 85 | if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
@@ -122,11 +124,14 @@ discard block |
||
122 | 124 | } |
123 | 125 | |
124 | 126 | //Vote |
125 | - if(isset($_GET['vote']) && isset($_GET['postID'])) { |
|
126 | - if($_GET['vote'] == "up") { |
|
127 | + if(isset($_GET['vote']) && isset($_GET['postID'])) |
|
128 | + { |
|
129 | + if($_GET['vote'] == "up") |
|
130 | + { |
|
127 | 131 | $accountCreator = new Upvote(); |
128 | 132 | } |
129 | - else if($_GET['vote'] == "down") { |
|
133 | + else if($_GET['vote'] == "down") |
|
134 | + { |
|
130 | 135 | $accountCreator = new Downvote(); |
131 | 136 | } |
132 | 137 | $accountCreator->setAccessToken($accessToken_forId1); |
@@ -158,7 +163,8 @@ discard block |
||
158 | 163 | if(isset($_POST['color'])) |
159 | 164 | { |
160 | 165 | $color = $_POST['color']; |
161 | - switch ($color) { |
|
166 | + switch ($color) |
|
167 | + { |
|
162 | 168 | case '8ABDB0': |
163 | 169 | $color = '8ABDB0'; |
164 | 170 | break; |
@@ -285,7 +291,11 @@ discard block |
||
285 | 291 | |
286 | 292 | <div id="location_mobile" class="hidden-sm-up"> |
287 | 293 | <form method="get"> |
288 | - <input type="text" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
294 | + <input type="text" name="city" placeholder="<?php if(isset($newPositionStatus)) |
|
295 | +{ |
|
296 | + echo $newPositionStatus; |
|
297 | +} |
|
298 | +?>" required> |
|
289 | 299 | |
290 | 300 | <input type="submit" id="submit_mobile" value="Set Location" /> |
291 | 301 | </form> |
@@ -312,7 +322,8 @@ discard block |
||
312 | 322 | $data = $accountCreator->execute(); |
313 | 323 | |
314 | 324 | $posts[0] = $data; |
315 | - if(array_key_exists('children', $data)) { |
|
325 | + if(array_key_exists('children', $data)) |
|
326 | + { |
|
316 | 327 | foreach($data['children'] as $key => $child) |
317 | 328 | { |
318 | 329 | |
@@ -386,7 +397,9 @@ discard block |
||
386 | 397 | |
387 | 398 | </content> |
388 | 399 | |
389 | - <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?> |
|
400 | + <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) |
|
401 | +{ |
|
402 | +?> |
|
390 | 403 | <p id="loading"> |
391 | 404 | Loading… |
392 | 405 | </p> |
@@ -399,7 +412,11 @@ discard block |
||
399 | 412 | <div> |
400 | 413 | <h2>Position</h2> |
401 | 414 | <form method="get"> |
402 | - <input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
415 | + <input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) |
|
416 | +{ |
|
417 | + echo $newPositionStatus; |
|
418 | +} |
|
419 | +?>" required> |
|
403 | 420 | |
404 | 421 | <input type="submit" value="Set Location" /> |
405 | 422 | </form> |
@@ -415,7 +432,9 @@ discard block |
||
415 | 432 | |
416 | 433 | <article> |
417 | 434 | <div> |
418 | - <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?> |
|
435 | + <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) |
|
436 | +{ |
|
437 | +?> |
|
419 | 438 | <h2>Comment on Jodel</h2> |
420 | 439 | <form method="POST"> |
421 | 440 | <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']);?>" /> |
@@ -423,7 +442,10 @@ discard block |
||
423 | 442 | <br /> |
424 | 443 | <input type="submit" value="SEND" /> |
425 | 444 | </form> |
426 | - <?php } else { ?> |
|
445 | + <?php } |
|
446 | +else |
|
447 | +{ |
|
448 | +?> |
|
427 | 449 | <h2>New Jodel</h2> |
428 | 450 | <form method="POST"> |
429 | 451 | <textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> |
@@ -455,13 +477,25 @@ discard block |
||
455 | 477 | <div class="col-xs-12"> |
456 | 478 | <div class="row"> |
457 | 479 | <div class="col-xs-3"> |
458 | - <a href="index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
480 | + <a href="index.php" <?php if($view=='time') |
|
481 | +{ |
|
482 | + echo 'class="active"'; |
|
483 | +} |
|
484 | +?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
459 | 485 | </div> |
460 | 486 | <div class="col-xs-3"> |
461 | - <a href="index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
487 | + <a href="index.php?view=comment" <?php if($view=='comment') |
|
488 | +{ |
|
489 | + echo 'class="active"'; |
|
490 | +} |
|
491 | +?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
462 | 492 | </div> |
463 | 493 | <div class="col-xs-3"> |
464 | - <a href="index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
494 | + <a href="index.php?view=upVote" <?php if($view=='upVote') |
|
495 | +{ |
|
496 | + echo 'class="active"'; |
|
497 | +} |
|
498 | +?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
465 | 499 | </div> |
466 | 500 | <div class="col-xs-3"> |
467 | 501 | <nav> |
@@ -504,7 +538,9 @@ discard block |
||
504 | 538 | $('html,body').animate({scrollTop: aTag.offset().top-90},'slow'); |
505 | 539 | } |
506 | 540 | |
507 | - <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?> |
|
541 | + <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) |
|
542 | +{ |
|
543 | +?> |
|
508 | 544 | |
509 | 545 | |
510 | 546 |