@@ -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', [ |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | private function ocOnly81_get_matrixData() |
| 62 | 62 | : array |
| 63 | 63 | { |
| 64 | - for ($i = 0; $i <= 8; $i ++) { |
|
| 65 | - for ($j = 0; $j <= 8; $j ++) { |
|
| 64 | + for ($i = 0; $i <= 8; $i++) { |
|
| 65 | + for ($j = 0; $j <= 8; $j++) { |
|
| 66 | 66 | $matrix[$i][$j] = 0; |
| 67 | 67 | $dsum[$i] = 0; |
| 68 | 68 | $tsum[$i] = 0; |
@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | $data = $qb->executeQuery()->fetchAllAssociative(); |
| 80 | 80 | |
| 81 | 81 | foreach ($data as $item) { |
| 82 | - $matrix[$item['difficulty'] - 2][$item['terrain'] - 2] ++; |
|
| 82 | + $matrix[$item['difficulty'] - 2][$item['terrain'] - 2]++; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - for ($i = 0; $i <= 8; $i ++) { |
|
| 85 | + for ($i = 0; $i <= 8; $i++) { |
|
| 86 | 86 | $dsum[$i] = $dsum[$i] + array_sum($matrix[$i]); |
| 87 | 87 | $tsum[$i] = $tsum[$i] + array_sum(array_column($matrix, $i)); |
| 88 | 88 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | 'count' => 1 |
| 124 | 124 | ]; |
| 125 | 125 | } else { |
| 126 | - $result[$item['user_id']]['count'] ++; |
|
| 126 | + $result[$item['user_id']]['count']++; |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |