@@ -31,5 +31,5 @@ |
||
| 31 | 31 | * @see Requests_Hooks::register |
| 32 | 32 | * @param Requests_Hooks $hooks Hook system |
| 33 | 33 | */ |
| 34 | - public function register(Requests_Hooks &$hooks); |
|
| 34 | + public function register(Requests_Hooks&$hooks); |
|
| 35 | 35 | } |
| 36 | 36 | \ No newline at end of file |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | * @subpackage Proxy |
| 21 | 21 | * @since 1.6 |
| 22 | 22 | */ |
| 23 | -interface Requests_Proxy { |
|
| 23 | +interface Requests_Proxy |
|
| 24 | +{ |
|
| 24 | 25 | /** |
| 25 | 26 | * Register hooks as needed |
| 26 | 27 | * |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class Location{ |
|
| 3 | +class Location { |
|
| 4 | 4 | |
| 5 | 5 | public $cityName; |
| 6 | 6 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->lng = $lng; |
| 39 | 39 | } |
| 40 | - public function toArray(){ |
|
| 40 | + public function toArray() { |
|
| 41 | 41 | return array( |
| 42 | 42 | "city" => $this->getCityName(), |
| 43 | 43 | "country" => 'DE', |
@@ -1,6 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class Location{ |
|
| 3 | +class Location |
|
| 4 | +{ |
|
| 4 | 5 | |
| 5 | 6 | public $cityName; |
| 6 | 7 | |
@@ -37,7 +38,8 @@ discard block |
||
| 37 | 38 | { |
| 38 | 39 | $this->lng = $lng; |
| 39 | 40 | } |
| 40 | - public function toArray(){ |
|
| 41 | + public function toArray() |
|
| 42 | + { |
|
| 41 | 43 | return array( |
| 42 | 44 | "city" => $this->getCityName(), |
| 43 | 45 | "country" => 'DE', |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $accessToken; |
| 15 | 15 | $newPostionStatus; |
| 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()) |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | <a href="index.php"> |
| 114 | 114 | <h1> |
| 115 | 115 | Jodel WebClient |
| 116 | - <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) echo '<i class="fa fa-refresh fa-1x"></i>';?> |
|
| 116 | + <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) echo '<i class="fa fa-refresh fa-1x"></i>'; ?> |
|
| 117 | 117 | </h1> |
| 118 | 118 | </a> |
| 119 | 119 | <div class="clear"></div> |
@@ -131,11 +131,11 @@ discard block |
||
| 131 | 131 | if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { |
| 132 | 132 | //Header Nav in Comment View |
| 133 | 133 | ?> |
| 134 | - <a id="comment-back" href="index.php#postId-<?php echo $_GET['postID'];?>"> |
|
| 134 | + <a id="comment-back" href="index.php#postId-<?php echo $_GET['postID']; ?>"> |
|
| 135 | 135 | <i class="fa fa-angle-left fa-3x"></i> |
| 136 | 136 | </a> |
| 137 | 137 | |
| 138 | - <a id="comment-refresh" href="index.php?getPostDetails=<?php echo $_GET['getPostDetails'];?>&postID=<?php echo $_GET['postID'];?>"> |
|
| 138 | + <a id="comment-refresh" href="index.php?getPostDetails=<?php echo $_GET['getPostDetails']; ?>&postID=<?php echo $_GET['postID']; ?>"> |
|
| 139 | 139 | <i class="fa fa-refresh fa-2x"></i> |
| 140 | 140 | </a> |
| 141 | 141 | <?php |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | |
| 185 | - for($i = 0; $i<$loops; $i++) { |
|
| 185 | + for($i = 0; $i < $loops; $i++) { |
|
| 186 | 186 | |
| 187 | 187 | if(isset($posts[$i])) { |
| 188 | 188 | $lastPostId = $posts[$i]['post_id']; |
@@ -200,24 +200,24 @@ discard block |
||
| 200 | 200 | $timediff_inHours = (string)$timediff->format('%h'); |
| 201 | 201 | $timediff_inDays = (string)$timediff->format('%d'); |
| 202 | 202 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 203 | - if($timediff_inMonth!=0) { |
|
| 203 | + if($timediff_inMonth != 0) { |
|
| 204 | 204 | $timediff = $timediff_inMonth . "m"; |
| 205 | 205 | } |
| 206 | 206 | else |
| 207 | 207 | { |
| 208 | - if($timediff_inDays!=0) |
|
| 208 | + if($timediff_inDays != 0) |
|
| 209 | 209 | { |
| 210 | 210 | $timediff = $timediff_inDays . "d"; |
| 211 | 211 | } |
| 212 | 212 | else |
| 213 | 213 | { |
| 214 | - if($timediff_inHours!=0) |
|
| 214 | + if($timediff_inHours != 0) |
|
| 215 | 215 | { |
| 216 | 216 | $timediff = $timediff_inHours . "h"; |
| 217 | 217 | } |
| 218 | 218 | else |
| 219 | 219 | { |
| 220 | - if($timediff_inMinutes!=0) |
|
| 220 | + if($timediff_inMinutes != 0) |
|
| 221 | 221 | { |
| 222 | 222 | $timediff = $timediff_inMinutes . "m"; |
| 223 | 223 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | } |
| 231 | 231 | ?> |
| 232 | 232 | |
| 233 | - <article id ="postId-<?php echo $posts[$i]["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $posts[$i]["color"];?>;"> |
|
| 233 | + <article id ="postId-<?php echo $posts[$i]["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $posts[$i]["color"]; ?>;"> |
|
| 234 | 234 | <content> |
| 235 | 235 | <?php |
| 236 | 236 | if(isset($posts[$i]["image_url"])) { |
@@ -242,12 +242,12 @@ discard block |
||
| 242 | 242 | ?> |
| 243 | 243 | </content> |
| 244 | 244 | <aside> |
| 245 | - <a href="index.php?vote=up&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 245 | + <a href="index.php?vote=up&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 246 | 246 | <i class="fa fa-angle-up fa-3x"></i> |
| 247 | 247 | </a> |
| 248 | 248 | <br /> |
| 249 | - <?php echo $posts[$i]["vote_count"];?><br /> |
|
| 250 | - <a href="index.php?vote=down&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 249 | + <?php echo $posts[$i]["vote_count"]; ?><br /> |
|
| 250 | + <a href="index.php?vote=down&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 251 | 251 | <i class="fa fa-angle-down fa-3x"></i> |
| 252 | 252 | </a> |
| 253 | 253 | </aside> |
@@ -258,13 +258,13 @@ discard block |
||
| 258 | 258 | <td class="time"> |
| 259 | 259 | <span data-tooltip="Time"> |
| 260 | 260 | <i class="fa fa-clock-o"></i> |
| 261 | - <?php echo $timediff;?> |
|
| 261 | + <?php echo $timediff; ?> |
|
| 262 | 262 | </span> |
| 263 | 263 | </td> |
| 264 | 264 | <td class="comments"> |
| 265 | 265 | <?php if($showCommentIcon) {?> |
| 266 | 266 | <span data-tooltip="Comments"> |
| 267 | - <a href="index.php?getPostDetails=true&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 267 | + <a href="index.php?getPostDetails=true&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 268 | 268 | <i class="fa fa-commenting-o"></i> |
| 269 | 269 | <?php if(array_key_exists("child_count", $posts[$i])) { |
| 270 | 270 | echo $posts[$i]["child_count"]; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | <td class="distance"> |
| 278 | 278 | <span data-tooltip="Distance"> |
| 279 | 279 | <i class="fa fa-map-marker"></i> |
| 280 | - <?php echo $posts[$i]["distance"];?> km |
|
| 280 | + <?php echo $posts[$i]["distance"]; ?> km |
|
| 281 | 281 | </span> |
| 282 | 282 | </td> |
| 283 | 283 | </tr> |
@@ -298,9 +298,9 @@ discard block |
||
| 298 | 298 | </p> |
| 299 | 299 | <?php } ?> |
| 300 | 300 | <nav id="sortJodelBy"> |
| 301 | - <a href="index.php" <?php if(isset($timeView)) echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 302 | - <a href="index.php?commentView=true" <?php if(isset($commentView)) echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 303 | - <a href="index.php?upVoteView=true" <?php if(isset($upVoteView)) echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 301 | + <a href="index.php" <?php if(isset($timeView)) echo 'class="active"'; ?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 302 | + <a href="index.php?commentView=true" <?php if(isset($commentView)) echo 'class="active"'; ?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 303 | + <a href="index.php?upVoteView=true" <?php if(isset($upVoteView)) echo 'class="active"'; ?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 304 | 304 | </nav> |
| 305 | 305 | </div> |
| 306 | 306 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?> |
| 325 | 325 | <h2>Comment on Jodel</h2> |
| 326 | 326 | <form method="POST"> |
| 327 | - <input type="hidden" name="ancestor" value="<?php echo $_GET['postID'];?>" /> |
|
| 327 | + <input type="hidden" name="ancestor" value="<?php echo $_GET['postID']; ?>" /> |
|
| 328 | 328 | <textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> |
| 329 | 329 | <br /> |
| 330 | 330 | <input type="submit" value="SEND" /> |
@@ -31,7 +31,8 @@ discard block |
||
| 31 | 31 | //createAccount(); |
| 32 | 32 | |
| 33 | 33 | //Set Location |
| 34 | - if(isset($_GET['city'])) { |
|
| 34 | + if(isset($_GET['city'])) |
|
| 35 | + { |
|
| 35 | 36 | |
| 36 | 37 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . $_GET['city'] . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w'; |
| 37 | 38 | $result = Requests::post($url); |
@@ -53,11 +54,14 @@ discard block |
||
| 53 | 54 | } |
| 54 | 55 | |
| 55 | 56 | //Vote |
| 56 | - if(isset($_GET['vote']) && isset($_GET['postID'])) { |
|
| 57 | - if($_GET['vote'] == "up") { |
|
| 57 | + if(isset($_GET['vote']) && isset($_GET['postID'])) |
|
| 58 | + { |
|
| 59 | + if($_GET['vote'] == "up") |
|
| 60 | + { |
|
| 58 | 61 | $accountCreator = new Upvote(); |
| 59 | 62 | } |
| 60 | - else if($_GET['vote'] == "down") { |
|
| 63 | + else if($_GET['vote'] == "down") |
|
| 64 | + { |
|
| 61 | 65 | $accountCreator = new Downvote(); |
| 62 | 66 | } |
| 63 | 67 | $accountCreator->setAccessToken($accessToken); |
@@ -69,7 +73,8 @@ discard block |
||
| 69 | 73 | |
| 70 | 74 | |
| 71 | 75 | //SendJodel |
| 72 | - if(isset($_POST['message'])) { |
|
| 76 | + if(isset($_POST['message'])) |
|
| 77 | + { |
|
| 73 | 78 | $ancestor; |
| 74 | 79 | if(isset($_POST['ancestor'])) |
| 75 | 80 | { |
@@ -113,7 +118,11 @@ discard block |
||
| 113 | 118 | <a href="index.php"> |
| 114 | 119 | <h1> |
| 115 | 120 | Jodel WebClient |
| 116 | - <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) echo '<i class="fa fa-refresh fa-1x"></i>';?> |
|
| 121 | + <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) |
|
| 122 | +{ |
|
| 123 | + echo '<i class="fa fa-refresh fa-1x"></i>'; |
|
| 124 | +} |
|
| 125 | +?> |
|
| 117 | 126 | </h1> |
| 118 | 127 | </a> |
| 119 | 128 | <div class="clear"></div> |
@@ -128,7 +137,8 @@ discard block |
||
| 128 | 137 | $posts; |
| 129 | 138 | |
| 130 | 139 | //Get Post Details |
| 131 | - if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { |
|
| 140 | + if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) |
|
| 141 | + { |
|
| 132 | 142 | //Header Nav in Comment View |
| 133 | 143 | ?> |
| 134 | 144 | <a id="comment-back" href="index.php#postId-<?php echo $_GET['postID'];?>"> |
@@ -146,17 +156,22 @@ discard block |
||
| 146 | 156 | $data = $accountCreator->execute(); |
| 147 | 157 | |
| 148 | 158 | $posts[0] = $data; |
| 149 | - if(isset($data['children'])) { |
|
| 150 | - foreach($data['children'] as $child) { |
|
| 159 | + if(isset($data['children'])) |
|
| 160 | + { |
|
| 161 | + foreach($data['children'] as $child) |
|
| 162 | + { |
|
| 151 | 163 | array_push($posts, $child); |
| 152 | 164 | } |
| 153 | 165 | $loops = $data['child_count'] + 1; |
| 154 | 166 | } |
| 155 | - else $loops = 1; |
|
| 167 | + else { |
|
| 168 | + $loops = 1; |
|
| 169 | + } |
|
| 156 | 170 | $showCommentIcon = FALSE; |
| 157 | 171 | } |
| 158 | 172 | //Get Posts |
| 159 | - else { |
|
| 173 | + else |
|
| 174 | + { |
|
| 160 | 175 | if(isset($_GET['commentView'])) |
| 161 | 176 | { |
| 162 | 177 | $commentView = true; |
@@ -182,9 +197,11 @@ discard block |
||
| 182 | 197 | } |
| 183 | 198 | |
| 184 | 199 | |
| 185 | - for($i = 0; $i<$loops; $i++) { |
|
| 200 | + for($i = 0; $i<$loops; $i++) |
|
| 201 | + { |
|
| 186 | 202 | |
| 187 | - if(isset($posts[$i])) { |
|
| 203 | + if(isset($posts[$i])) |
|
| 204 | + { |
|
| 188 | 205 | $lastPostId = $posts[$i]['post_id']; |
| 189 | 206 | |
| 190 | 207 | |
@@ -200,7 +217,8 @@ discard block |
||
| 200 | 217 | $timediff_inHours = (string)$timediff->format('%h'); |
| 201 | 218 | $timediff_inDays = (string)$timediff->format('%d'); |
| 202 | 219 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 203 | - if($timediff_inMonth!=0) { |
|
| 220 | + if($timediff_inMonth!=0) |
|
| 221 | + { |
|
| 204 | 222 | $timediff = $timediff_inMonth . "m"; |
| 205 | 223 | } |
| 206 | 224 | else |
@@ -233,10 +251,12 @@ discard block |
||
| 233 | 251 | <article id ="postId-<?php echo $posts[$i]["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $posts[$i]["color"];?>;"> |
| 234 | 252 | <content> |
| 235 | 253 | <?php |
| 236 | - if(isset($posts[$i]["image_url"])) { |
|
| 254 | + if(isset($posts[$i]["image_url"])) |
|
| 255 | + { |
|
| 237 | 256 | echo '<img src="' . $posts[$i]["image_url"] . '">'; |
| 238 | 257 | } |
| 239 | - else { |
|
| 258 | + else |
|
| 259 | + { |
|
| 240 | 260 | echo nl2br($posts[$i]["message"]); |
| 241 | 261 | } |
| 242 | 262 | ?> |
@@ -262,13 +282,19 @@ discard block |
||
| 262 | 282 | </span> |
| 263 | 283 | </td> |
| 264 | 284 | <td class="comments"> |
| 265 | - <?php if($showCommentIcon) {?> |
|
| 285 | + <?php if($showCommentIcon) |
|
| 286 | +{ |
|
| 287 | +?> |
|
| 266 | 288 | <span data-tooltip="Comments"> |
| 267 | 289 | <a href="index.php?getPostDetails=true&postID=<?php echo $posts[$i]["post_id"];?>"> |
| 268 | 290 | <i class="fa fa-commenting-o"></i> |
| 269 | - <?php if(array_key_exists("child_count", $posts[$i])) { |
|
| 291 | + <?php if(array_key_exists("child_count", $posts[$i])) |
|
| 292 | +{ |
|
| 270 | 293 | echo $posts[$i]["child_count"]; |
| 271 | - } else echo "0"; |
|
| 294 | + } |
|
| 295 | + else { |
|
| 296 | + echo "0"; |
|
| 297 | + } |
|
| 272 | 298 | ?> |
| 273 | 299 | </a> |
| 274 | 300 | </span> |
@@ -292,15 +318,29 @@ discard block |
||
| 292 | 318 | </content> |
| 293 | 319 | |
| 294 | 320 | </article> |
| 295 | - <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?> |
|
| 321 | + <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) |
|
| 322 | +{ |
|
| 323 | +?> |
|
| 296 | 324 | <p id="loading"> |
| 297 | 325 | <img src="images/loading.gif" alt="Loading…" /> |
| 298 | 326 | </p> |
| 299 | 327 | <?php } ?> |
| 300 | 328 | <nav id="sortJodelBy"> |
| 301 | - <a href="index.php" <?php if(isset($timeView)) echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 302 | - <a href="index.php?commentView=true" <?php if(isset($commentView)) echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 303 | - <a href="index.php?upVoteView=true" <?php if(isset($upVoteView)) echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 329 | + <a href="index.php" <?php if(isset($timeView)) |
|
| 330 | +{ |
|
| 331 | + echo 'class="active"'; |
|
| 332 | +} |
|
| 333 | +?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 334 | + <a href="index.php?commentView=true" <?php if(isset($commentView)) |
|
| 335 | +{ |
|
| 336 | + echo 'class="active"'; |
|
| 337 | +} |
|
| 338 | +?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 339 | + <a href="index.php?upVoteView=true" <?php if(isset($upVoteView)) |
|
| 340 | +{ |
|
| 341 | + echo 'class="active"'; |
|
| 342 | +} |
|
| 343 | +?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 304 | 344 | </nav> |
| 305 | 345 | </div> |
| 306 | 346 | |
@@ -308,7 +348,14 @@ discard block |
||
| 308 | 348 | <article> |
| 309 | 349 | <h3>Position</h3> |
| 310 | 350 | <form method="get"> |
| 311 | - <input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; else echo $posts[0]["location"]["name"]; ?>" required> |
|
| 351 | + <input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) |
|
| 352 | +{ |
|
| 353 | + echo $newPositionStatus; |
|
| 354 | +} |
|
| 355 | +else { |
|
| 356 | + echo $posts[0]["location"]["name"]; |
|
| 357 | +} |
|
| 358 | +?>" required> |
|
| 312 | 359 | |
| 313 | 360 | <input type="submit" value="Set Location" /> |
| 314 | 361 | </form> |
@@ -321,7 +368,9 @@ discard block |
||
| 321 | 368 | </article> |
| 322 | 369 | |
| 323 | 370 | <article> |
| 324 | - <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) { ?> |
|
| 371 | + <?php if(isset($_GET['postID']) && isset($_GET['getPostDetails'])) |
|
| 372 | +{ |
|
| 373 | +?> |
|
| 325 | 374 | <h2>Comment on Jodel</h2> |
| 326 | 375 | <form method="POST"> |
| 327 | 376 | <input type="hidden" name="ancestor" value="<?php echo $_GET['postID'];?>" /> |
@@ -329,7 +378,10 @@ discard block |
||
| 329 | 378 | <br /> |
| 330 | 379 | <input type="submit" value="SEND" /> |
| 331 | 380 | </form> |
| 332 | - <?php } else { ?> |
|
| 381 | + <?php } |
|
| 382 | +else |
|
| 383 | +{ |
|
| 384 | +?> |
|
| 333 | 385 | <h2>New Jodel</h2> |
| 334 | 386 | <form method="POST"> |
| 335 | 387 | <textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> |
@@ -358,7 +410,9 @@ discard block |
||
| 358 | 410 | $(this).addClass('selected'); |
| 359 | 411 | }); |
| 360 | 412 | |
| 361 | - <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) { ?> |
|
| 413 | + <?php if(!isset($_GET['postID']) && !isset($_GET['getPostDetails'])) |
|
| 414 | +{ |
|
| 415 | +?> |
|
| 362 | 416 | $(document).ready(function() { |
| 363 | 417 | var win = $(window); |
| 364 | 418 | var lastPostId = "<?php echo $lastPostId; ?>"; |
@@ -19,7 +19,7 @@ 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 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | $access_token; |
| 30 | 30 | |
| 31 | - if ($result->num_rows > 0) { |
|
| 31 | + if($result->num_rows > 0) { |
|
| 32 | 32 | // output data of each row |
| 33 | 33 | while($row = $result->fetch_assoc()) { |
| 34 | 34 | $access_token = $row["access_token"]; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | ?> |
| 77 | 77 | <div class="nextPosts"> |
| 78 | 78 | <?php |
| 79 | - for($i = 0; $i<$loops; $i++) { |
|
| 79 | + for($i = 0; $i < $loops; $i++) { |
|
| 80 | 80 | |
| 81 | 81 | if(isset($posts[$i])) { |
| 82 | 82 | $lastPostId = $posts[$i]['post_id']; |
@@ -94,24 +94,24 @@ discard block |
||
| 94 | 94 | $timediff_inHours = (string)$timediff->format('%h'); |
| 95 | 95 | $timediff_inDays = (string)$timediff->format('%d'); |
| 96 | 96 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 97 | - if($timediff_inMonth!=0) { |
|
| 97 | + if($timediff_inMonth != 0) { |
|
| 98 | 98 | $timediff = $timediff_inMonth . "m"; |
| 99 | 99 | } |
| 100 | 100 | else |
| 101 | 101 | { |
| 102 | - if($timediff_inDays!=0) |
|
| 102 | + if($timediff_inDays != 0) |
|
| 103 | 103 | { |
| 104 | 104 | $timediff = $timediff_inDays . "d"; |
| 105 | 105 | } |
| 106 | 106 | else |
| 107 | 107 | { |
| 108 | - if($timediff_inHours!=0) |
|
| 108 | + if($timediff_inHours != 0) |
|
| 109 | 109 | { |
| 110 | 110 | $timediff = $timediff_inHours . "h"; |
| 111 | 111 | } |
| 112 | 112 | else |
| 113 | 113 | { |
| 114 | - if($timediff_inMinutes!=0) |
|
| 114 | + if($timediff_inMinutes != 0) |
|
| 115 | 115 | { |
| 116 | 116 | $timediff = $timediff_inMinutes . "m"; |
| 117 | 117 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | ?> |
| 126 | 126 | |
| 127 | - <article class="jodel" style="background-color: #<?php echo $posts[$i]["color"];?>;"> |
|
| 127 | + <article class="jodel" style="background-color: #<?php echo $posts[$i]["color"]; ?>;"> |
|
| 128 | 128 | <content> |
| 129 | 129 | <?php |
| 130 | 130 | if(isset($posts[$i]["image_url"])) { |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | ?> |
| 137 | 137 | </content> |
| 138 | 138 | <aside> |
| 139 | - <a href="index.php?vote=up&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 139 | + <a href="index.php?vote=up&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 140 | 140 | <i class="fa fa-angle-up fa-3x"></i> |
| 141 | 141 | </a> |
| 142 | 142 | <br /> |
| 143 | - <?php echo $posts[$i]["vote_count"];?><br /> |
|
| 144 | - <a href="index.php?vote=down&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 143 | + <?php echo $posts[$i]["vote_count"]; ?><br /> |
|
| 144 | + <a href="index.php?vote=down&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 145 | 145 | <i class="fa fa-angle-down fa-3x"></i> |
| 146 | 146 | </a> |
| 147 | 147 | </aside> |
@@ -152,13 +152,13 @@ discard block |
||
| 152 | 152 | <td class="time"> |
| 153 | 153 | <span data-tooltip="Time"> |
| 154 | 154 | <i class="fa fa-clock-o"></i> |
| 155 | - <?php echo $timediff;?> |
|
| 155 | + <?php echo $timediff; ?> |
|
| 156 | 156 | </span> |
| 157 | 157 | </td> |
| 158 | 158 | <td class="comments"> |
| 159 | 159 | <?php if($showCommentIcon) {?> |
| 160 | 160 | <span data-tooltip="Comments"> |
| 161 | - <a href="index.php?getPostDetails=true&postID=<?php echo $posts[$i]["post_id"];?>"> |
|
| 161 | + <a href="index.php?getPostDetails=true&postID=<?php echo $posts[$i]["post_id"]; ?>"> |
|
| 162 | 162 | <i class="fa fa-commenting-o"></i> |
| 163 | 163 | <?php if(array_key_exists("child_count", $posts[$i])) { |
| 164 | 164 | echo $posts[$i]["child_count"]; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | <td class="distance"> |
| 172 | 172 | <span data-tooltip="Distance"> |
| 173 | 173 | <i class="fa fa-map-marker"></i> |
| 174 | - <?php echo $posts[$i]["distance"];?> km |
|
| 174 | + <?php echo $posts[$i]["distance"]; ?> km |
|
| 175 | 175 | </span> |
| 176 | 176 | </td> |
| 177 | 177 | </tr> |
@@ -17,18 +17,22 @@ discard block |
||
| 17 | 17 | require_once 'php/Requests/libary/Requests.php'; |
| 18 | 18 | Requests::register_autoloader(); |
| 19 | 19 | |
| 20 | -function getPosts($lastPostId, $url) { |
|
| 20 | +function getPosts($lastPostId, $url) |
|
| 21 | +{ |
|
| 21 | 22 | $db = new DatabaseConnect(); |
| 22 | - if ($db->connect_errno) { |
|
| 23 | + if ($db->connect_errno) |
|
| 24 | + { |
|
| 23 | 25 | echo 'Sorry, die Verbindung zu unserem superfetten endgeilen |
| 24 | 26 | Server ist hops gegangen. Wegen '. $db -> connect_error; |
| 25 | 27 | } |
| 26 | 28 | |
| 27 | 29 | $result = $db->query("SELECT * FROM accounts WHERE id='1'"); |
| 28 | 30 | |
| 29 | - if ($result->num_rows > 0) { |
|
| 31 | + if ($result->num_rows > 0) |
|
| 32 | + { |
|
| 30 | 33 | // output data of each row |
| 31 | - while($row = $result->fetch_assoc()) { |
|
| 34 | + while($row = $result->fetch_assoc()) |
|
| 35 | + { |
|
| 32 | 36 | $access_token = $row["access_token"]; |
| 33 | 37 | } |
| 34 | 38 | } |
@@ -66,7 +70,8 @@ discard block |
||
| 66 | 70 | } |
| 67 | 71 | } |
| 68 | 72 | |
| 69 | - if(isset($_GET['lastPostId'])) { |
|
| 73 | + if(isset($_GET['lastPostId'])) |
|
| 74 | + { |
|
| 70 | 75 | |
| 71 | 76 | $lastPostId = $_GET['lastPostId']; |
| 72 | 77 | |
@@ -76,9 +81,11 @@ discard block |
||
| 76 | 81 | ?> |
| 77 | 82 | <div class="nextPosts"> |
| 78 | 83 | <?php |
| 79 | - for($i = 0; $i<$loops; $i++) { |
|
| 84 | + for($i = 0; $i<$loops; $i++) |
|
| 85 | + { |
|
| 80 | 86 | |
| 81 | - if(isset($posts[$i])) { |
|
| 87 | + if(isset($posts[$i])) |
|
| 88 | + { |
|
| 82 | 89 | $lastPostId = $posts[$i]['post_id']; |
| 83 | 90 | |
| 84 | 91 | |
@@ -94,7 +101,8 @@ discard block |
||
| 94 | 101 | $timediff_inHours = (string)$timediff->format('%h'); |
| 95 | 102 | $timediff_inDays = (string)$timediff->format('%d'); |
| 96 | 103 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 97 | - if($timediff_inMonth!=0) { |
|
| 104 | + if($timediff_inMonth!=0) |
|
| 105 | + { |
|
| 98 | 106 | $timediff = $timediff_inMonth . "m"; |
| 99 | 107 | } |
| 100 | 108 | else |
@@ -127,10 +135,12 @@ discard block |
||
| 127 | 135 | <article class="jodel" style="background-color: #<?php echo $posts[$i]["color"];?>;"> |
| 128 | 136 | <content> |
| 129 | 137 | <?php |
| 130 | - if(isset($posts[$i]["image_url"])) { |
|
| 138 | + if(isset($posts[$i]["image_url"])) |
|
| 139 | + { |
|
| 131 | 140 | echo '<img src="' . $posts[$i]["image_url"] . '">'; |
| 132 | 141 | } |
| 133 | - else { |
|
| 142 | + else |
|
| 143 | + { |
|
| 134 | 144 | echo nl2br($posts[$i]["message"]); |
| 135 | 145 | } |
| 136 | 146 | ?> |
@@ -156,13 +166,19 @@ discard block |
||
| 156 | 166 | </span> |
| 157 | 167 | </td> |
| 158 | 168 | <td class="comments"> |
| 159 | - <?php if($showCommentIcon) {?> |
|
| 169 | + <?php if($showCommentIcon) |
|
| 170 | +{ |
|
| 171 | +?> |
|
| 160 | 172 | <span data-tooltip="Comments"> |
| 161 | 173 | <a href="index.php?getPostDetails=true&postID=<?php echo $posts[$i]["post_id"];?>"> |
| 162 | 174 | <i class="fa fa-commenting-o"></i> |
| 163 | - <?php if(array_key_exists("child_count", $posts[$i])) { |
|
| 175 | + <?php if(array_key_exists("child_count", $posts[$i])) |
|
| 176 | +{ |
|
| 164 | 177 | echo $posts[$i]["child_count"]; |
| 165 | - } else echo "0"; |
|
| 178 | + } |
|
| 179 | + else { |
|
| 180 | + echo "0"; |
|
| 181 | + } |
|
| 166 | 182 | ?> |
| 167 | 183 | </a> |
| 168 | 184 | </span> |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | } |
| 14 | 14 | $db = new DatabaseConnect(); |
| 15 | -if ($db->connect_errno) { |
|
| 15 | +if($db->connect_errno) { |
|
| 16 | 16 | echo 'Sorry, die Verbindung zu unserem superfetten endgeilen |
| 17 | 17 | Server ist hops gegangen. Wegen '.$db -> connect_error; |
| 18 | 18 | } |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | |
| 13 | 13 | } |
| 14 | 14 | $db = new DatabaseConnect(); |
| 15 | -if ($db->connect_errno) { |
|
| 15 | +if ($db->connect_errno) |
|
| 16 | +{ |
|
| 16 | 17 | echo 'Sorry, die Verbindung zu unserem superfetten endgeilen |
| 17 | 18 | Server ist hops gegangen. Wegen '.$db -> connect_error; |
| 18 | 19 | } |
@@ -1,7 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -class GetKarma extends AbstractRequest { |
|
| 4 | +class GetKarma extends AbstractRequest |
|
| 5 | +{ |
|
| 5 | 6 | |
| 6 | 7 | function getApiEndPoint() |
| 7 | 8 | { |
@@ -1,7 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -class SetLocation extends AbstractRequest { |
|
| 4 | +class SetLocation extends AbstractRequest |
|
| 5 | +{ |
|
| 5 | 6 | /** |
| 6 | 7 | * @var Location |
| 7 | 8 | */ |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | $str = ''; |
| 38 | 38 | $max = mb_strlen($keyspace, '8bit') - 1; |
| 39 | - for ($i = 0; $i < $length; ++$i) { |
|
| 39 | + for($i = 0; $i < $length; ++$i) { |
|
| 40 | 40 | $str .= $keyspace[random_int(0, $max)]; |
| 41 | 41 | } |
| 42 | 42 | return $str; |
@@ -1,6 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class CreateUser extends AbstractRequest { |
|
| 3 | +class CreateUser extends AbstractRequest |
|
| 4 | +{ |
|
| 4 | 5 | /** |
| 5 | 6 | * @var Location |
| 6 | 7 | */ |
@@ -25,7 +26,7 @@ discard block |
||
| 25 | 26 | return $this->deviceUid; |
| 26 | 27 | } |
| 27 | 28 | public function setDeviceUid($deviceUid) |
| 28 | - { |
|
| 29 | + { |
|
| 29 | 30 | $this->deviceUid = $deviceUid; |
| 30 | 31 | } |
| 31 | 32 | public function generateDeviceUid() |
@@ -36,7 +37,8 @@ discard block |
||
| 36 | 37 | { |
| 37 | 38 | $str = ''; |
| 38 | 39 | $max = mb_strlen($keyspace, '8bit') - 1; |
| 39 | - for ($i = 0; $i < $length; ++$i) { |
|
| 40 | + for ($i = 0; $i < $length; ++$i) |
|
| 41 | + { |
|
| 40 | 42 | $str .= $keyspace[random_int(0, $max)]; |
| 41 | 43 | } |
| 42 | 44 | return $str; |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | public $url; |
| 9 | 9 | |
| 10 | - function setUrl ($url) |
|
| 10 | + function setUrl($url) |
|
| 11 | 11 | { |
| 12 | 12 | $this->url = $url; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - function getUrl () |
|
| 15 | + function getUrl() |
|
| 16 | 16 | { |
| 17 | 17 | return $this->url; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - function setLastPostId ($lastPostId) |
|
| 20 | + function setLastPostId($lastPostId) |
|
| 21 | 21 | { |
| 22 | 22 | $this->lastPostId = $lastPostId; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - function getlastPostId () |
|
| 25 | + function getlastPostId() |
|
| 26 | 26 | { |
| 27 | 27 | return $this->lastPostId; |
| 28 | 28 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $apiEndPoint = $this->getUrl(); |
| 33 | 33 | //echo $GLOBALS['lastPostId']; |
| 34 | - if ($this->getLastPostId() != "") { |
|
| 34 | + if($this->getLastPostId() != "") { |
|
| 35 | 35 | $apiEndPoint = $this->getUrl() . '/location/?after=' . $this->getLastPostId(); |
| 36 | 36 | } |
| 37 | 37 | return $apiEndPoint; |
@@ -31,7 +31,8 @@ |
||
| 31 | 31 | { |
| 32 | 32 | $apiEndPoint = $this->getUrl(); |
| 33 | 33 | //echo $GLOBALS['lastPostId']; |
| 34 | - if ($this->getLastPostId() != "") { |
|
| 34 | + if ($this->getLastPostId() != "") |
|
| 35 | + { |
|
| 35 | 36 | $apiEndPoint = $this->getUrl() . '/location/?after=' . $this->getLastPostId(); |
| 36 | 37 | } |
| 37 | 38 | return $apiEndPoint; |