@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $accessToken; |
| 15 | 15 | $newPositionStatus; |
| 16 | 16 | |
| 17 | - if ($result->num_rows > 0) |
|
| 17 | + if($result->num_rows > 0) |
|
| 18 | 18 | { |
| 19 | 19 | // output data of each row |
| 20 | 20 | while($row = $result->fetch_assoc()) |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | <a href="index.php"> |
| 115 | 115 | <h1> |
| 116 | 116 | JodelBlue |
| 117 | - <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) echo '<i class="fa fa-refresh fa-1x"></i>';?> |
|
| 117 | + <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) echo '<i class="fa fa-refresh fa-1x"></i>'; ?> |
|
| 118 | 118 | </h1> |
| 119 | 119 | </a> |
| 120 | 120 | <div class="clear"></div> |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | //Set View |
| 131 | 131 | if(isset($_GET['view'])) |
| 132 | 132 | { |
| 133 | - switch ($_GET['view']) { |
|
| 133 | + switch($_GET['view']) { |
|
| 134 | 134 | case 'comment': |
| 135 | 135 | $view = 'comment'; |
| 136 | 136 | break; |
@@ -153,11 +153,11 @@ discard block |
||
| 153 | 153 | if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { |
| 154 | 154 | //Header Nav in Comment View |
| 155 | 155 | ?> |
| 156 | - <a id="comment-back" href="index.php?view=<?php echo $view;?>#postId-<?php echo htmlspecialchars($_GET['postID']);?>"> |
|
| 156 | + <a id="comment-back" href="index.php?view=<?php echo $view; ?>#postId-<?php echo htmlspecialchars($_GET['postID']); ?>"> |
|
| 157 | 157 | <i class="fa fa-angle-left fa-3x"></i> |
| 158 | 158 | </a> |
| 159 | 159 | |
| 160 | - <a id="comment-refresh" href="index.php?getPostDetails=<?php echo htmlspecialchars($_GET['getPostDetails']);?>&postID=<?php echo htmlspecialchars($_GET['postID']);?>"> |
|
| 160 | + <a id="comment-refresh" href="index.php?getPostDetails=<?php echo htmlspecialchars($_GET['getPostDetails']); ?>&postID=<?php echo htmlspecialchars($_GET['postID']); ?>"> |
|
| 161 | 161 | <i class="fa fa-refresh fa-2x"></i> |
| 162 | 162 | </a> |
| 163 | 163 | <?php |
@@ -180,13 +180,13 @@ discard block |
||
| 180 | 180 | //Get Posts |
| 181 | 181 | else |
| 182 | 182 | { |
| 183 | - if($view=='comment') |
|
| 183 | + if($view == 'comment') |
|
| 184 | 184 | { |
| 185 | 185 | $url = "/v2/posts/location/discussed/"; |
| 186 | 186 | } |
| 187 | 187 | else |
| 188 | 188 | { |
| 189 | - if($view=='upVote') |
|
| 189 | + if($view == 'upVote') |
|
| 190 | 190 | { |
| 191 | 191 | $url = "/v2/posts/location/popular/"; |
| 192 | 192 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| 205 | - for($i = 0; $i<$loops; $i++) { |
|
| 205 | + for($i = 0; $i < $loops; $i++) { |
|
| 206 | 206 | |
| 207 | 207 | if(isset($posts[$i])) { |
| 208 | 208 | $lastPostId = $posts[$i]['post_id']; |
@@ -220,24 +220,24 @@ discard block |
||
| 220 | 220 | $timediff_inHours = (string)$timediff->format('%h'); |
| 221 | 221 | $timediff_inDays = (string)$timediff->format('%d'); |
| 222 | 222 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 223 | - if($timediff_inMonth!=0) { |
|
| 223 | + if($timediff_inMonth != 0) { |
|
| 224 | 224 | $timediff = $timediff_inMonth . "m"; |
| 225 | 225 | } |
| 226 | 226 | else |
| 227 | 227 | { |
| 228 | - if($timediff_inDays!=0) |
|
| 228 | + if($timediff_inDays != 0) |
|
| 229 | 229 | { |
| 230 | 230 | $timediff = $timediff_inDays . "d"; |
| 231 | 231 | } |
| 232 | 232 | else |
| 233 | 233 | { |
| 234 | - if($timediff_inHours!=0) |
|
| 234 | + if($timediff_inHours != 0) |
|
| 235 | 235 | { |
| 236 | 236 | $timediff = $timediff_inHours . "h"; |
| 237 | 237 | } |
| 238 | 238 | else |
| 239 | 239 | { |
| 240 | - if($timediff_inMinutes!=0) |
|
| 240 | + if($timediff_inMinutes != 0) |
|
| 241 | 241 | { |
| 242 | 242 | $timediff = $timediff_inMinutes . "m"; |
| 243 | 243 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | ?> |
| 252 | 252 | |
| 253 | - <article id ="postId-<?php echo $posts[$i]["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $posts[$i]["color"];?>;"> |
|
| 253 | + <article id ="postId-<?php echo $posts[$i]["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $posts[$i]["color"]; ?>;"> |
|
| 254 | 254 | <content> |
| 255 | 255 | <?php |
| 256 | 256 | if(isset($posts[$i]["image_url"])) { |
@@ -262,12 +262,12 @@ discard block |
||
| 262 | 262 | ?> |
| 263 | 263 | </content> |
| 264 | 264 | <aside> |
| 265 | - <a href="index.php?vote=up&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 265 | + <a href="index.php?vote=up&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 266 | 266 | <i class="fa fa-angle-up fa-3x"></i> |
| 267 | 267 | </a> |
| 268 | 268 | <br /> |
| 269 | - <?php echo $posts[$i]["vote_count"];?><br /> |
|
| 270 | - <a href="index.php?vote=down&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 269 | + <?php echo $posts[$i]["vote_count"]; ?><br /> |
|
| 270 | + <a href="index.php?vote=down&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 271 | 271 | <i class="fa fa-angle-down fa-3x"></i> |
| 272 | 272 | </a> |
| 273 | 273 | </aside> |
@@ -278,13 +278,13 @@ discard block |
||
| 278 | 278 | <td class="time"> |
| 279 | 279 | <span data-tooltip="Time"> |
| 280 | 280 | <i class="fa fa-clock-o"></i> |
| 281 | - <?php echo $timediff;?> |
|
| 281 | + <?php echo $timediff; ?> |
|
| 282 | 282 | </span> |
| 283 | 283 | </td> |
| 284 | 284 | <td class="comments"> |
| 285 | 285 | <?php if($showCommentIcon) {?> |
| 286 | 286 | <span data-tooltip="Comments"> |
| 287 | - <a href="index.php?getPostDetails=true&view=<?php echo $view;?>&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 287 | + <a href="index.php?getPostDetails=true&view=<?php echo $view; ?>&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 288 | 288 | <i class="fa fa-commenting-o"></i> |
| 289 | 289 | <?php if(array_key_exists("child_count", $posts[$i])) { |
| 290 | 290 | echo $posts[$i]["child_count"]; |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | <td class="distance"> |
| 298 | 298 | <span data-tooltip="Distance"> |
| 299 | 299 | <i class="fa fa-map-marker"></i> |
| 300 | - <?php echo $posts[$i]["distance"];?> km |
|
| 300 | + <?php echo $posts[$i]["distance"]; ?> km |
|
| 301 | 301 | </span> |
| 302 | 302 | </td> |
| 303 | 303 | </tr> |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?> |
| 340 | 340 | <h2>Comment on Jodel</h2> |
| 341 | 341 | <form method="POST"> |
| 342 | - <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']);?>" /> |
|
| 342 | + <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postID']); ?>" /> |
|
| 343 | 343 | <textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> |
| 344 | 344 | <br /> |
| 345 | 345 | <input type="submit" value="SEND" /> |
@@ -364,13 +364,13 @@ discard block |
||
| 364 | 364 | <div class="col-sm-12"> |
| 365 | 365 | <div class="row"> |
| 366 | 366 | <div class="col-sm-3"> |
| 367 | - <a href="index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 367 | + <a href="index.php" <?php if($view == 'time') echo 'class="active"'; ?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 368 | 368 | </div> |
| 369 | 369 | <div class="col-sm-3"> |
| 370 | - <a href="index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 370 | + <a href="index.php?view=comment" <?php if($view == 'comment') echo 'class="active"'; ?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 371 | 371 | </div> |
| 372 | 372 | <div class="col-sm-3"> |
| 373 | - <a href="index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 373 | + <a href="index.php?view=upVote" <?php if($view == 'upVote') echo 'class="active"'; ?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 374 | 374 | </div> |
| 375 | 375 | <div class="col-sm-3"> |
| 376 | 376 | <nav> |
@@ -19,14 +19,14 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | function getPosts($lastPostId, $url) { |
| 21 | 21 | $db = new DatabaseConnect(); |
| 22 | - if ($db->connect_errno) { |
|
| 22 | + if($db->connect_errno) { |
|
| 23 | 23 | echo 'Sorry, die Verbindung zu unserem superfetten endgeilen |
| 24 | 24 | Server ist hops gegangen. Wegen '. $db -> connect_error; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | $result = $db->query("SELECT * FROM accounts WHERE id='1'"); |
| 28 | 28 | |
| 29 | - if ($result->num_rows > 0) { |
|
| 29 | + if($result->num_rows > 0) { |
|
| 30 | 30 | // output data of each row |
| 31 | 31 | while($row = $result->fetch_assoc()) { |
| 32 | 32 | $access_token = $row["access_token"]; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | if(isset($_GET['view'])) |
| 51 | 51 | { |
| 52 | - switch ($_GET['view']) { |
|
| 52 | + switch($_GET['view']) { |
|
| 53 | 53 | case 'comment': |
| 54 | 54 | $view = 'comment'; |
| 55 | 55 | break; |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | $view = 'time'; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if($view=='comment') |
|
| 71 | + if($view == 'comment') |
|
| 72 | 72 | { |
| 73 | 73 | $url = "/v2/posts/location/discussed/"; |
| 74 | 74 | } |
| 75 | 75 | else |
| 76 | 76 | { |
| 77 | - if($view=='upVote') |
|
| 77 | + if($view == 'upVote') |
|
| 78 | 78 | { |
| 79 | 79 | $url = "/v2/posts/location/popular/"; |
| 80 | 80 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | ?> |
| 95 | 95 | <div class="nextPosts"> |
| 96 | 96 | <?php |
| 97 | - for($i = 0; $i<$loops; $i++) { |
|
| 97 | + for($i = 0; $i < $loops; $i++) { |
|
| 98 | 98 | |
| 99 | 99 | if(isset($posts[$i])) { |
| 100 | 100 | $lastPostId = $posts[$i]['post_id']; |
@@ -112,24 +112,24 @@ discard block |
||
| 112 | 112 | $timediff_inHours = (string)$timediff->format('%h'); |
| 113 | 113 | $timediff_inDays = (string)$timediff->format('%d'); |
| 114 | 114 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 115 | - if($timediff_inMonth!=0) { |
|
| 115 | + if($timediff_inMonth != 0) { |
|
| 116 | 116 | $timediff = $timediff_inMonth . "m"; |
| 117 | 117 | } |
| 118 | 118 | else |
| 119 | 119 | { |
| 120 | - if($timediff_inDays!=0) |
|
| 120 | + if($timediff_inDays != 0) |
|
| 121 | 121 | { |
| 122 | 122 | $timediff = $timediff_inDays . "d"; |
| 123 | 123 | } |
| 124 | 124 | else |
| 125 | 125 | { |
| 126 | - if($timediff_inHours!=0) |
|
| 126 | + if($timediff_inHours != 0) |
|
| 127 | 127 | { |
| 128 | 128 | $timediff = $timediff_inHours . "h"; |
| 129 | 129 | } |
| 130 | 130 | else |
| 131 | 131 | { |
| 132 | - if($timediff_inMinutes!=0) |
|
| 132 | + if($timediff_inMinutes != 0) |
|
| 133 | 133 | { |
| 134 | 134 | $timediff = $timediff_inMinutes . "m"; |
| 135 | 135 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | ?> |
| 144 | 144 | |
| 145 | - <article class="jodel" style="background-color: #<?php echo $posts[$i]["color"];?>;"> |
|
| 145 | + <article class="jodel" style="background-color: #<?php echo $posts[$i]["color"]; ?>;"> |
|
| 146 | 146 | <content> |
| 147 | 147 | <?php |
| 148 | 148 | if(isset($posts[$i]["image_url"])) { |
@@ -154,12 +154,12 @@ discard block |
||
| 154 | 154 | ?> |
| 155 | 155 | </content> |
| 156 | 156 | <aside> |
| 157 | - <a href="index.php?vote=up&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 157 | + <a href="index.php?vote=up&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 158 | 158 | <i class="fa fa-angle-up fa-3x"></i> |
| 159 | 159 | </a> |
| 160 | 160 | <br /> |
| 161 | - <?php echo $posts[$i]["vote_count"];?><br /> |
|
| 162 | - <a href="index.php?vote=down&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 161 | + <?php echo $posts[$i]["vote_count"]; ?><br /> |
|
| 162 | + <a href="index.php?vote=down&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 163 | 163 | <i class="fa fa-angle-down fa-3x"></i> |
| 164 | 164 | </a> |
| 165 | 165 | </aside> |
@@ -170,13 +170,13 @@ discard block |
||
| 170 | 170 | <td class="time"> |
| 171 | 171 | <span data-tooltip="Time"> |
| 172 | 172 | <i class="fa fa-clock-o"></i> |
| 173 | - <?php echo $timediff;?> |
|
| 173 | + <?php echo $timediff; ?> |
|
| 174 | 174 | </span> |
| 175 | 175 | </td> |
| 176 | 176 | <td class="comments"> |
| 177 | 177 | <?php if($showCommentIcon) {?> |
| 178 | 178 | <span data-tooltip="Comments"> |
| 179 | - <a href="index.php?getPostDetails=true&view=<?php echo $view;?>&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 179 | + <a href="index.php?getPostDetails=true&view=<?php echo $view; ?>&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 180 | 180 | <i class="fa fa-commenting-o"></i> |
| 181 | 181 | <?php if(array_key_exists("child_count", $posts[$i])) { |
| 182 | 182 | echo $posts[$i]["child_count"]; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | <td class="distance"> |
| 190 | 190 | <span data-tooltip="Distance"> |
| 191 | 191 | <i class="fa fa-map-marker"></i> |
| 192 | - <?php echo $posts[$i]["distance"];?> km |
|
| 192 | + <?php echo $posts[$i]["distance"]; ?> km |
|
| 193 | 193 | </span> |
| 194 | 194 | </td> |
| 195 | 195 | </tr> |