@@ -41,36 +41,36 @@ discard block |
||
41 | 41 | |
42 | 42 | function isUserBot() |
43 | 43 | { |
44 | - preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
|
44 | + preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
|
45 | 45 | |
46 | - return (isset($matches[0])) ? true : false; |
|
46 | + return (isset($matches[0])) ? true : false; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | function configPropertyExists($config, $property) |
50 | 50 | { |
51 | - if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') |
|
52 | - { |
|
53 | - return FALSE; |
|
54 | - } |
|
55 | - else |
|
56 | - { |
|
57 | - return TRUE; |
|
58 | - } |
|
51 | + if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') |
|
52 | + { |
|
53 | + return FALSE; |
|
54 | + } |
|
55 | + else |
|
56 | + { |
|
57 | + return TRUE; |
|
58 | + } |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | function isDeviceUidInDatabase($deviceUid) |
62 | 62 | { |
63 | - $db = new DatabaseConnect(); |
|
64 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
63 | + $db = new DatabaseConnect(); |
|
64 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
65 | 65 | |
66 | - if ($result->num_rows > 0) |
|
67 | - { |
|
68 | - return TRUE; |
|
69 | - } |
|
70 | - else |
|
71 | - { |
|
72 | - return FALSE; |
|
73 | - } |
|
66 | + if ($result->num_rows > 0) |
|
67 | + { |
|
68 | + return TRUE; |
|
69 | + } |
|
70 | + else |
|
71 | + { |
|
72 | + return FALSE; |
|
73 | + } |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | //Check if it's a Spider or Google Bot |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | if(configPropertyExists($config, 'karmaDeviceUid')) |
100 | - { |
|
101 | - $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
|
102 | - } |
|
103 | - else |
|
104 | - { |
|
105 | - error_log("No Karma deviceUid set in config file"); |
|
100 | + { |
|
101 | + $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
|
102 | + } |
|
103 | + else |
|
104 | + { |
|
105 | + error_log("No Karma deviceUid set in config file"); |
|
106 | 106 | $jodelAccountForKarma = new JodelAccount($deviceUid); |
107 | - } |
|
107 | + } |
|
108 | 108 | |
109 | 109 | $newPositionStatus = $jodelAccountForView->location->getCityName(); |
110 | 110 | |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | { |
152 | 152 | $jodelAccountForKarma->votePostId($_GET['postId'], $_GET['vote']); |
153 | 153 | if(isset($_GET['getPostDetails']) && isset($_GET['getPostDetails'])) |
154 | - { |
|
155 | - header('Location: index.php?getPostDetails=true&postId=' . htmlspecialchars($_GET['postId_parent']) . '#postId-' . htmlspecialchars($_GET['postId'])); |
|
156 | - } |
|
157 | - else |
|
158 | - { |
|
159 | - header("Location: index.php#postId-" . htmlspecialchars($_GET['postId'])); |
|
160 | - } |
|
161 | - die(); |
|
154 | + { |
|
155 | + header('Location: index.php?getPostDetails=true&postId=' . htmlspecialchars($_GET['postId_parent']) . '#postId-' . htmlspecialchars($_GET['postId'])); |
|
156 | + } |
|
157 | + else |
|
158 | + { |
|
159 | + header("Location: index.php#postId-" . htmlspecialchars($_GET['postId'])); |
|
160 | + } |
|
161 | + die(); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | //SendJodel |
@@ -203,32 +203,32 @@ discard block |
||
203 | 203 | if(!array_key_exists(0, $posts)) |
204 | 204 | { |
205 | 205 | $posts[0] = array( |
206 | - "post_id" => "0", |
|
207 | - "discovered_by" => 0, |
|
208 | - "message" => "Not found", |
|
209 | - "created_at" => "2017-02-11T16:44:50.385Z", |
|
210 | - "updated_at" => "2017-02-11T16:44:50.385Z", |
|
211 | - "pin_count" => 0, |
|
212 | - "color" => "FFBA00", |
|
213 | - "got_thanks" => FALSE, |
|
214 | - "post_own" => "friend", |
|
215 | - "discovered" => 0, |
|
216 | - "distance" => 9, |
|
217 | - "vote_count" => 0, |
|
218 | - "location" => |
|
219 | - array("name" => "Berlin", |
|
220 | - "loc_coordinates" => |
|
221 | - array( |
|
222 | - "lat" => 0, |
|
223 | - "lng" => 0 |
|
224 | - ), |
|
225 | - "loc_accuracy" => 0, |
|
226 | - "country" => "", |
|
227 | - "city" => "", |
|
228 | - ), |
|
229 | - "tags" => |
|
230 | - array(), |
|
231 | - "user_handle" => "0" |
|
206 | + "post_id" => "0", |
|
207 | + "discovered_by" => 0, |
|
208 | + "message" => "Not found", |
|
209 | + "created_at" => "2017-02-11T16:44:50.385Z", |
|
210 | + "updated_at" => "2017-02-11T16:44:50.385Z", |
|
211 | + "pin_count" => 0, |
|
212 | + "color" => "FFBA00", |
|
213 | + "got_thanks" => FALSE, |
|
214 | + "post_own" => "friend", |
|
215 | + "discovered" => 0, |
|
216 | + "distance" => 9, |
|
217 | + "vote_count" => 0, |
|
218 | + "location" => |
|
219 | + array("name" => "Berlin", |
|
220 | + "loc_coordinates" => |
|
221 | + array( |
|
222 | + "lat" => 0, |
|
223 | + "lng" => 0 |
|
224 | + ), |
|
225 | + "loc_accuracy" => 0, |
|
226 | + "country" => "", |
|
227 | + "city" => "", |
|
228 | + ), |
|
229 | + "tags" => |
|
230 | + array(), |
|
231 | + "user_handle" => "0" |
|
232 | 232 | ); |
233 | 233 | } |
234 | 234 | } |
@@ -237,32 +237,32 @@ discard block |
||
237 | 237 | $posts = array(); |
238 | 238 | $posts[0] = |
239 | 239 | array( |
240 | - "post_id" => "0", |
|
241 | - "discovered_by" => 0, |
|
242 | - "message" => "Bad Request", |
|
243 | - "created_at" => "2017-02-11T16:44:50.385Z", |
|
244 | - "updated_at" => "2017-02-11T16:44:50.385Z", |
|
245 | - "pin_count" => 0, |
|
246 | - "color" => "FFBA00", |
|
247 | - "got_thanks" => FALSE, |
|
248 | - "post_own" => "friend", |
|
249 | - "discovered" => 0, |
|
250 | - "distance" => 9, |
|
251 | - "vote_count" => 0, |
|
252 | - "location" => |
|
253 | - array("name" => "Berlin", |
|
254 | - "loc_coordinates" => |
|
255 | - array( |
|
256 | - "lat" => 0, |
|
257 | - "lng" => 0 |
|
258 | - ), |
|
259 | - "loc_accuracy" => 0, |
|
260 | - "country" => "", |
|
261 | - "city" => "", |
|
262 | - ), |
|
263 | - "tags" => |
|
264 | - array(), |
|
265 | - "user_handle" => "0" |
|
240 | + "post_id" => "0", |
|
241 | + "discovered_by" => 0, |
|
242 | + "message" => "Bad Request", |
|
243 | + "created_at" => "2017-02-11T16:44:50.385Z", |
|
244 | + "updated_at" => "2017-02-11T16:44:50.385Z", |
|
245 | + "pin_count" => 0, |
|
246 | + "color" => "FFBA00", |
|
247 | + "got_thanks" => FALSE, |
|
248 | + "post_own" => "friend", |
|
249 | + "discovered" => 0, |
|
250 | + "distance" => 9, |
|
251 | + "vote_count" => 0, |
|
252 | + "location" => |
|
253 | + array("name" => "Berlin", |
|
254 | + "loc_coordinates" => |
|
255 | + array( |
|
256 | + "lat" => 0, |
|
257 | + "lng" => 0 |
|
258 | + ), |
|
259 | + "loc_accuracy" => 0, |
|
260 | + "country" => "", |
|
261 | + "city" => "", |
|
262 | + ), |
|
263 | + "tags" => |
|
264 | + array(), |
|
265 | + "user_handle" => "0" |
|
266 | 266 | ); |
267 | 267 | |
268 | 268 |