@@ -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" /> |
@@ -207,13 +207,13 @@ discard block |
||
207 | 207 | <div class="col-sm-12"> |
208 | 208 | <div class="row"> |
209 | 209 | <div class="col-sm-3"> |
210 | - <a href="index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
210 | + <a href="index.php" <?php if($view == 'time') echo 'class="active"'; ?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
211 | 211 | </div> |
212 | 212 | <div class="col-sm-3"> |
213 | - <a href="index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
213 | + <a href="index.php?view=comment" <?php if($view == 'comment') echo 'class="active"'; ?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
214 | 214 | </div> |
215 | 215 | <div class="col-sm-3"> |
216 | - <a href="index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
216 | + <a href="index.php?view=upVote" <?php if($view == 'upVote') echo 'class="active"'; ?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
217 | 217 | </div> |
218 | 218 | <div class="col-sm-3"> |
219 | 219 | <nav> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $db = new DatabaseConnect(); |
24 | 24 | $result = $db->query("SELECT * FROM accounts WHERE id='1'"); |
25 | 25 | |
26 | - if ($result->num_rows > 0) |
|
26 | + if($result->num_rows > 0) |
|
27 | 27 | { |
28 | 28 | // output data of each row |
29 | 29 | while($row = $result->fetch_assoc()) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | if($expiration_date <= time()) { |
42 | 42 | $accountCreator = new CreateUser(); |
43 | - $accountCreator->setAccessToken($access_token);//$accountData->getAccessToken()); |
|
43 | + $accountCreator->setAccessToken($access_token); //$accountData->getAccessToken()); |
|
44 | 44 | $accountCreator->setDeviceUid($deviceUid); |
45 | 45 | $accountCreator->setLocation($location); |
46 | 46 | $data = $accountCreator->execute(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | expiration_date='" . $expiration_date . "' |
56 | 56 | WHERE device_uid='" . $device_uid . "'"); |
57 | 57 | |
58 | - if($result === false){ |
|
58 | + if($result === false) { |
|
59 | 59 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
60 | 60 | } |
61 | 61 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $db = new DatabaseConnect(); |
69 | 69 | $result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'"); |
70 | 70 | |
71 | - if ($result->num_rows > 0) |
|
71 | + if($result->num_rows > 0) |
|
72 | 72 | { |
73 | 73 | // output data of each row |
74 | 74 | while($row = $result->fetch_assoc()) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | if($expiration_date <= time()) { |
87 | 87 | $accountCreator = new CreateUser(); |
88 | - $accountCreator->setAccessToken($access_token);//$accountData->getAccessToken()); |
|
88 | + $accountCreator->setAccessToken($access_token); //$accountData->getAccessToken()); |
|
89 | 89 | $accountCreator->setDeviceUid($deviceUid); |
90 | 90 | $accountCreator->setLocation($location); |
91 | 91 | $data = $accountCreator->execute(); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | expiration_date='" . $expiration_date . "' |
101 | 101 | WHERE device_uid='" . $device_uid . "'"); |
102 | 102 | |
103 | - if($result === false){ |
|
103 | + if($result === false) { |
|
104 | 104 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
105 | 105 | } |
106 | 106 | } |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type, |
139 | 139 | expires_in, expiration_date, distinct_id, device_uid, name, lat, lng) |
140 | 140 | VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type . |
141 | - "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
141 | + "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
142 | 142 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
143 | 143 | |
144 | 144 | $success = TRUE; |
145 | - if($result === false){ |
|
145 | + if($result === false) { |
|
146 | 146 | $error = db_error(); |
147 | 147 | echo $error; |
148 | 148 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
@@ -197,25 +197,25 @@ discard block |
||
197 | 197 | $timediff_inDays = (string)$timediff->format('%d'); |
198 | 198 | $timediff_inMonth = (string)$timediff->format('%m'); |
199 | 199 | |
200 | - if($timediff_inMonth!=0) |
|
200 | + if($timediff_inMonth != 0) |
|
201 | 201 | { |
202 | 202 | $timediff = $timediff_inMonth . "m"; |
203 | 203 | } |
204 | 204 | else |
205 | 205 | { |
206 | - if($timediff_inDays!=0) |
|
206 | + if($timediff_inDays != 0) |
|
207 | 207 | { |
208 | 208 | $timediff = $timediff_inDays . "d"; |
209 | 209 | } |
210 | 210 | else |
211 | 211 | { |
212 | - if($timediff_inHours!=0) |
|
212 | + if($timediff_inHours != 0) |
|
213 | 213 | { |
214 | 214 | $timediff = $timediff_inHours . "h"; |
215 | 215 | } |
216 | 216 | else |
217 | 217 | { |
218 | - if($timediff_inMinutes!=0) |
|
218 | + if($timediff_inMinutes != 0) |
|
219 | 219 | { |
220 | 220 | $timediff = $timediff_inMinutes . "m"; |
221 | 221 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | |
231 | 231 | ?> |
232 | - <article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"];?>;"> |
|
232 | + <article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"]; ?>;"> |
|
233 | 233 | <content> |
234 | 234 | <?php |
235 | 235 | if(isset($post["image_url"])) { |
@@ -241,12 +241,12 @@ discard block |
||
241 | 241 | ?> |
242 | 242 | </content> |
243 | 243 | <aside> |
244 | - <a href="index.php?vote=up&postID=<?php echo $post["post_id"];?>"> |
|
244 | + <a href="index.php?vote=up&postID=<?php echo $post["post_id"]; ?>"> |
|
245 | 245 | <i class="fa fa-angle-up fa-3x"></i> |
246 | 246 | </a> |
247 | 247 | <br /> |
248 | - <?php echo $post["vote_count"];?><br /> |
|
249 | - <a href="index.php?vote=down&postID=<?php echo $post["post_id"];?>"> |
|
248 | + <?php echo $post["vote_count"]; ?><br /> |
|
249 | + <a href="index.php?vote=down&postID=<?php echo $post["post_id"]; ?>"> |
|
250 | 250 | <i class="fa fa-angle-down fa-3x"></i> |
251 | 251 | </a> |
252 | 252 | </aside> |
@@ -257,13 +257,13 @@ discard block |
||
257 | 257 | <td class="time"> |
258 | 258 | <span data-tooltip="Time"> |
259 | 259 | <i class="fa fa-clock-o"></i> |
260 | - <?php echo $timediff;?> |
|
260 | + <?php echo $timediff; ?> |
|
261 | 261 | </span> |
262 | 262 | </td> |
263 | 263 | <td class="comments"> |
264 | 264 | <?php if(!$isDetailedView) {?> |
265 | 265 | <span data-tooltip="Comments"> |
266 | - <a href="index.php?getPostDetails=true&view=<?php echo $view;?>&postID=<?php echo $post["post_id"];?>"> |
|
266 | + <a href="index.php?getPostDetails=true&view=<?php echo $view; ?>&postID=<?php echo $post["post_id"]; ?>"> |
|
267 | 267 | <i class="fa fa-commenting-o"></i> |
268 | 268 | <?php if(array_key_exists("child_count", $post)) { |
269 | 269 | echo $post["child_count"]; |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | { |
293 | 293 | ?> |
294 | 294 | <span data-tooltip="Author"> |
295 | - <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> | |
|
295 | + <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> | |
|
296 | 296 | </span> |
297 | 297 | <?php |
298 | 298 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | <span data-tooltip="Distance"> |
304 | 304 | <i class="fa fa-map-marker"></i> |
305 | - <?php echo $post["distance"];?> km |
|
305 | + <?php echo $post["distance"]; ?> km |
|
306 | 306 | </span> |
307 | 307 | </td> |
308 | 308 | </tr> |