@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | if(!isset($_COOKIE["JodelId"])) |
13 | 13 | { |
14 | 14 | $accessToken = createAccount(); |
15 | - setcookie("JodelId", $accessToken, time()+60*60*24*365*10); |
|
15 | + setcookie("JodelId", $accessToken, time() + 60 * 60 * 24 * 365 * 10); |
|
16 | 16 | } |
17 | 17 | else |
18 | 18 | { |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | |
24 | 24 | isTokenFreshByAccessToken($location, $accessToken); |
25 | 25 | |
26 | - $result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'"); |
|
26 | + $result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'"); |
|
27 | 27 | |
28 | 28 | $newPositionStatus; |
29 | 29 | |
30 | - if ($result->num_rows > 0) |
|
30 | + if($result->num_rows > 0) |
|
31 | 31 | { |
32 | 32 | // output data of each row |
33 | 33 | while($row = $result->fetch_assoc()) |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | //Set View |
49 | 49 | if(isset($_GET['view'])) |
50 | 50 | { |
51 | - switch ($_GET['view']) { |
|
51 | + switch($_GET['view']) { |
|
52 | 52 | case 'comment': |
53 | 53 | $view = 'comment'; |
54 | 54 | break; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | if(isset($_POST['color'])) |
141 | 141 | { |
142 | 142 | $color = $_POST['color']; |
143 | - switch ($color) { |
|
143 | + switch($color) { |
|
144 | 144 | case '8ABDB0': |
145 | 145 | $color = '8ABDB0'; |
146 | 146 | break; |
@@ -310,13 +310,13 @@ discard block |
||
310 | 310 | else |
311 | 311 | { |
312 | 312 | $version = 'v2'; |
313 | - if($view=='comment') |
|
313 | + if($view == 'comment') |
|
314 | 314 | { |
315 | 315 | $url = "/v2/posts/location/discussed/"; |
316 | 316 | } |
317 | 317 | else |
318 | 318 | { |
319 | - if($view=='upVote') |
|
319 | + if($view == 'upVote') |
|
320 | 320 | { |
321 | 321 | $url = "/v2/posts/location/popular/"; |
322 | 322 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | } |
341 | 341 | |
342 | 342 | |
343 | - for($i = 0; $i<$loops; $i++) |
|
343 | + for($i = 0; $i < $loops; $i++) |
|
344 | 344 | { |
345 | 345 | |
346 | 346 | if(isset($posts[$i])) |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?> |
386 | 386 | <h2>Comment on Jodel</h2> |
387 | 387 | <form method="POST"> |
388 | - <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']);?>" /> |
|
388 | + <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']); ?>" /> |
|
389 | 389 | <textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> |
390 | 390 | <br /> |
391 | 391 | <input type="submit" value="SEND" /> |
@@ -422,13 +422,13 @@ discard block |
||
422 | 422 | <div class="col-sm-12"> |
423 | 423 | <div class="row"> |
424 | 424 | <div class="col-sm-3"> |
425 | - <a href="index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
425 | + <a href="index.php" <?php if($view == 'time') echo 'class="active"'; ?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
426 | 426 | </div> |
427 | 427 | <div class="col-sm-3"> |
428 | - <a href="index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
428 | + <a href="index.php?view=comment" <?php if($view == 'comment') echo 'class="active"'; ?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
429 | 429 | </div> |
430 | 430 | <div class="col-sm-3"> |
431 | - <a href="index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
431 | + <a href="index.php?view=upVote" <?php if($view == 'upVote') echo 'class="active"'; ?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
432 | 432 | </div> |
433 | 433 | <div class="col-sm-3"> |
434 | 434 | <nav> |
@@ -21,7 +21,7 @@ |
||
21 | 21 | $i = 0; |
22 | 22 | $result = $db->query("SELECT access_token FROM accounts"); |
23 | 23 | |
24 | - if ($result->num_rows > 0) |
|
24 | + if($result->num_rows > 0) |
|
25 | 25 | { |
26 | 26 | // output data of each row |
27 | 27 | while(($row = $result->fetch_assoc()) && $i < $_POST['quantity']) |
@@ -32,10 +32,12 @@ |
||
32 | 32 | |
33 | 33 | isTokenFreshByAccessToken($location, $accessToken); |
34 | 34 | |
35 | - if($_POST['vote'] == "up") { |
|
35 | + if($_POST['vote'] == "up") |
|
36 | + { |
|
36 | 37 | $accountCreator = new Upvote(); |
37 | 38 | } |
38 | - else if($_POST['vote'] == "down") { |
|
39 | + else if($_POST['vote'] == "down") |
|
40 | + { |
|
39 | 41 | $accountCreator = new Downvote(); |
40 | 42 | } |
41 | 43 |