@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | isTokenFreshByAccessToken($location, $db->real_escape_string($_COOKIE["JodelId"])); |
| 19 | 19 | |
| 20 | - $result = $db->query("SELECT * FROM accounts WHERE access_token='" . $db->real_escape_string($_COOKIE["JodelId"]) . "'"); |
|
| 20 | + $result = $db->query("SELECT * FROM accounts WHERE access_token='" . $db->real_escape_string($_COOKIE["JodelId"]) . "'"); |
|
| 21 | 21 | |
| 22 | 22 | $newPositionStatus; |
| 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()) |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | //Set View |
| 43 | 43 | if(isset($_GET['view'])) |
| 44 | 44 | { |
| 45 | - switch ($_GET['view']) { |
|
| 45 | + switch($_GET['view']) { |
|
| 46 | 46 | case 'comment': |
| 47 | 47 | $view = 'comment'; |
| 48 | 48 | break; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | if(isset($_POST['color'])) |
| 135 | 135 | { |
| 136 | 136 | $color = $_POST['color']; |
| 137 | - switch ($color) { |
|
| 137 | + switch($color) { |
|
| 138 | 138 | case '8ABDB0': |
| 139 | 139 | $color = '8ABDB0'; |
| 140 | 140 | break; |
@@ -297,13 +297,13 @@ discard block |
||
| 297 | 297 | else |
| 298 | 298 | { |
| 299 | 299 | $version = 'v2'; |
| 300 | - if($view=='comment') |
|
| 300 | + if($view == 'comment') |
|
| 301 | 301 | { |
| 302 | 302 | $url = "/v2/posts/location/discussed/"; |
| 303 | 303 | } |
| 304 | 304 | else |
| 305 | 305 | { |
| 306 | - if($view=='upVote') |
|
| 306 | + if($view == 'upVote') |
|
| 307 | 307 | { |
| 308 | 308 | $url = "/v2/posts/location/popular/"; |
| 309 | 309 | } |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
| 330 | - for($i = 0; $i<$loops; $i++) |
|
| 330 | + for($i = 0; $i < $loops; $i++) |
|
| 331 | 331 | { |
| 332 | 332 | |
| 333 | 333 | if(isset($posts[$i])) |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?> |
| 373 | 373 | <h2>Comment on Jodel</h2> |
| 374 | 374 | <form method="POST"> |
| 375 | - <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']);?>" /> |
|
| 375 | + <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']); ?>" /> |
|
| 376 | 376 | <textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> |
| 377 | 377 | <br /> |
| 378 | 378 | <input type="submit" value="SEND" /> |
@@ -409,13 +409,13 @@ discard block |
||
| 409 | 409 | <div class="col-sm-12"> |
| 410 | 410 | <div class="row"> |
| 411 | 411 | <div class="col-sm-3"> |
| 412 | - <a href="index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 412 | + <a href="index.php" <?php if($view == 'time') echo 'class="active"'; ?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 413 | 413 | </div> |
| 414 | 414 | <div class="col-sm-3"> |
| 415 | - <a href="index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 415 | + <a href="index.php?view=comment" <?php if($view == 'comment') echo 'class="active"'; ?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 416 | 416 | </div> |
| 417 | 417 | <div class="col-sm-3"> |
| 418 | - <a href="index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 418 | + <a href="index.php?view=upVote" <?php if($view == 'upVote') echo 'class="active"'; ?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 419 | 419 | </div> |
| 420 | 420 | <div class="col-sm-3"> |
| 421 | 421 | <nav> |
@@ -21,7 +21,7 @@ discard block |
||
| 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']) |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?> |
| 171 | 171 | <h2>Comment on Jodel</h2> |
| 172 | 172 | <form method="POST"> |
| 173 | - <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']);?>" /> |
|
| 173 | + <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']); ?>" /> |
|
| 174 | 174 | <textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> |
| 175 | 175 | <br /> |
| 176 | 176 | <input type="submit" value="SEND" /> |
@@ -30,10 +30,12 @@ discard block |
||
| 30 | 30 | var_dump($accessToken); |
| 31 | 31 | isTokenFreshByAccessToken($location, $accessToken); |
| 32 | 32 | |
| 33 | - if($_POST['vote'] == "up") { |
|
| 33 | + if($_POST['vote'] == "up") |
|
| 34 | + { |
|
| 34 | 35 | $accountCreator = new Upvote(); |
| 35 | 36 | } |
| 36 | - else if($_POST['vote'] == "down") { |
|
| 37 | + else if($_POST['vote'] == "down") |
|
| 38 | + { |
|
| 37 | 39 | $accountCreator = new Downvote(); |
| 38 | 40 | } |
| 39 | 41 | |
@@ -151,7 +153,11 @@ discard block |
||
| 151 | 153 | <div> |
| 152 | 154 | <h2>Position</h2> |
| 153 | 155 | <form method="get"> |
| 154 | - <input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
| 156 | + <input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) |
|
| 157 | +{ |
|
| 158 | + echo $newPositionStatus; |
|
| 159 | +} |
|
| 160 | +?>" required> |
|
| 155 | 161 | |
| 156 | 162 | <input type="submit" value="Set Location" /> |
| 157 | 163 | </form> |
@@ -167,7 +173,9 @@ discard block |
||
| 167 | 173 | |
| 168 | 174 | <article> |
| 169 | 175 | <div> |
| 170 | - <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?> |
|
| 176 | + <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) |
|
| 177 | +{ |
|
| 178 | +?> |
|
| 171 | 179 | <h2>Comment on Jodel</h2> |
| 172 | 180 | <form method="POST"> |
| 173 | 181 | <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']);?>" /> |
@@ -175,7 +183,10 @@ discard block |
||
| 175 | 183 | <br /> |
| 176 | 184 | <input type="submit" value="SEND" /> |
| 177 | 185 | </form> |
| 178 | - <?php } else { ?> |
|
| 186 | + <?php } |
|
| 187 | +else |
|
| 188 | +{ |
|
| 189 | +?> |
|
| 179 | 190 | <h2>New Jodel</h2> |
| 180 | 191 | <form method="POST"> |
| 181 | 192 | <textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> |
@@ -243,7 +254,9 @@ discard block |
||
| 243 | 254 | $('html,body').animate({scrollTop: aTag.offset().top-90},'slow'); |
| 244 | 255 | } |
| 245 | 256 | |
| 246 | - <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?> |
|
| 257 | + <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) |
|
| 258 | +{ |
|
| 259 | +?> |
|
| 247 | 260 | |
| 248 | 261 | |
| 249 | 262 | |