@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $load_query = false; |
89 | 89 | $show_lastsearchbutton = true; |
90 | 90 | |
91 | -$list_caches = isset($_REQUEST['addCache']) && $_REQUEST['addCache'] >= 1 ? $_REQUEST['addCache'] : ''; |
|
91 | +$list_caches = isset($_REQUEST['addCache']) && $_REQUEST['addCache'] >= 1 ? $_REQUEST['addCache'] : ''; |
|
92 | 92 | $added_waypoints = 0; |
93 | 93 | |
94 | 94 | if (isset($_REQUEST['queryid']) || isset($_REQUEST['showresult'])) { // Ocprop: showresult, queryid |
@@ -255,20 +255,20 @@ discard block |
||
255 | 255 | } |
256 | 256 | |
257 | 257 | // get the search options parameters and store them in the queries table (to view "the next page") |
258 | - $options['f_userowner'] = isset($_REQUEST['f_userowner']) ? (int) $_REQUEST['f_userowner'] : 0; // Ocprop |
|
259 | - $options['f_userfound'] = isset($_REQUEST['f_userfound']) ? (int) $_REQUEST['f_userfound'] : 0; // Ocprop |
|
260 | - $options['f_unpublished'] = isset($_REQUEST['f_unpublished']) ? (int) $_REQUEST['f_unpublished'] : 0; |
|
261 | - $options['f_disabled'] = isset($_REQUEST['f_disabled']) ? (int) $_REQUEST['f_disabled'] : 0; |
|
262 | - $options['f_inactive'] = isset($_REQUEST['f_inactive']) ? (int) $_REQUEST['f_inactive'] : 1; // Ocprop |
|
258 | + $options['f_userowner'] = isset($_REQUEST['f_userowner']) ? (int)$_REQUEST['f_userowner'] : 0; // Ocprop |
|
259 | + $options['f_userfound'] = isset($_REQUEST['f_userfound']) ? (int)$_REQUEST['f_userfound'] : 0; // Ocprop |
|
260 | + $options['f_unpublished'] = isset($_REQUEST['f_unpublished']) ? (int)$_REQUEST['f_unpublished'] : 0; |
|
261 | + $options['f_disabled'] = isset($_REQUEST['f_disabled']) ? (int)$_REQUEST['f_disabled'] : 0; |
|
262 | + $options['f_inactive'] = isset($_REQUEST['f_inactive']) ? (int)$_REQUEST['f_inactive'] : 1; // Ocprop |
|
263 | 263 | // f_inactive formerly was used for both, archived and disabled caches. |
264 | 264 | // After adding the separate f_disabled option, it is used only for archived |
265 | 265 | // caches, but keeps its name for compatibility with existing stored or |
266 | 266 | // external searches. |
267 | - $options['f_ignored'] = isset($_REQUEST['f_ignored']) ? (int) $_REQUEST['f_ignored'] : 1; |
|
268 | - $options['f_otherPlatforms'] = isset($_REQUEST['f_otherPlatforms']) ? (int) $_REQUEST['f_otherPlatforms'] : 0; |
|
269 | - $options['f_geokrets'] = isset($_REQUEST['f_geokrets']) ? (int) $_REQUEST['f_geokrets'] : 0; |
|
270 | - $options['expert'] = isset($_REQUEST['expert']) ? (int) $_REQUEST['expert'] : 0; // Ocprop: 0 |
|
271 | - $options['showresult'] = isset($_REQUEST['showresult']) ? (int) $_REQUEST['showresult'] : 0; |
|
267 | + $options['f_ignored'] = isset($_REQUEST['f_ignored']) ? (int)$_REQUEST['f_ignored'] : 1; |
|
268 | + $options['f_otherPlatforms'] = isset($_REQUEST['f_otherPlatforms']) ? (int)$_REQUEST['f_otherPlatforms'] : 0; |
|
269 | + $options['f_geokrets'] = isset($_REQUEST['f_geokrets']) ? (int)$_REQUEST['f_geokrets'] : 0; |
|
270 | + $options['expert'] = isset($_REQUEST['expert']) ? (int)$_REQUEST['expert'] : 0; // Ocprop: 0 |
|
271 | + $options['showresult'] = isset($_REQUEST['showresult']) ? (int)$_REQUEST['showresult'] : 0; |
|
272 | 272 | $options['output'] = isset($_REQUEST['output']) ? $_REQUEST['output'] : 'HTML'; // Ocprop: HTML |
273 | 273 | $options['bbox'] = isset($_REQUEST['bbox']) ? $_REQUEST['bbox'] : false; |
274 | 274 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } elseif (isset($_REQUEST['searchbyowner'])) { // Ocprop |
323 | 323 | $options['searchtype'] = 'byowner'; |
324 | 324 | |
325 | - $options['ownerid'] = isset($_REQUEST['ownerid']) ? (int) $_REQUEST['ownerid'] : 0; |
|
325 | + $options['ownerid'] = isset($_REQUEST['ownerid']) ? (int)$_REQUEST['ownerid'] : 0; |
|
326 | 326 | $options['owner'] = isset($_REQUEST['owner']) ? stripslashes($_REQUEST['owner']) : ''; |
327 | 327 | |
328 | 328 | if (isset($options['owner'])) { |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | } elseif (isset($_REQUEST['searchbyfinder'])) { // Ocprop |
339 | 339 | $options['searchtype'] = 'byfinder'; |
340 | 340 | |
341 | - $options['finderid'] = isset($_REQUEST['finderid']) ? (int) $_REQUEST['finderid'] : 0; |
|
341 | + $options['finderid'] = isset($_REQUEST['finderid']) ? (int)$_REQUEST['finderid'] : 0; |
|
342 | 342 | $options['finder'] = isset($_REQUEST['finder']) ? stripslashes($_REQUEST['finder']) : ''; |
343 | 343 | $options['logtype'] = isset($_REQUEST['logtype']) ? $_REQUEST['logtype'] : '1,7'; // Ocprop |
344 | 344 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $options['lon_min'] = isset($_REQUEST['lon_min']) ? $_REQUEST['lon_min'] : 0; |
394 | 394 | } |
395 | 395 | |
396 | - $options['distance'] = isset($_REQUEST['distance']) ? (int) $_REQUEST['distance'] : 0; |
|
396 | + $options['distance'] = isset($_REQUEST['distance']) ? (int)$_REQUEST['distance'] : 0; |
|
397 | 397 | } elseif (isset($_REQUEST['searchbyfulltext'])) { |
398 | 398 | $options['searchtype'] = 'byfulltext'; |
399 | 399 | |
@@ -460,11 +460,11 @@ discard block |
||
460 | 460 | $options['cachetype'] = isset($_REQUEST['cachetype']) ? $_REQUEST['cachetype'] : ''; |
461 | 461 | |
462 | 462 | $options['cachesize'] = isset($_REQUEST['cachesize']) ? $_REQUEST['cachesize'] : ''; |
463 | - $options['difficultymin'] = isset($_REQUEST['difficultymin']) ? (int) $_REQUEST['difficultymin'] : 0; |
|
464 | - $options['difficultymax'] = isset($_REQUEST['difficultymax']) ? (int) $_REQUEST['difficultymax'] : 0; |
|
465 | - $options['terrainmin'] = isset($_REQUEST['terrainmin']) ? (int) $_REQUEST['terrainmin'] : 0; |
|
466 | - $options['terrainmax'] = isset($_REQUEST['terrainmax']) ? (int) $_REQUEST['terrainmax'] : 0; |
|
467 | - $options['recommendationmin'] = isset($_REQUEST['recommendationmin']) ? (int) $_REQUEST['recommendationmin'] : 0; |
|
463 | + $options['difficultymin'] = isset($_REQUEST['difficultymin']) ? (int)$_REQUEST['difficultymin'] : 0; |
|
464 | + $options['difficultymax'] = isset($_REQUEST['difficultymax']) ? (int)$_REQUEST['difficultymax'] : 0; |
|
465 | + $options['terrainmin'] = isset($_REQUEST['terrainmin']) ? (int)$_REQUEST['terrainmin'] : 0; |
|
466 | + $options['terrainmax'] = isset($_REQUEST['terrainmax']) ? (int)$_REQUEST['terrainmax'] : 0; |
|
467 | + $options['recommendationmin'] = isset($_REQUEST['recommendationmin']) ? (int)$_REQUEST['recommendationmin'] : 0; |
|
468 | 468 | |
469 | 469 | if (in_array($options['searchtype'], ['byort', 'byplz', 'bydistance', 'bywaypoint'])) { |
470 | 470 | // For distance-based searches, sort by distance instead of name. |
@@ -1297,11 +1297,11 @@ discard block |
||
1297 | 1297 | |
1298 | 1298 | //add selected caches to selected cachelist |
1299 | 1299 | if (isset($_REQUEST['addToList']) && isset($_REQUEST['addCache']) && isset($_REQUEST['selectCachelist'])) { |
1300 | - $list_caches_= $_REQUEST['addToList']; |
|
1300 | + $list_caches_ = $_REQUEST['addToList']; |
|
1301 | 1301 | $added_waypoints = addToList($list_caches); |
1302 | - $addCachelist= cachelist::getListById((int) $_REQUEST['selectCachelist']); // null for invalid ID |
|
1302 | + $addCachelist = cachelist::getListById((int)$_REQUEST['selectCachelist']); // null for invalid ID |
|
1303 | 1303 | } elseif (isset($_REQUEST['addToList'])) { |
1304 | - $addCachelist= cachelist::getListById((int) $_REQUEST['selectCachelist']); // null for invalid ID |
|
1304 | + $addCachelist = cachelist::getListById((int)$_REQUEST['selectCachelist']); // null for invalid ID |
|
1305 | 1305 | $error_addCaches = true; |
1306 | 1306 | } |
1307 | 1307 | |
@@ -1773,7 +1773,7 @@ discard block |
||
1773 | 1773 | $tpl->assign('searchtype_byname', $options['searchtype'] == 'byname'); |
1774 | 1774 | |
1775 | 1775 | // distance |
1776 | - $tpl->assign('distance', isset($options['distance']) ? (int) $options['distance'] : DEFAULT_SEARCH_DISTANCE); |
|
1776 | + $tpl->assign('distance', isset($options['distance']) ? (int)$options['distance'] : DEFAULT_SEARCH_DISTANCE); |
|
1777 | 1777 | |
1778 | 1778 | if (!isset($options['unit'])) { |
1779 | 1779 | $options['unit'] = DEFAULT_DISTANCE_UNIT; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | Request::setTrustedHosts([$trustedHosts]); |
30 | 30 | } |
31 | 31 | |
32 | -$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); |
|
32 | +$kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']); |
|
33 | 33 | $request = Request::createFromGlobals(); |
34 | 34 | $response = $kernel->handle($request); |
35 | 35 | $response->send(); |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | /** @var Connection $connection */ |
25 | 25 | $connection = AppKernel::Container()->get(Connection::class); |
26 | 26 | |
27 | -$id = (int) isset($_REQUEST['id']) ? $_REQUEST['id'] : 0; |
|
28 | -$rId = (int) isset($_REQUEST['rid']) ? $_REQUEST['rid'] : 0; |
|
29 | -$cacheId = (int) isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0; |
|
30 | -$ownerId = (int) isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0; |
|
27 | +$id = (int)isset($_REQUEST['id']) ? $_REQUEST['id'] : 0; |
|
28 | +$rId = (int)isset($_REQUEST['rid']) ? $_REQUEST['rid'] : 0; |
|
29 | +$cacheId = (int)isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0; |
|
30 | +$ownerId = (int)isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0; |
|
31 | 31 | |
32 | 32 | $reportData = $connection |
33 | 33 | ->fetchAssociative( |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | ['id' => $rId] |
38 | 38 | ); |
39 | 39 | |
40 | -$reporterId = (int) $reportData['userid']; |
|
41 | -$adminId = (int) $reportData['adminid']; |
|
40 | +$reporterId = (int)$reportData['userid']; |
|
41 | +$adminId = (int)$reportData['adminid']; |
|
42 | 42 | $age = $reportData['age']; |
43 | 43 | |
44 | 44 | if (isset($_REQUEST['savecomment'])) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ); |
38 | 38 | if ($r) { |
39 | 39 | if ($r['object_type'] == 1) { |
40 | - $check = (int) $connection |
|
40 | + $check = (int)$connection |
|
41 | 41 | ->fetchOne( |
42 | 42 | 'SELECT COUNT(*) |
43 | 43 | FROM `cache_logs` |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | } |
64 | 64 | } elseif ($r['object_type'] == 2) { |
65 | - $check = (int) $connection |
|
65 | + $check = (int)$connection |
|
66 | 66 | ->fetchOne( |
67 | 67 | 'SELECT COUNT(*) |
68 | 68 | FROM `caches` |
@@ -166,22 +166,22 @@ |
||
166 | 166 | |
167 | 167 | $tpl->assign('showdetails', true); |
168 | 168 | |
169 | - $r['hidden'] = (int) $connection->fetchOne( |
|
169 | + $r['hidden'] = (int)$connection->fetchOne( |
|
170 | 170 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`=:userId', ['userId' => $r['user_id']] |
171 | 171 | ); |
172 | - $r['hidden_active'] = (int) $connection->fetchOne( |
|
172 | + $r['hidden_active'] = (int)$connection->fetchOne( |
|
173 | 173 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`= :userId AND `status`=1', |
174 | 174 | ['userId' => $r['user_id']] |
175 | 175 | ); |
176 | - $r['logentries'] = (int) $connection->fetchOne( |
|
176 | + $r['logentries'] = (int)$connection->fetchOne( |
|
177 | 177 | 'SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`= :userId', |
178 | 178 | ['userId' => $r['user_id']] |
179 | 179 | ); |
180 | - $r['deleted_logentries'] = (int) $connection->fetchOne( |
|
180 | + $r['deleted_logentries'] = (int)$connection->fetchOne( |
|
181 | 181 | 'SELECT COUNT(*) FROM `cache_logs_archived` WHERE `user_id`= :userId', |
182 | 182 | ['userId' => $r['user_id']] |
183 | 183 | ); |
184 | - $r['reports'] = (int) $connection->fetchOne( |
|
184 | + $r['reports'] = (int)$connection->fetchOne( |
|
185 | 185 | 'SELECT COUNT(*) FROM `cache_reports` WHERE `userid`= :userId', |
186 | 186 | ['userId' => $r['user_id']] |
187 | 187 | ); |
@@ -28,14 +28,14 @@ |
||
28 | 28 | ['wp' => $_REQUEST['wp']] |
29 | 29 | ); |
30 | 30 | } else { |
31 | - $cacheId = isset($_REQUEST['cacheid']) ? (int) $_REQUEST['cacheid'] : -1; |
|
31 | + $cacheId = isset($_REQUEST['cacheid']) ? (int)$_REQUEST['cacheid'] : -1; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $showHistory = false; |
35 | 35 | $error = ''; |
36 | 36 | |
37 | 37 | if ($cacheId >= 0 && |
38 | - $connection->fetchOne('SELECT COUNT(*) FROM `caches` WHERE `cache_id`=:id',['id' => $cacheId]) <> 1) |
|
38 | + $connection->fetchOne('SELECT COUNT(*) FROM `caches` WHERE `cache_id`=:id', ['id' => $cacheId]) <> 1) |
|
39 | 39 | { |
40 | 40 | $error = $translate->t('Cache not found', '', '', 0); |
41 | 41 | } elseif ($cacheId > 0) { |
@@ -13,10 +13,10 @@ |
||
13 | 13 | $tpl->name = 'usertops'; |
14 | 14 | $tpl->menuitem = MNU_CACHES_USERTOPS; |
15 | 15 | |
16 | -$userId = (int) isset($_REQUEST['userid']) ? $_REQUEST['userid']: 0; |
|
16 | +$userId = (int)isset($_REQUEST['userid']) ? $_REQUEST['userid'] : 0; |
|
17 | 17 | $ocOnly = isset($_REQUEST['oconly']) && $_REQUEST['oconly']; |
18 | 18 | |
19 | -$sUsername = $connection->fetchOne('SELECT `username` FROM `user` WHERE `user_id` = :userId',['userId' => $userId]); |
|
19 | +$sUsername = $connection->fetchOne('SELECT `username` FROM `user` WHERE `user_id` = :userId', ['userId' => $userId]); |
|
20 | 20 | if ($sUsername == null) { |
21 | 21 | $tpl->error(ERROR_USER_NOT_EXISTS); |
22 | 22 | } |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | // current cache and log-counters |
76 | 76 | $tpl->assign( |
77 | 77 | 'count_hiddens', |
78 | - number1000((int) $connection->fetchOne('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status` = 1')) |
|
78 | + number1000((int)$connection->fetchOne('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status` = 1')) |
|
79 | 79 | ); |
80 | 80 | $tpl->assign( |
81 | 81 | 'count_founds', |
82 | - number1000((int) $connection->fetchOne('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type` = 1')) |
|
82 | + number1000((int)$connection->fetchOne('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type` = 1')) |
|
83 | 83 | ); |
84 | 84 | $tpl->assign( |
85 | 85 | 'count_users', |
86 | 86 | number1000( |
87 | - (int) $connection->fetchOne( |
|
87 | + (int)$connection->fetchOne( |
|
88 | 88 | 'SELECT COUNT(*) AS `users` |
89 | 89 | FROM ( |
90 | 90 | SELECT DISTINCT `user_id` |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | // get total event count for all countries |
103 | 103 | $tpl->assign( |
104 | 104 | 'total_events', |
105 | - (int) $connection->fetchOne( |
|
105 | + (int)$connection->fetchOne( |
|
106 | 106 | 'SELECT COUNT(*) |
107 | 107 | FROM `caches` |
108 | 108 | WHERE `type` = 6 |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | WHERE cache_id = :cacheId; |
228 | 228 | SQL |
229 | 229 | , [ |
230 | - 'cacheId' => (int) $cache['cache_id'], |
|
230 | + 'cacheId' => (int)$cache['cache_id'], |
|
231 | 231 | ]); |
232 | 232 | |
233 | 233 | $this->connection->executeQuery(<<<'SQL' |
@@ -239,19 +239,19 @@ discard block |
||
239 | 239 | WHERE cache_id = :cacheId |
240 | 240 | SQL |
241 | 241 | , [ |
242 | - 'cacheId' => (int) $cache['cache_id'], |
|
242 | + 'cacheId' => (int)$cache['cache_id'], |
|
243 | 243 | ]); |
244 | 244 | |
245 | 245 | $this->connection->executeQuery('DELETE FROM cache_desc_modified WHERE cache_id = :cacheId', [ |
246 | - 'cacheId' => (int) $cache['cache_id'], |
|
246 | + 'cacheId' => (int)$cache['cache_id'], |
|
247 | 247 | ]); |
248 | 248 | |
249 | 249 | $this->connection->executeQuery('DELETE FROM cache_ignore WHERE cache_id = :cacheId', [ |
250 | - 'cacheId' => (int) $cache['cache_id'], |
|
250 | + 'cacheId' => (int)$cache['cache_id'], |
|
251 | 251 | ]); |
252 | 252 | |
253 | 253 | $this->connection->executeQuery('DELETE FROM caches_modified WHERE cache_id = :cacheId', [ |
254 | - 'cacheId' => (int) $cache['cache_id'], |
|
254 | + 'cacheId' => (int)$cache['cache_id'], |
|
255 | 255 | ]); |
256 | 256 | } |
257 | 257 | } |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | return []; |
266 | 266 | } |
267 | 267 | |
268 | - $ids = array_map(static function (array $cache) use ($idField) { |
|
269 | - return (int) $cache[$idField]; |
|
268 | + $ids = array_map(static function(array $cache) use ($idField) { |
|
269 | + return (int)$cache[$idField]; |
|
270 | 270 | }, $data); |
271 | 271 | |
272 | 272 | $pictures = $this->connection->fetchAllAssociative('SELECT * FROM pictures WHERE object_id IN (' . implode(',', $ids) . ') AND object_type = :objectType', [ |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | return []; |
287 | 287 | } |
288 | 288 | |
289 | - $ids = array_map(static function (array $cache) use ($idField) { |
|
290 | - return (int) $cache[$idField]; |
|
289 | + $ids = array_map(static function(array $cache) use ($idField) { |
|
290 | + return (int)$cache[$idField]; |
|
291 | 291 | }, $data); |
292 | 292 | |
293 | 293 | return $this->connection->fetchAllAssociative('SELECT * FROM pictures_modified WHERE object_id IN (' . implode(',', $ids) . ') AND object_type = :objectType', [ |