@@ -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 | } |
@@ -111,11 +111,11 @@ discard block |
||
| 111 | 111 | function getLocationByAccessToken($accessToken) |
| 112 | 112 | { |
| 113 | 113 | $db = new DatabaseConnect(); |
| 114 | - $result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'"); |
|
| 114 | + $result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'"); |
|
| 115 | 115 | |
| 116 | 116 | $location = new Location(); |
| 117 | 117 | |
| 118 | - if ($result->num_rows > 0) |
|
| 118 | + if($result->num_rows > 0) |
|
| 119 | 119 | { |
| 120 | 120 | // output data of each row |
| 121 | 121 | while($row = $result->fetch_assoc()) |
@@ -164,11 +164,11 @@ discard block |
||
| 164 | 164 | $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type, |
| 165 | 165 | expires_in, expiration_date, distinct_id, device_uid, name, lat, lng) |
| 166 | 166 | VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type . |
| 167 | - "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
| 167 | + "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
| 168 | 168 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 169 | 169 | |
| 170 | 170 | $success = TRUE; |
| 171 | - if($result === false){ |
|
| 171 | + if($result === false) { |
|
| 172 | 172 | $error = db_error(); |
| 173 | 173 | echo $error; |
| 174 | 174 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
@@ -225,25 +225,25 @@ discard block |
||
| 225 | 225 | $timediff_inDays = (string)$timediff->format('%d'); |
| 226 | 226 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 227 | 227 | |
| 228 | - if($timediff_inMonth!=0) |
|
| 228 | + if($timediff_inMonth != 0) |
|
| 229 | 229 | { |
| 230 | 230 | $timediff = $timediff_inMonth . "m"; |
| 231 | 231 | } |
| 232 | 232 | else |
| 233 | 233 | { |
| 234 | - if($timediff_inDays!=0) |
|
| 234 | + if($timediff_inDays != 0) |
|
| 235 | 235 | { |
| 236 | 236 | $timediff = $timediff_inDays . "d"; |
| 237 | 237 | } |
| 238 | 238 | else |
| 239 | 239 | { |
| 240 | - if($timediff_inHours!=0) |
|
| 240 | + if($timediff_inHours != 0) |
|
| 241 | 241 | { |
| 242 | 242 | $timediff = $timediff_inHours . "h"; |
| 243 | 243 | } |
| 244 | 244 | else |
| 245 | 245 | { |
| 246 | - if($timediff_inMinutes!=0) |
|
| 246 | + if($timediff_inMinutes != 0) |
|
| 247 | 247 | { |
| 248 | 248 | $timediff = $timediff_inMinutes . "m"; |
| 249 | 249 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | |
| 259 | 259 | ?> |
| 260 | - <article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"];?>;"> |
|
| 260 | + <article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"]; ?>;"> |
|
| 261 | 261 | <content> |
| 262 | 262 | <?php |
| 263 | 263 | if(isset($post["image_url"])) { |
@@ -269,12 +269,12 @@ discard block |
||
| 269 | 269 | ?> |
| 270 | 270 | </content> |
| 271 | 271 | <aside> |
| 272 | - <a href="index.php?vote=up&postID=<?php echo $post["post_id"];?>"> |
|
| 272 | + <a href="index.php?vote=up&postID=<?php echo $post["post_id"]; ?>"> |
|
| 273 | 273 | <i class="fa fa-angle-up fa-3x"></i> |
| 274 | 274 | </a> |
| 275 | 275 | <br /> |
| 276 | - <?php echo $post["vote_count"];?><br /> |
|
| 277 | - <a href="index.php?vote=down&postID=<?php echo $post["post_id"];?>"> |
|
| 276 | + <?php echo $post["vote_count"]; ?><br /> |
|
| 277 | + <a href="index.php?vote=down&postID=<?php echo $post["post_id"]; ?>"> |
|
| 278 | 278 | <i class="fa fa-angle-down fa-3x"></i> |
| 279 | 279 | </a> |
| 280 | 280 | </aside> |
@@ -285,13 +285,13 @@ discard block |
||
| 285 | 285 | <td class="time"> |
| 286 | 286 | <span data-tooltip="Time"> |
| 287 | 287 | <i class="fa fa-clock-o"></i> |
| 288 | - <?php echo $timediff;?> |
|
| 288 | + <?php echo $timediff; ?> |
|
| 289 | 289 | </span> |
| 290 | 290 | </td> |
| 291 | 291 | <td class="comments"> |
| 292 | 292 | <?php if(!$isDetailedView) {?> |
| 293 | 293 | <span data-tooltip="Comments"> |
| 294 | - <a href="index.php?getPostDetails=true&view=<?php echo $view;?>&postID=<?php echo $post["post_id"];?>"> |
|
| 294 | + <a href="index.php?getPostDetails=true&view=<?php echo $view; ?>&postID=<?php echo $post["post_id"]; ?>"> |
|
| 295 | 295 | <i class="fa fa-commenting-o"></i> |
| 296 | 296 | <?php if(array_key_exists("child_count", $post)) { |
| 297 | 297 | echo $post["child_count"]; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | { |
| 321 | 321 | ?> |
| 322 | 322 | <span data-tooltip="Author"> |
| 323 | - <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> | |
|
| 323 | + <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> | |
|
| 324 | 324 | </span> |
| 325 | 325 | <?php |
| 326 | 326 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | <span data-tooltip="Distance"> |
| 332 | 332 | <i class="fa fa-map-marker"></i> |
| 333 | - <?php echo $post["distance"];?> km |
|
| 333 | + <?php echo $post["distance"]; ?> km |
|
| 334 | 334 | </span> |
| 335 | 335 | </td> |
| 336 | 336 | </tr> |