@@ -40,6 +40,6 @@ |
||
40 | 40 | ) DEFAULT CHARSET=utf8"; |
41 | 41 | if(!$db->query($query)) |
42 | 42 | { |
43 | - throw new Exception($db->error($mysqli)); |
|
43 | + throw new Exception($db->error($mysqli)); |
|
44 | 44 | } |
45 | 45 |
@@ -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 | } |
@@ -3,18 +3,18 @@ |
||
3 | 3 | |
4 | 4 | class GetKarma extends AbstractRequest { |
5 | 5 | |
6 | - function getApiEndPoint() |
|
7 | - { |
|
8 | - return '/v2/users/karma'; |
|
9 | - } |
|
10 | - function getPayload() |
|
11 | - { |
|
12 | - return array( |
|
13 | - ); |
|
14 | - } |
|
15 | - function getMethod() |
|
16 | - { |
|
17 | - return 'GET'; |
|
18 | - } |
|
6 | + function getApiEndPoint() |
|
7 | + { |
|
8 | + return '/v2/users/karma'; |
|
9 | + } |
|
10 | + function getPayload() |
|
11 | + { |
|
12 | + return array( |
|
13 | + ); |
|
14 | + } |
|
15 | + function getMethod() |
|
16 | + { |
|
17 | + return 'GET'; |
|
18 | + } |
|
19 | 19 | } |
20 | 20 |
@@ -5,20 +5,20 @@ discard block |
||
5 | 5 | { |
6 | 6 | public $lastPostId; |
7 | 7 | |
8 | - public $url; |
|
8 | + public $url; |
|
9 | 9 | |
10 | - function setUrl ($url) |
|
11 | - { |
|
12 | - $this->url = $url; |
|
13 | - } |
|
10 | + function setUrl ($url) |
|
11 | + { |
|
12 | + $this->url = $url; |
|
13 | + } |
|
14 | 14 | |
15 | - function getUrl () |
|
16 | - { |
|
17 | - return $this->url; |
|
18 | - } |
|
15 | + function getUrl () |
|
16 | + { |
|
17 | + return $this->url; |
|
18 | + } |
|
19 | 19 | |
20 | - function setLastPostId ($lastPostId) |
|
21 | - { |
|
20 | + function setLastPostId ($lastPostId) |
|
21 | + { |
|
22 | 22 | $this->lastPostId = $lastPostId; |
23 | 23 | } |
24 | 24 | |
@@ -27,22 +27,22 @@ discard block |
||
27 | 27 | return $this->lastPostId; |
28 | 28 | } |
29 | 29 | |
30 | - function getApiEndPoint() |
|
31 | - { |
|
32 | - $apiEndPoint = $this->getUrl(); |
|
33 | - //echo $GLOBALS['lastPostId']; |
|
34 | - if ($this->getLastPostId() != "") { |
|
30 | + function getApiEndPoint() |
|
31 | + { |
|
32 | + $apiEndPoint = $this->getUrl(); |
|
33 | + //echo $GLOBALS['lastPostId']; |
|
34 | + if ($this->getLastPostId() != "") { |
|
35 | 35 | $apiEndPoint = $this->getUrl() . '/location/?after=' . $this->getLastPostId(); |
36 | 36 | } |
37 | - return $apiEndPoint; |
|
38 | - } |
|
39 | - function getPayload() |
|
40 | - { |
|
41 | - return array( |
|
42 | - ); |
|
43 | - } |
|
44 | - function getMethod() |
|
45 | - { |
|
46 | - return 'GET'; |
|
47 | - } |
|
37 | + return $apiEndPoint; |
|
38 | + } |
|
39 | + function getPayload() |
|
40 | + { |
|
41 | + return array( |
|
42 | + ); |
|
43 | + } |
|
44 | + function getMethod() |
|
45 | + { |
|
46 | + return 'GET'; |
|
47 | + } |
|
48 | 48 | } |
@@ -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; |
@@ -3,19 +3,19 @@ |
||
3 | 3 | |
4 | 4 | class Upvote extends AbstractRequest { |
5 | 5 | |
6 | - function getApiEndPoint() |
|
7 | - { |
|
8 | - return '/v2/posts/' . $_GET['postID'] . '/upvote'; |
|
9 | - } |
|
10 | - function getPayload() |
|
11 | - { |
|
12 | - return array( |
|
6 | + function getApiEndPoint() |
|
7 | + { |
|
8 | + return '/v2/posts/' . $_GET['postID'] . '/upvote'; |
|
9 | + } |
|
10 | + function getPayload() |
|
11 | + { |
|
12 | + return array( |
|
13 | 13 | "reason_code" => -1, |
14 | - ); |
|
15 | - } |
|
16 | - function getMethod() |
|
17 | - { |
|
18 | - return 'PUT'; |
|
19 | - } |
|
14 | + ); |
|
15 | + } |
|
16 | + function getMethod() |
|
17 | + { |
|
18 | + return 'PUT'; |
|
19 | + } |
|
20 | 20 | } |
21 | 21 |
@@ -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 |
@@ -3,18 +3,18 @@ |
||
3 | 3 | |
4 | 4 | class GetPostDetails extends AbstractRequest { |
5 | 5 | |
6 | - function getApiEndPoint() |
|
7 | - { |
|
8 | - return '/v2/posts/' . $_GET['postID']; |
|
9 | - } |
|
10 | - function getPayload() |
|
11 | - { |
|
12 | - return array( |
|
13 | - ); |
|
14 | - } |
|
15 | - function getMethod() |
|
16 | - { |
|
17 | - return 'GET'; |
|
18 | - } |
|
6 | + function getApiEndPoint() |
|
7 | + { |
|
8 | + return '/v2/posts/' . $_GET['postID']; |
|
9 | + } |
|
10 | + function getPayload() |
|
11 | + { |
|
12 | + return array( |
|
13 | + ); |
|
14 | + } |
|
15 | + function getMethod() |
|
16 | + { |
|
17 | + return 'GET'; |
|
18 | + } |
|
19 | 19 | } |
20 | 20 |
@@ -3,18 +3,18 @@ |
||
3 | 3 | |
4 | 4 | class Downvote extends AbstractRequest { |
5 | 5 | |
6 | - function getApiEndPoint() |
|
7 | - { |
|
8 | - return '/v2/posts/' . $_GET['postID'] . '/downvote'; |
|
9 | - } |
|
10 | - function getPayload() |
|
11 | - { |
|
12 | - return array( |
|
13 | - ); |
|
14 | - } |
|
15 | - function getMethod() |
|
16 | - { |
|
17 | - return 'PUT'; |
|
18 | - } |
|
6 | + function getApiEndPoint() |
|
7 | + { |
|
8 | + return '/v2/posts/' . $_GET['postID'] . '/downvote'; |
|
9 | + } |
|
10 | + function getPayload() |
|
11 | + { |
|
12 | + return array( |
|
13 | + ); |
|
14 | + } |
|
15 | + function getMethod() |
|
16 | + { |
|
17 | + return 'PUT'; |
|
18 | + } |
|
19 | 19 | } |
20 | 20 |
@@ -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', |
@@ -2,51 +2,51 @@ |
||
2 | 2 | |
3 | 3 | class Location{ |
4 | 4 | |
5 | - public $cityName; |
|
6 | - |
|
7 | - public $lat; |
|
8 | - |
|
9 | - public $lng; |
|
10 | - |
|
11 | - public function getCityName() |
|
12 | - { |
|
13 | - return $this->cityName; |
|
14 | - } |
|
15 | - |
|
16 | - public function setCityName($cityName) |
|
17 | - { |
|
18 | - $this->cityName = $cityName; |
|
19 | - } |
|
20 | - |
|
21 | - public function getLat() |
|
22 | - { |
|
23 | - return $this->lat; |
|
24 | - } |
|
25 | - |
|
26 | - public function setLat($lat) |
|
27 | - { |
|
28 | - $this->lat = $lat; |
|
29 | - } |
|
30 | - |
|
31 | - public function getLng() |
|
32 | - { |
|
33 | - return $this->lng; |
|
34 | - } |
|
35 | - |
|
36 | - public function setLng($lng) |
|
37 | - { |
|
38 | - $this->lng = $lng; |
|
39 | - } |
|
40 | - public function toArray(){ |
|
41 | - return array( |
|
42 | - "city" => $this->getCityName(), |
|
43 | - "country" => 'DE', |
|
44 | - "loc_accuracy" => '0.0', |
|
45 | - "loc_coordinates" => array( |
|
46 | - "lat" => $this->getLat(), |
|
47 | - "lng" => $this->getLng(), |
|
48 | - ), |
|
49 | - "name" => $this->getCityName() |
|
50 | - ); |
|
51 | - } |
|
5 | + public $cityName; |
|
6 | + |
|
7 | + public $lat; |
|
8 | + |
|
9 | + public $lng; |
|
10 | + |
|
11 | + public function getCityName() |
|
12 | + { |
|
13 | + return $this->cityName; |
|
14 | + } |
|
15 | + |
|
16 | + public function setCityName($cityName) |
|
17 | + { |
|
18 | + $this->cityName = $cityName; |
|
19 | + } |
|
20 | + |
|
21 | + public function getLat() |
|
22 | + { |
|
23 | + return $this->lat; |
|
24 | + } |
|
25 | + |
|
26 | + public function setLat($lat) |
|
27 | + { |
|
28 | + $this->lat = $lat; |
|
29 | + } |
|
30 | + |
|
31 | + public function getLng() |
|
32 | + { |
|
33 | + return $this->lng; |
|
34 | + } |
|
35 | + |
|
36 | + public function setLng($lng) |
|
37 | + { |
|
38 | + $this->lng = $lng; |
|
39 | + } |
|
40 | + public function toArray(){ |
|
41 | + return array( |
|
42 | + "city" => $this->getCityName(), |
|
43 | + "country" => 'DE', |
|
44 | + "loc_accuracy" => '0.0', |
|
45 | + "loc_coordinates" => array( |
|
46 | + "lat" => $this->getLat(), |
|
47 | + "lng" => $this->getLng(), |
|
48 | + ), |
|
49 | + "name" => $this->getCityName() |
|
50 | + ); |
|
51 | + } |
|
52 | 52 | } |
@@ -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" /> |