@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | // Include & load the variables |
| 11 | 11 | // ############################ |
| 12 | 12 | |
| 13 | -$variables = SYS_PATH.'/core/json/variables.json'; |
|
| 14 | -$config = json_decode(file_get_contents($variables)); |
|
| 13 | +$variables = SYS_PATH.'/core/json/variables.json'; |
|
| 14 | +$config = json_decode(file_get_contents($variables)); |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | // Include & load locales (because it's REALLY REALLY REALLY IMPORTANT TO HAVE A FULLY TRANSLATE DASHBOARD ) |
@@ -24,20 +24,20 @@ discard block |
||
| 24 | 24 | // Check if there's a pokemon stat file |
| 25 | 25 | // #################################### |
| 26 | 26 | |
| 27 | -$stats_file = SYS_PATH.'/core/json/pokemon.stats.json'; |
|
| 28 | -$stats = json_decode(file_get_contents($stats_file)); |
|
| 27 | +$stats_file = SYS_PATH.'/core/json/pokemon.stats.json'; |
|
| 28 | +$stats = json_decode(file_get_contents($stats_file)); |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | -$now = time(); |
|
| 32 | -$yesterday = $now-86400; |
|
| 33 | -$lastweek = $now-604800; |
|
| 31 | +$now = time(); |
|
| 32 | +$yesterday = $now - 86400; |
|
| 33 | +$lastweek = $now - 604800; |
|
| 34 | 34 | |
| 35 | -$i=0; |
|
| 35 | +$i = 0; |
|
| 36 | 36 | |
| 37 | 37 | foreach ($stats as $data) { |
| 38 | 38 | if ($data->timestamp > $lastweek) { |
| 39 | - $labels_global[] = '"'.date('D H:i', $data->timestamp).'"'; |
|
| 40 | - $total[] = $data->pokemon_now; |
|
| 39 | + $labels_global[] = '"'.date('D H:i', $data->timestamp).'"'; |
|
| 40 | + $total[] = $data->pokemon_now; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if ($data->timestamp > $yesterday) { |
@@ -78,47 +78,47 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | -$stats_file = SYS_PATH.'/core/json/gym.stats.json'; |
|
| 82 | -$stats = json_decode(file_get_contents($stats_file)); |
|
| 81 | +$stats_file = SYS_PATH.'/core/json/gym.stats.json'; |
|
| 82 | +$stats = json_decode(file_get_contents($stats_file)); |
|
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | foreach ($stats as $data) { |
| 86 | 86 | if ($data->timestamp > $yesterday) { |
| 87 | - $labels_gym[] = '"'.date('H:i', $data->timestamp).'"'; |
|
| 87 | + $labels_gym[] = '"'.date('H:i', $data->timestamp).'"'; |
|
| 88 | 88 | |
| 89 | - $mystic_average[] = $data->team->mystic->average; |
|
| 89 | + $mystic_average[] = $data->team->mystic->average; |
|
| 90 | 90 | $mystic_owned[] = $data->team->mystic->gym_owned; |
| 91 | 91 | |
| 92 | 92 | $valor_average[] = $data->team->valor->average; |
| 93 | - $valor_owned[] = $data->team->valor->gym_owned; |
|
| 93 | + $valor_owned[] = $data->team->valor->gym_owned; |
|
| 94 | 94 | |
| 95 | - $instinct_average[] = $data->team->instinct->average; |
|
| 96 | - $instinct_owned[] = $data->team->instinct->gym_owned; |
|
| 95 | + $instinct_average[] = $data->team->instinct->average; |
|
| 96 | + $instinct_owned[] = $data->team->instinct->gym_owned; |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | -$stats_file = SYS_PATH.'/core/json/pokestop.stats.json'; |
|
| 102 | -$stats = json_decode(file_get_contents($stats_file)); |
|
| 101 | +$stats_file = SYS_PATH.'/core/json/pokestop.stats.json'; |
|
| 102 | +$stats = json_decode(file_get_contents($stats_file)); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | foreach ($stats as $data) { |
| 106 | 106 | if ($data->timestamp > $lastweek) { |
| 107 | - $labels_stops[] = '"'.date('D H:i', $data->timestamp).'"'; |
|
| 108 | - $lure[] = $data->lured; |
|
| 107 | + $labels_stops[] = '"'.date('D H:i', $data->timestamp).'"'; |
|
| 108 | + $lure[] = $data->lured; |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | if ($config->system->captcha_support) { |
| 114 | - $stats_file = SYS_PATH.'/core/json/captcha.stats.json'; |
|
| 115 | - $stats = json_decode(file_get_contents($stats_file)); |
|
| 114 | + $stats_file = SYS_PATH.'/core/json/captcha.stats.json'; |
|
| 115 | + $stats = json_decode(file_get_contents($stats_file)); |
|
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | foreach ($stats as $data) { |
| 119 | 119 | if ($data->timestamp > $lastweek) { |
| 120 | - $labels_captcha[] = '"'.date('D H:i', $data->timestamp).'"'; |
|
| 121 | - $captcha_accs[] = $data->captcha_accs; |
|
| 120 | + $labels_captcha[] = '"'.date('D H:i', $data->timestamp).'"'; |
|
| 121 | + $captcha_accs[] = $data->captcha_accs; |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | } |
@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | // Include & load the variables |
| 11 | 11 | // ############################ |
| 12 | 12 | |
| 13 | -$variables = SYS_PATH.'/core/json/variables.json'; |
|
| 14 | -$config = json_decode(file_get_contents($variables)); |
|
| 13 | +$variables = SYS_PATH.'/core/json/variables.json'; |
|
| 14 | +$config = json_decode(file_get_contents($variables)); |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | # Connect MySQL |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $trainer_lvl = []; |
| 26 | 26 | # For all 3 teams |
| 27 | 27 | for ($teamid = 1; $teamid <= 3; $teamid++) { |
| 28 | - $req = "SELECT level, count(level) AS count FROM trainer WHERE team = '".$teamid."' GROUP BY level"; |
|
| 28 | + $req = "SELECT level, count(level) AS count FROM trainer WHERE team = '".$teamid."' GROUP BY level"; |
|
| 29 | 29 | if ($result = $mysqli->query($req)) { |
| 30 | 30 | # build level=>count array |
| 31 | 31 | $data = []; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | # fill empty levels counts with 0 |
| 39 | 39 | for ($i = 5; $i <= 40; $i++) { |
| 40 | 40 | if (!isset($data[$i])) { |
| 41 | - $data[$i]=0; |
|
| 41 | + $data[$i] = 0; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | # sort array again |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | // Include & load the variables |
| 4 | 4 | // ############################ |
| 5 | 5 | |
| 6 | -$variables = SYS_PATH.'/core/json/variables.json'; |
|
| 7 | -$config = json_decode(file_get_contents($variables)); |
|
| 6 | +$variables = SYS_PATH.'/core/json/variables.json'; |
|
| 7 | +$config = json_decode(file_get_contents($variables)); |
|
| 8 | 8 | |
| 9 | 9 | if (!isset($config->system)) { |
| 10 | 10 | echo 'Could not load variables.'; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | ################# |
| 32 | 32 | |
| 33 | 33 | |
| 34 | -$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT); |
|
| 34 | +$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT); |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | if ($mysqli->connect_error != '') { |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | // ( for Brusselopole we use CRONTAB but as we're not sure that every had access to it we build this really simple false crontab system |
| 89 | 89 | // => check filemtime, if > 24h launch an update. ) |
| 90 | 90 | |
| 91 | -$pokedex_rarity_filetime = filemtime($pokedex_rarity_file); |
|
| 92 | -$now = time(); |
|
| 93 | -$diff = $now - $pokedex_rarity_filetime; |
|
| 91 | +$pokedex_rarity_filetime = filemtime($pokedex_rarity_file); |
|
| 92 | +$now = time(); |
|
| 93 | +$diff = $now - $pokedex_rarity_filetime; |
|
| 94 | 94 | |
| 95 | 95 | // Update each 24h |
| 96 | -$update_delay = 86400; |
|
| 96 | +$update_delay = 86400; |
|
| 97 | 97 | |
| 98 | 98 | if ($diff > $update_delay) { |
| 99 | 99 | include_once(SYS_PATH.'/core/cron/pokemon.rarity.php'); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | // --------------------- |
| 125 | 125 | |
| 126 | 126 | |
| 127 | - $pokemon_id = mysqli_real_escape_string($mysqli, $_GET['id']); |
|
| 127 | + $pokemon_id = mysqli_real_escape_string($mysqli, $_GET['id']); |
|
| 128 | 128 | |
| 129 | 129 | if (!is_object($pokemons->pokemon->$pokemon_id)) { |
| 130 | 130 | header('Location:/404'); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | $pokemon = new stdClass(); |
| 136 | 136 | $pokemon = $pokemons->pokemon->$pokemon_id; |
| 137 | - $pokemon->id = $pokemon_id; |
|
| 137 | + $pokemon->id = $pokemon_id; |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | |
@@ -152,54 +152,54 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | // Total gym protected |
| 154 | 154 | |
| 155 | - $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE guard_pokemon_id = '".$pokemon_id."' "; |
|
| 156 | - $result = $mysqli->query($req); |
|
| 157 | - $data = $result->fetch_object(); |
|
| 155 | + $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE guard_pokemon_id = '".$pokemon_id."' "; |
|
| 156 | + $result = $mysqli->query($req); |
|
| 157 | + $data = $result->fetch_object(); |
|
| 158 | 158 | |
| 159 | 159 | $pokemon->protected_gyms = $data->total; |
| 160 | 160 | |
| 161 | 161 | |
| 162 | 162 | // Total spawn |
| 163 | 163 | |
| 164 | - $req = "SELECT COUNT(*) as total FROM pokemon WHERE pokemon_id = '".$pokemon_id."'"; |
|
| 165 | - $result = $mysqli->query($req); |
|
| 166 | - $data = $result->fetch_object(); |
|
| 164 | + $req = "SELECT COUNT(*) as total FROM pokemon WHERE pokemon_id = '".$pokemon_id."'"; |
|
| 165 | + $result = $mysqli->query($req); |
|
| 166 | + $data = $result->fetch_object(); |
|
| 167 | 167 | |
| 168 | - $pokemon->total_spawn = $data->total; |
|
| 168 | + $pokemon->total_spawn = $data->total; |
|
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | // Spawn rate |
| 172 | 172 | |
| 173 | 173 | if ($pokemon->total_spawn > 0) { |
| 174 | 174 | $req = "SELECT COUNT(DISTINCT DATE(disappear_time)) as total FROM pokemon"; |
| 175 | - $result = $mysqli->query($req); |
|
| 175 | + $result = $mysqli->query($req); |
|
| 176 | 176 | $data = $result->fetch_object(); |
| 177 | 177 | |
| 178 | 178 | $pokemon->total_days = $data->total; |
| 179 | - $pokemon->spawn_rate = round(($pokemon->total_spawn/$pokemon->total_days), 2); |
|
| 179 | + $pokemon->spawn_rate = round(($pokemon->total_spawn / $pokemon->total_days), 2); |
|
| 180 | 180 | } else { |
| 181 | 181 | $pokemon->total_days = 0; |
| 182 | - $pokemon->spawn_rate = 0; |
|
| 182 | + $pokemon->spawn_rate = 0; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | // Last seen |
| 187 | 187 | |
| 188 | - $req = "SELECT disappear_time, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude |
|
| 188 | + $req = "SELECT disappear_time, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude |
|
| 189 | 189 | FROM pokemon |
| 190 | 190 | WHERE pokemon_id = '".$pokemon_id."' |
| 191 | 191 | ORDER BY disappear_time DESC |
| 192 | 192 | LIMIT 0,1"; |
| 193 | - $result = $mysqli->query($req); |
|
| 194 | - $data = $result->fetch_object(); |
|
| 193 | + $result = $mysqli->query($req); |
|
| 194 | + $data = $result->fetch_object(); |
|
| 195 | 195 | |
| 196 | 196 | if (isset($data)) { |
| 197 | - $last_spawn = $data; |
|
| 197 | + $last_spawn = $data; |
|
| 198 | 198 | |
| 199 | - $pokemon->last_seen = strtotime($data->disappear_time_real); |
|
| 200 | - $pokemon->last_position = new stdClass(); |
|
| 201 | - $pokemon->last_position->latitude = $data->latitude; |
|
| 202 | - $pokemon->last_position->longitude = $data->longitude; |
|
| 199 | + $pokemon->last_seen = strtotime($data->disappear_time_real); |
|
| 200 | + $pokemon->last_position = new stdClass(); |
|
| 201 | + $pokemon->last_position->latitude = $data->latitude; |
|
| 202 | + $pokemon->last_position->longitude = $data->longitude; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
@@ -237,23 +237,23 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | |
| 239 | 239 | $max = $config->system->max_pokemon; |
| 240 | - $pokedex = new stdClass(); |
|
| 240 | + $pokedex = new stdClass(); |
|
| 241 | 241 | |
| 242 | 242 | $req = "SELECT COUNT(*) as total,pokemon_id FROM pokemon GROUP by pokemon_id "; |
| 243 | - $result = $mysqli->query($req); |
|
| 243 | + $result = $mysqli->query($req); |
|
| 244 | 244 | $data_array = array(); |
| 245 | 245 | |
| 246 | 246 | while ($data = $result->fetch_object()) { |
| 247 | 247 | $data_array[$data->pokemon_id] = $data->total; |
| 248 | 248 | }; |
| 249 | 249 | |
| 250 | - for ($i= 1; $i <= $max; $i++) { |
|
| 251 | - $pokedex->$i = new stdClass(); |
|
| 250 | + for ($i = 1; $i <= $max; $i++) { |
|
| 251 | + $pokedex->$i = new stdClass(); |
|
| 252 | 252 | $pokedex->$i->id = $i; |
| 253 | - $pokedex->$i->permalink = 'pokemon/'.$i; |
|
| 253 | + $pokedex->$i->permalink = 'pokemon/'.$i; |
|
| 254 | 254 | $pokedex->$i->img = 'core/pokemons/'.$i.'.png'; |
| 255 | - $pokedex->$i->name = $pokemons->pokemon->$i->name; |
|
| 256 | - $pokedex->$i->spawn = isset($data_array[$i])? $data_array[$i] : 0; |
|
| 255 | + $pokedex->$i->name = $pokemons->pokemon->$i->name; |
|
| 256 | + $pokedex->$i->spawn = isset($data_array[$i]) ? $data_array[$i] : 0; |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
@@ -264,17 +264,17 @@ discard block |
||
| 264 | 264 | ############ |
| 265 | 265 | |
| 266 | 266 | case 'pokestops': |
| 267 | - $pokestop = new stdClass(); |
|
| 267 | + $pokestop = new stdClass(); |
|
| 268 | 268 | |
| 269 | - $req = "SELECT COUNT(*) as total FROM pokestop"; |
|
| 270 | - $result = $mysqli->query($req); |
|
| 271 | - $data = $result->fetch_object(); |
|
| 269 | + $req = "SELECT COUNT(*) as total FROM pokestop"; |
|
| 270 | + $result = $mysqli->query($req); |
|
| 271 | + $data = $result->fetch_object(); |
|
| 272 | 272 | |
| 273 | 273 | $pokestop->total = $data->total; |
| 274 | 274 | |
| 275 | - $req = "SELECT COUNT(*) as total FROM pokestop WHERE lure_expiration >= UTC_TIMESTAMP()"; |
|
| 276 | - $result = $mysqli->query($req); |
|
| 277 | - $data = $result->fetch_object(); |
|
| 275 | + $req = "SELECT COUNT(*) as total FROM pokestop WHERE lure_expiration >= UTC_TIMESTAMP()"; |
|
| 276 | + $result = $mysqli->query($req); |
|
| 277 | + $data = $result->fetch_object(); |
|
| 278 | 278 | |
| 279 | 279 | $pokestop->lured = $data->total; |
| 280 | 280 | |
@@ -291,36 +291,36 @@ discard block |
||
| 291 | 291 | // 3 Teams (teamm rocket is neutral) |
| 292 | 292 | // 1 Fight |
| 293 | 293 | |
| 294 | - $teams = new stdClass(); |
|
| 294 | + $teams = new stdClass(); |
|
| 295 | 295 | |
| 296 | - $teams->mystic = new stdClass(); |
|
| 297 | - $teams->mystic->guardians = new stdClass(); |
|
| 298 | - $teams->mystic->id = 1; |
|
| 296 | + $teams->mystic = new stdClass(); |
|
| 297 | + $teams->mystic->guardians = new stdClass(); |
|
| 298 | + $teams->mystic->id = 1; |
|
| 299 | 299 | |
| 300 | - $teams->valor = new stdClass(); |
|
| 301 | - $teams->valor->guardians = new stdClass(); |
|
| 302 | - $teams->valor->id = 2; |
|
| 300 | + $teams->valor = new stdClass(); |
|
| 301 | + $teams->valor->guardians = new stdClass(); |
|
| 302 | + $teams->valor->id = 2; |
|
| 303 | 303 | |
| 304 | - $teams->instinct = new stdClass(); |
|
| 305 | - $teams->instinct->guardians = new stdClass(); |
|
| 306 | - $teams->instinct->id = 3; |
|
| 304 | + $teams->instinct = new stdClass(); |
|
| 305 | + $teams->instinct->guardians = new stdClass(); |
|
| 306 | + $teams->instinct->id = 3; |
|
| 307 | 307 | |
| 308 | - $teams->rocket = new stdClass(); |
|
| 309 | - $teams->rocket->guardians = new stdClass(); |
|
| 310 | - $teams->rocket->id = 0; |
|
| 308 | + $teams->rocket = new stdClass(); |
|
| 309 | + $teams->rocket->guardians = new stdClass(); |
|
| 310 | + $teams->rocket->id = 0; |
|
| 311 | 311 | |
| 312 | 312 | |
| 313 | 313 | |
| 314 | 314 | foreach ($teams as $team_key => $team_values) { |
| 315 | 315 | // Team Guardians |
| 316 | 316 | |
| 317 | - $req = "SELECT COUNT(*) as total, guard_pokemon_id FROM gym WHERE team_id = '".$team_values->id."' GROUP BY guard_pokemon_id ORDER BY total DESC LIMIT 0,3 "; |
|
| 317 | + $req = "SELECT COUNT(*) as total, guard_pokemon_id FROM gym WHERE team_id = '".$team_values->id."' GROUP BY guard_pokemon_id ORDER BY total DESC LIMIT 0,3 "; |
|
| 318 | 318 | $result = $mysqli->query($req); |
| 319 | 319 | |
| 320 | - $i=0; |
|
| 320 | + $i = 0; |
|
| 321 | 321 | |
| 322 | 322 | while ($data = $result->fetch_object()) { |
| 323 | - $teams->$team_key->guardians->$i = $data->guard_pokemon_id; |
|
| 323 | + $teams->$team_key->guardians->$i = $data->guard_pokemon_id; |
|
| 324 | 324 | |
| 325 | 325 | $i++; |
| 326 | 326 | } |
@@ -332,8 +332,8 @@ discard block |
||
| 332 | 332 | $result = $mysqli->query($req); |
| 333 | 333 | $data = $result->fetch_object(); |
| 334 | 334 | |
| 335 | - $teams->$team_key->gym_owned = $data->total; |
|
| 336 | - $teams->$team_key->average = $data->average_points; |
|
| 335 | + $teams->$team_key->gym_owned = $data->total; |
|
| 336 | + $teams->$team_key->average = $data->average_points; |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | case 'dashboard': |
| 347 | 347 | // This case is only used for test purpose. |
| 348 | 348 | |
| 349 | - $stats_file = SYS_PATH.'/core/json/gym.stats.json'; |
|
| 349 | + $stats_file = SYS_PATH.'/core/json/gym.stats.json'; |
|
| 350 | 350 | |
| 351 | 351 | if (!is_file($stats_file)) { |
| 352 | 352 | echo "Sorry, no Gym stats file was found. <br> Did you enable cron? "; |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | |
| 357 | - $stats_file = SYS_PATH.'/core/json/pokemon.stats.json'; |
|
| 357 | + $stats_file = SYS_PATH.'/core/json/pokemon.stats.json'; |
|
| 358 | 358 | |
| 359 | 359 | if (!is_file($stats_file)) { |
| 360 | 360 | echo "Sorry, no Pokémon stats file was found. <br> Did you enabled cron?"; |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | |
| 365 | - $stats_file = SYS_PATH.'/core/json/pokestop.stats.json'; |
|
| 365 | + $stats_file = SYS_PATH.'/core/json/pokestop.stats.json'; |
|
| 366 | 366 | |
| 367 | 367 | if (!is_file($stats_file)) { |
| 368 | 368 | echo "Sorry, no Pokéstop stats file was found. <br> Did you enabled cron?"; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | if ($config->system->captcha_support) { |
| 373 | - $stats_file = SYS_PATH.'/core/json/captcha.stats.json'; |
|
| 373 | + $stats_file = SYS_PATH.'/core/json/captcha.stats.json'; |
|
| 374 | 374 | |
| 375 | 375 | if (!is_file($stats_file)) { |
| 376 | 376 | echo "Sorry, no Captcha stats file were found <br> Have you enable cron?"; |
@@ -390,9 +390,9 @@ discard block |
||
| 390 | 390 | // Right now |
| 391 | 391 | // --------- |
| 392 | 392 | |
| 393 | - $req = "SELECT COUNT(*) as total FROM pokemon WHERE disappear_time >= UTC_TIMESTAMP()"; |
|
| 394 | - $result = $mysqli->query($req); |
|
| 395 | - $data = $result->fetch_object(); |
|
| 393 | + $req = "SELECT COUNT(*) as total FROM pokemon WHERE disappear_time >= UTC_TIMESTAMP()"; |
|
| 394 | + $result = $mysqli->query($req); |
|
| 395 | + $data = $result->fetch_object(); |
|
| 396 | 396 | |
| 397 | 397 | |
| 398 | 398 | $home->pokemon_now = $data->total; |
@@ -401,9 +401,9 @@ discard block |
||
| 401 | 401 | // Lured stops |
| 402 | 402 | // ----------- |
| 403 | 403 | |
| 404 | - $req = "SELECT COUNT(*) as total FROM pokestop WHERE lure_expiration >= UTC_TIMESTAMP()"; |
|
| 405 | - $result = $mysqli->query($req); |
|
| 406 | - $data = $result->fetch_object(); |
|
| 404 | + $req = "SELECT COUNT(*) as total FROM pokestop WHERE lure_expiration >= UTC_TIMESTAMP()"; |
|
| 405 | + $result = $mysqli->query($req); |
|
| 406 | + $data = $result->fetch_object(); |
|
| 407 | 407 | |
| 408 | 408 | $home->pokestop_lured = $data->total; |
| 409 | 409 | |
@@ -411,9 +411,9 @@ discard block |
||
| 411 | 411 | // Gyms |
| 412 | 412 | // ---- |
| 413 | 413 | |
| 414 | - $req = "SELECT COUNT(DISTINCT(gym_id)) as total FROM gym"; |
|
| 415 | - $result = $mysqli->query($req); |
|
| 416 | - $data = $result->fetch_object(); |
|
| 414 | + $req = "SELECT COUNT(DISTINCT(gym_id)) as total FROM gym"; |
|
| 415 | + $result = $mysqli->query($req); |
|
| 416 | + $data = $result->fetch_object(); |
|
| 417 | 417 | |
| 418 | 418 | $home->gyms = $data->total; |
| 419 | 419 | |
@@ -423,19 +423,19 @@ discard block |
||
| 423 | 423 | |
| 424 | 424 | if ($config->system->mythic_recents) { |
| 425 | 425 | // get all mythic pokemon ids |
| 426 | - $mythic_pokemons = array(); |
|
| 426 | + $mythic_pokemons = array(); |
|
| 427 | 427 | foreach ($pokemons->pokemon as $id => $pokemon) { |
| 428 | 428 | if ($pokemon->spawn_rate < 0.01) { |
| 429 | 429 | $mythic_pokemons[] = $id; |
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | 432 | // get all mythic pokemon |
| 433 | - $req = "SELECT DISTINCT pokemon_id, encounter_id, disappear_time, last_modified, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude, individual_attack, individual_defense, individual_stamina FROM pokemon |
|
| 433 | + $req = "SELECT DISTINCT pokemon_id, encounter_id, disappear_time, last_modified, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude, individual_attack, individual_defense, individual_stamina FROM pokemon |
|
| 434 | 434 | WHERE pokemon_id IN (".implode(",", $mythic_pokemons).") |
| 435 | 435 | ORDER BY last_modified DESC LIMIT 0,12"; |
| 436 | 436 | } else { |
| 437 | 437 | // get all pokemon |
| 438 | - $req = "SELECT DISTINCT pokemon_id, encounter_id, disappear_time, last_modified, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude, individual_attack, individual_defense, individual_stamina FROM pokemon |
|
| 438 | + $req = "SELECT DISTINCT pokemon_id, encounter_id, disappear_time, last_modified, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude, individual_attack, individual_defense, individual_stamina FROM pokemon |
|
| 439 | 439 | ORDER BY last_modified DESC LIMIT 0,12"; |
| 440 | 440 | } |
| 441 | 441 | $result = $mysqli->query($req); |
@@ -481,28 +481,28 @@ discard block |
||
| 481 | 481 | |
| 482 | 482 | $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '1' "; |
| 483 | 483 | $result = $mysqli->query($req); |
| 484 | - $data = $result->fetch_object(); |
|
| 484 | + $data = $result->fetch_object(); |
|
| 485 | 485 | |
| 486 | - $home->teams->mystic = $data->total; |
|
| 486 | + $home->teams->mystic = $data->total; |
|
| 487 | 487 | |
| 488 | 488 | |
| 489 | 489 | $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '2' "; |
| 490 | 490 | $result = $mysqli->query($req); |
| 491 | - $data = $result->fetch_object(); |
|
| 491 | + $data = $result->fetch_object(); |
|
| 492 | 492 | |
| 493 | - $home->teams->valor = $data->total; |
|
| 493 | + $home->teams->valor = $data->total; |
|
| 494 | 494 | |
| 495 | 495 | |
| 496 | 496 | $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '3' "; |
| 497 | 497 | $result = $mysqli->query($req); |
| 498 | - $data = $result->fetch_object(); |
|
| 498 | + $data = $result->fetch_object(); |
|
| 499 | 499 | |
| 500 | - $home->teams->instinct = $data->total; |
|
| 500 | + $home->teams->instinct = $data->total; |
|
| 501 | 501 | |
| 502 | 502 | |
| 503 | 503 | $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '0' "; |
| 504 | 504 | $result = $mysqli->query($req); |
| 505 | - $data = $result->fetch_object(); |
|
| 505 | + $data = $result->fetch_object(); |
|
| 506 | 506 | |
| 507 | - $home->teams->rocket = $data->total; |
|
| 507 | + $home->teams->rocket = $data->total; |
|
| 508 | 508 | } |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | // This file only include other files to have only 1 entry in your crontabs. |
| 4 | 4 | // ------------------------------------------------------------------------ |
| 5 | 5 | |
| 6 | -$filePath = dirname(__FILE__); |
|
| 7 | -$config_file = $filePath.'/../../config.php'; |
|
| 6 | +$filePath = dirname(__FILE__); |
|
| 7 | +$config_file = $filePath.'/../../config.php'; |
|
| 8 | 8 | |
| 9 | 9 | include_once($config_file); |
| 10 | 10 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | # MySQL |
| 18 | -$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT); |
|
| 18 | +$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT); |
|
| 19 | 19 | |
| 20 | 20 | if ($mysqli->connect_error != '') { |
| 21 | 21 | die('MySQL connect error'); |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | -$gym_file = SYS_PATH.'/core/json/gym.stats.json'; |
|
| 27 | -$pokestop_file = SYS_PATH.'/core/json/pokestop.stats.json'; |
|
| 28 | -$pokemonstats_file = SYS_PATH.'/core/json/pokemon.stats.json'; |
|
| 26 | +$gym_file = SYS_PATH.'/core/json/gym.stats.json'; |
|
| 27 | +$pokestop_file = SYS_PATH.'/core/json/pokestop.stats.json'; |
|
| 28 | +$pokemonstats_file = SYS_PATH.'/core/json/pokemon.stats.json'; |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | if (is_file($gym_file)) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $pokedatas = json_decode(file_get_contents($pokemonstats_file), true); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -$timestamp = time(); |
|
| 41 | +$timestamp = time(); |
|
| 42 | 42 | |
| 43 | 43 | include_once(SYS_PATH.'/core/cron/gym.cron.php'); |
| 44 | 44 | include_once(SYS_PATH.'/core/cron/pokemon.cron.php'); |
@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | $lock_msg = ''; |
| 24 | 24 | |
| 25 | - $mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT); |
|
| 25 | + $mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT); |
|
| 26 | 26 | |
| 27 | 27 | // Pokemon Test |
| 28 | - $req = "SELECT COUNT(*) as total FROM pokemon"; |
|
| 29 | - $result = $mysqli->query($req); |
|
| 28 | + $req = "SELECT COUNT(*) as total FROM pokemon"; |
|
| 29 | + $result = $mysqli->query($req); |
|
| 30 | 30 | |
| 31 | 31 | if (!is_object($result)) { |
| 32 | 32 | $lock_msg .= "Error: No Pokémon database found<br>"; |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // Gym Test |
| 43 | - $req = "SELECT COUNT(*) as total FROM gym"; |
|
| 44 | - $result = $mysqli->query($req); |
|
| 43 | + $req = "SELECT COUNT(*) as total FROM gym"; |
|
| 44 | + $result = $mysqli->query($req); |
|
| 45 | 45 | |
| 46 | 46 | if (!is_object($result)) { |
| 47 | 47 | $lock_msg .= "Error: No Gym database found<br>"; |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | // Pokéstop Test |
| 59 | - $req = "SELECT COUNT(*) as total FROM pokestop"; |
|
| 60 | - $result = $mysqli->query($req); |
|
| 59 | + $req = "SELECT COUNT(*) as total FROM pokestop"; |
|
| 60 | + $result = $mysqli->query($req); |
|
| 61 | 61 | |
| 62 | 62 | if (!is_object($result)) { |
| 63 | 63 | $lock_msg .= "Error: No Pokestop database found<br>"; |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | $pos = !empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], getenv('HTTP_HOST')); |
| 8 | 8 | |
| 9 | -if ($pos===false) { |
|
| 9 | +if ($pos === false) { |
|
| 10 | 10 | http_response_code(401); |
| 11 | 11 | die('Restricted access'); |
| 12 | 12 | } |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | // Include & load the variables |
| 20 | 20 | // ############################ |
| 21 | 21 | |
| 22 | -$variables = SYS_PATH.'/core/json/variables.json'; |
|
| 23 | -$config = json_decode(file_get_contents($variables)); |
|
| 22 | +$variables = SYS_PATH.'/core/json/variables.json'; |
|
| 23 | +$config = json_decode(file_get_contents($variables)); |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | # MySQL |
| 40 | -$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT); |
|
| 40 | +$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT); |
|
| 41 | 41 | if ($mysqli->connect_error != '') { |
| 42 | 42 | exit('Error MySQL Connect'); |
| 43 | 43 | } |
| 44 | 44 | $mysqli->set_charset('utf8'); |
| 45 | -$request = $_GET['type']; |
|
| 45 | +$request = $_GET['type']; |
|
| 46 | 46 | |
| 47 | 47 | switch ($request) { |
| 48 | 48 | ############################ |
@@ -55,64 +55,64 @@ discard block |
||
| 55 | 55 | // Right now |
| 56 | 56 | // --------- |
| 57 | 57 | |
| 58 | - $req = "SELECT COUNT(*) as total FROM pokemon WHERE disappear_time >= UTC_TIMESTAMP()"; |
|
| 59 | - $result = $mysqli->query($req); |
|
| 60 | - $data = $result->fetch_object(); |
|
| 58 | + $req = "SELECT COUNT(*) as total FROM pokemon WHERE disappear_time >= UTC_TIMESTAMP()"; |
|
| 59 | + $result = $mysqli->query($req); |
|
| 60 | + $data = $result->fetch_object(); |
|
| 61 | 61 | |
| 62 | - $values[] = $data->total; |
|
| 62 | + $values[] = $data->total; |
|
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | // Lured stops |
| 66 | 66 | // ----------- |
| 67 | 67 | |
| 68 | - $req = "SELECT COUNT(*) as total FROM pokestop WHERE lure_expiration >= UTC_TIMESTAMP()"; |
|
| 69 | - $result = $mysqli->query($req); |
|
| 70 | - $data = $result->fetch_object(); |
|
| 68 | + $req = "SELECT COUNT(*) as total FROM pokestop WHERE lure_expiration >= UTC_TIMESTAMP()"; |
|
| 69 | + $result = $mysqli->query($req); |
|
| 70 | + $data = $result->fetch_object(); |
|
| 71 | 71 | |
| 72 | - $values[] = $data->total; |
|
| 72 | + $values[] = $data->total; |
|
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | // Team battle |
| 77 | 77 | // ----------- |
| 78 | 78 | |
| 79 | - $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym"; |
|
| 80 | - $result = $mysqli->query($req); |
|
| 81 | - $data = $result->fetch_object(); |
|
| 79 | + $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym"; |
|
| 80 | + $result = $mysqli->query($req); |
|
| 81 | + $data = $result->fetch_object(); |
|
| 82 | 82 | |
| 83 | - $values[] = $data->total; |
|
| 83 | + $values[] = $data->total; |
|
| 84 | 84 | |
| 85 | 85 | // Team |
| 86 | 86 | // 1 = bleu |
| 87 | 87 | // 2 = rouge |
| 88 | 88 | // 3 = jaune |
| 89 | 89 | |
| 90 | - $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '2' "; |
|
| 91 | - $result = $mysqli->query($req); |
|
| 92 | - $data = $result->fetch_object(); |
|
| 90 | + $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '2' "; |
|
| 91 | + $result = $mysqli->query($req); |
|
| 92 | + $data = $result->fetch_object(); |
|
| 93 | 93 | |
| 94 | 94 | // Red |
| 95 | 95 | $values[] = $data->total; |
| 96 | 96 | |
| 97 | 97 | |
| 98 | - $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '1' "; |
|
| 99 | - $result = $mysqli->query($req); |
|
| 100 | - $data = $result->fetch_object(); |
|
| 98 | + $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '1' "; |
|
| 99 | + $result = $mysqli->query($req); |
|
| 100 | + $data = $result->fetch_object(); |
|
| 101 | 101 | |
| 102 | 102 | // Blue |
| 103 | 103 | $values[] = $data->total; |
| 104 | 104 | |
| 105 | 105 | |
| 106 | - $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '3' "; |
|
| 107 | - $result = $mysqli->query($req); |
|
| 108 | - $data = $result->fetch_object(); |
|
| 106 | + $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '3' "; |
|
| 107 | + $result = $mysqli->query($req); |
|
| 108 | + $data = $result->fetch_object(); |
|
| 109 | 109 | |
| 110 | 110 | // Yellow |
| 111 | 111 | $values[] = $data->total; |
| 112 | 112 | |
| 113 | - $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '0' "; |
|
| 114 | - $result = $mysqli->query($req); |
|
| 115 | - $data = $result->fetch_object(); |
|
| 113 | + $req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '0' "; |
|
| 114 | + $result = $mysqli->query($req); |
|
| 115 | + $data = $result->fetch_object(); |
|
| 116 | 116 | |
| 117 | 117 | // Neutral |
| 118 | 118 | $values[] = $data->total; |
@@ -152,12 +152,12 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // get last mythic pokemon |
| 155 | - $req = "SELECT pokemon_id, encounter_id, disappear_time, last_modified, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude, individual_attack, individual_defense, individual_stamina FROM pokemon |
|
| 155 | + $req = "SELECT pokemon_id, encounter_id, disappear_time, last_modified, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude, individual_attack, individual_defense, individual_stamina FROM pokemon |
|
| 156 | 156 | WHERE pokemon_id IN (".implode(",", $mythic_pokemons).") |
| 157 | 157 | ORDER BY last_modified DESC LIMIT 0,12"; |
| 158 | 158 | } else { |
| 159 | 159 | // get last pokemon |
| 160 | - $req = "SELECT pokemon_id, encounter_id, disappear_time, last_modified, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude, individual_attack, individual_defense, individual_stamina FROM pokemon ORDER BY last_modified DESC LIMIT 0,12"; |
|
| 160 | + $req = "SELECT pokemon_id, encounter_id, disappear_time, last_modified, (CONVERT_TZ(disappear_time, '+00:00', '".$time_offset."')) as disappear_time_real, latitude, longitude, individual_attack, individual_defense, individual_stamina FROM pokemon ORDER BY last_modified DESC LIMIT 0,12"; |
|
| 161 | 161 | } |
| 162 | 162 | $result = $mysqli->query($req); |
| 163 | 163 | while ($data = $result->fetch_object()) { |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | if ($iv->available) { |
| 196 | 196 | $html .= ' |
| 197 | 197 | <div class="progress" style="height: 6px; width: 80%; margin: 5px auto 0 auto;"> |
| 198 | - <div title="Stamina IV: '. $iv->stamina .'" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'. $iv->stamina .'" aria-valuemin="0" aria-valuemax="45" style="width: '. ((100/15)*$iv->stamina)/3 .'%"> |
|
| 199 | - <span class="sr-only">Stamina IV: '. $iv->stamina .'</span> |
|
| 198 | + <div title="Stamina IV: '. $iv->stamina.'" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$iv->stamina.'" aria-valuemin="0" aria-valuemax="45" style="width: '.((100 / 15) * $iv->stamina) / 3.'%"> |
|
| 199 | + <span class="sr-only">Stamina IV: '. $iv->stamina.'</span> |
|
| 200 | 200 | </div> |
| 201 | - <div title="Attack IV: '. $iv->attack .'" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'. $iv->attack .'" aria-valuemin="0" aria-valuemax="45" style="width: '. ((100/15)*$iv->attack)/3 .'%"> |
|
| 202 | - <span class="sr-only">Attack IV: '. $iv->attack .'</span> |
|
| 201 | + <div title="Attack IV: '. $iv->attack.'" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$iv->attack.'" aria-valuemin="0" aria-valuemax="45" style="width: '.((100 / 15) * $iv->attack) / 3.'%"> |
|
| 202 | + <span class="sr-only">Attack IV: '. $iv->attack.'</span> |
|
| 203 | 203 | </div> |
| 204 | - <div title="Defense IV: '. $iv->defense .'" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'. $iv->defense .'" aria-valuemin="0" aria-valuemax="45" style="width: '. ((100/15)*$iv->defense)/3 .'%"> |
|
| 205 | - <span class="sr-only">Defense IV: '. $iv->defense .'</span> |
|
| 204 | + <div title="Defense IV: '. $iv->defense.'" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$iv->defense.'" aria-valuemin="0" aria-valuemax="45" style="width: '.((100 / 15) * $iv->defense) / 3.'%"> |
|
| 205 | + <span class="sr-only">Defense IV: '. $iv->defense.'</span> |
|
| 206 | 206 | </div> |
| 207 | 207 | </div>'; |
| 208 | 208 | } else { |
@@ -238,15 +238,15 @@ discard block |
||
| 238 | 238 | #################################### |
| 239 | 239 | |
| 240 | 240 | case 'pokestop': |
| 241 | - $req = "SELECT latitude, longitude, lure_expiration FROM pokestop"; |
|
| 242 | - $result = $mysqli->query($req); |
|
| 241 | + $req = "SELECT latitude, longitude, lure_expiration FROM pokestop"; |
|
| 242 | + $result = $mysqli->query($req); |
|
| 243 | 243 | |
| 244 | - $i=0; |
|
| 244 | + $i = 0; |
|
| 245 | 245 | |
| 246 | 246 | while ($data = $result->fetch_object()) { |
| 247 | 247 | if ($data->lure_expiration != '') { |
| 248 | 248 | $icon = 'pokestap_lured.png'; |
| 249 | - $text = 'Lured expire @ '.date('h:i:s', strtotime($data->lure_expiration)+(3600*2)) ; |
|
| 249 | + $text = 'Lured expire @ '.date('h:i:s', strtotime($data->lure_expiration) + (3600 * 2)); |
|
| 250 | 250 | } else { |
| 251 | 251 | $icon = 'pokestap.png'; |
| 252 | 252 | $text = 'Normal stop'; |
@@ -279,19 +279,19 @@ discard block |
||
| 279 | 279 | #################################### |
| 280 | 280 | |
| 281 | 281 | case 'update_gym': |
| 282 | - $teams = new stdClass(); |
|
| 283 | - $teams->mystic = 1; |
|
| 284 | - $teams->valor = 2; |
|
| 285 | - $teams->instinct = 3; |
|
| 282 | + $teams = new stdClass(); |
|
| 283 | + $teams->mystic = 1; |
|
| 284 | + $teams->valor = 2; |
|
| 285 | + $teams->instinct = 3; |
|
| 286 | 286 | |
| 287 | 287 | |
| 288 | 288 | foreach ($teams as $team_name => $team_id) { |
| 289 | - $req = "SELECT COUNT(DISTINCT(gym_id)) as total, ROUND(AVG(gym_points),0) as average_points FROM gym WHERE team_id = '".$team_id."' "; |
|
| 290 | - $result = $mysqli->query($req); |
|
| 291 | - $data = $result->fetch_object(); |
|
| 289 | + $req = "SELECT COUNT(DISTINCT(gym_id)) as total, ROUND(AVG(gym_points),0) as average_points FROM gym WHERE team_id = '".$team_id."' "; |
|
| 290 | + $result = $mysqli->query($req); |
|
| 291 | + $data = $result->fetch_object(); |
|
| 292 | 292 | |
| 293 | - $return[] = $data->total; |
|
| 294 | - $return[] = $data->average_points; |
|
| 293 | + $return[] = $data->total; |
|
| 294 | + $return[] = $data->average_points; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | $json = json_encode($return); |
@@ -310,11 +310,11 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | |
| 312 | 312 | case 'gym_map': |
| 313 | - $req = "SELECT gym_id, team_id, guard_pokemon_id, gym_points, latitude, longitude, (CONVERT_TZ(last_modified, '+00:00', '".$time_offset."')) as last_modified FROM gym"; |
|
| 314 | - $result = $mysqli->query($req); |
|
| 313 | + $req = "SELECT gym_id, team_id, guard_pokemon_id, gym_points, latitude, longitude, (CONVERT_TZ(last_modified, '+00:00', '".$time_offset."')) as last_modified FROM gym"; |
|
| 314 | + $result = $mysqli->query($req); |
|
| 315 | 315 | |
| 316 | 316 | |
| 317 | - $i=0; |
|
| 317 | + $i = 0; |
|
| 318 | 318 | |
| 319 | 319 | while ($data = $result->fetch_object()) { |
| 320 | 320 | // Team |
@@ -326,50 +326,50 @@ discard block |
||
| 326 | 326 | case 0: |
| 327 | 327 | $icon = 'map_white.png'; |
| 328 | 328 | $team = 'No Team (yet)'; |
| 329 | - $color = 'rgba(0, 0, 0, .6)'; |
|
| 329 | + $color = 'rgba(0, 0, 0, .6)'; |
|
| 330 | 330 | break; |
| 331 | 331 | |
| 332 | 332 | case 1: |
| 333 | 333 | $icon = 'map_blue_'; |
| 334 | 334 | $team = 'Team Mystic'; |
| 335 | - $color = 'rgba(74, 138, 202, .6)'; |
|
| 335 | + $color = 'rgba(74, 138, 202, .6)'; |
|
| 336 | 336 | break; |
| 337 | 337 | |
| 338 | 338 | case 2: |
| 339 | 339 | $icon = 'map_red_'; |
| 340 | 340 | $team = 'Team Valor'; |
| 341 | - $color = 'rgba(240, 68, 58, .6)'; |
|
| 341 | + $color = 'rgba(240, 68, 58, .6)'; |
|
| 342 | 342 | break; |
| 343 | 343 | |
| 344 | 344 | case 3: |
| 345 | 345 | $icon = 'map_yellow_'; |
| 346 | 346 | $team = 'Team Instinct'; |
| 347 | - $color = 'rgba(254, 217, 40, .6)'; |
|
| 347 | + $color = 'rgba(254, 217, 40, .6)'; |
|
| 348 | 348 | break; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | // Set gym level |
| 352 | - $data->gym_level=0; |
|
| 352 | + $data->gym_level = 0; |
|
| 353 | 353 | if ($data->gym_points < 2000) { |
| 354 | - $data->gym_level=1; |
|
| 354 | + $data->gym_level = 1; |
|
| 355 | 355 | } elseif ($data->gym_points < 4000) { |
| 356 | - $data->gym_level=2; |
|
| 356 | + $data->gym_level = 2; |
|
| 357 | 357 | } elseif ($data->gym_points < 8000) { |
| 358 | - $data->gym_level=3; |
|
| 358 | + $data->gym_level = 3; |
|
| 359 | 359 | } elseif ($data->gym_points < 12000) { |
| 360 | - $data->gym_level=4; |
|
| 360 | + $data->gym_level = 4; |
|
| 361 | 361 | } elseif ($data->gym_points < 16000) { |
| 362 | - $data->gym_level=5; |
|
| 362 | + $data->gym_level = 5; |
|
| 363 | 363 | } elseif ($data->gym_points < 20000) { |
| 364 | - $data->gym_level=6; |
|
| 364 | + $data->gym_level = 6; |
|
| 365 | 365 | } elseif ($data->gym_points < 30000) { |
| 366 | - $data->gym_level=7; |
|
| 366 | + $data->gym_level = 7; |
|
| 367 | 367 | } elseif ($data->gym_points < 40000) { |
| 368 | - $data->gym_level=8; |
|
| 368 | + $data->gym_level = 8; |
|
| 369 | 369 | } elseif ($data->gym_points < 50000) { |
| 370 | - $data->gym_level=9; |
|
| 370 | + $data->gym_level = 9; |
|
| 371 | 371 | } else { |
| 372 | - $data->gym_level=10; |
|
| 372 | + $data->gym_level = 10; |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | ## I know, I revert commit 6e8d2e7 from @kiralydavid but the way it was done broke the page. |
@@ -420,8 +420,8 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | case 'gym_defenders': |
| 422 | 422 | $gym_id = $mysqli->real_escape_string($_GET['gym_id']); |
| 423 | - $req = "SELECT gymdetails.name as name, gymdetails.description as description, gym.gym_points as points, gymdetails.url as url, gym.team_id as team, (CONVERT_TZ(gym.last_modified, '+00:00', '".$time_offset."')) as last_modified, gym.guard_pokemon_id as guard_pokemon_id FROM gymdetails LEFT JOIN gym on gym.gym_id = gymdetails.gym_id WHERE gym.gym_id='".$gym_id."'"; |
|
| 424 | - $result = $mysqli->query($req); |
|
| 423 | + $req = "SELECT gymdetails.name as name, gymdetails.description as description, gym.gym_points as points, gymdetails.url as url, gym.team_id as team, (CONVERT_TZ(gym.last_modified, '+00:00', '".$time_offset."')) as last_modified, gym.guard_pokemon_id as guard_pokemon_id FROM gymdetails LEFT JOIN gym on gym.gym_id = gymdetails.gym_id WHERE gym.gym_id='".$gym_id."'"; |
|
| 424 | + $result = $mysqli->query($req); |
|
| 425 | 425 | $gymData['gymDetails']['gymInfos'] = false; |
| 426 | 426 | while ($data = $result->fetch_object()) { |
| 427 | 427 | $gymData['gymDetails']['gymInfos']['name'] = $data->name; |
@@ -437,31 +437,31 @@ discard block |
||
| 437 | 437 | $gymData['gymDetails']['gymInfos']['team'] = $data->team; |
| 438 | 438 | $gymData['gymDetails']['gymInfos']['guardPokemonId'] = $data->guard_pokemon_id; |
| 439 | 439 | if ($data->points < 2000) { |
| 440 | - $gymData['gymDetails']['gymInfos']['level']=1; |
|
| 440 | + $gymData['gymDetails']['gymInfos']['level'] = 1; |
|
| 441 | 441 | } elseif ($data->points < 4000) { |
| 442 | - $gymData['gymDetails']['gymInfos']['level']=2; |
|
| 442 | + $gymData['gymDetails']['gymInfos']['level'] = 2; |
|
| 443 | 443 | } elseif ($data->points < 8000) { |
| 444 | - $gymData['gymDetails']['gymInfos']['level']=3; |
|
| 444 | + $gymData['gymDetails']['gymInfos']['level'] = 3; |
|
| 445 | 445 | } elseif ($data->points < 12000) { |
| 446 | - $gymData['gymDetails']['gymInfos']['level']=4; |
|
| 446 | + $gymData['gymDetails']['gymInfos']['level'] = 4; |
|
| 447 | 447 | } elseif ($data->points < 16000) { |
| 448 | - $gymData['gymDetails']['gymInfos']['level']=5; |
|
| 448 | + $gymData['gymDetails']['gymInfos']['level'] = 5; |
|
| 449 | 449 | } elseif ($data->points < 20000) { |
| 450 | - $gymData['gymDetails']['gymInfos']['level']=6; |
|
| 450 | + $gymData['gymDetails']['gymInfos']['level'] = 6; |
|
| 451 | 451 | } elseif ($data->points < 30000) { |
| 452 | - $gymData['gymDetails']['gymInfos']['level']=7; |
|
| 452 | + $gymData['gymDetails']['gymInfos']['level'] = 7; |
|
| 453 | 453 | } elseif ($data->points < 40000) { |
| 454 | - $gymData['gymDetails']['gymInfos']['level']=8; |
|
| 454 | + $gymData['gymDetails']['gymInfos']['level'] = 8; |
|
| 455 | 455 | } elseif ($data->points < 50000) { |
| 456 | - $gymData['gymDetails']['gymInfos']['level']=9; |
|
| 456 | + $gymData['gymDetails']['gymInfos']['level'] = 9; |
|
| 457 | 457 | } else { |
| 458 | - $gymData['gymDetails']['gymInfos']['level']=10; |
|
| 458 | + $gymData['gymDetails']['gymInfos']['level'] = 10; |
|
| 459 | 459 | } |
| 460 | 460 | } |
| 461 | 461 | //print_r($gymData); |
| 462 | - $req = "SELECT * FROM gympokemon inner join gymmember on gympokemon.pokemon_uid=gymmember.pokemon_uid where gym_id='".$gym_id."' ORDER BY cp DESC"; |
|
| 463 | - $result = $mysqli->query($req); |
|
| 464 | - $i=0; |
|
| 462 | + $req = "SELECT * FROM gympokemon inner join gymmember on gympokemon.pokemon_uid=gymmember.pokemon_uid where gym_id='".$gym_id."' ORDER BY cp DESC"; |
|
| 463 | + $result = $mysqli->query($req); |
|
| 464 | + $i = 0; |
|
| 465 | 465 | |
| 466 | 466 | |
| 467 | 467 | |
@@ -479,15 +479,15 @@ discard block |
||
| 479 | 479 | </a> |
| 480 | 480 | <p class="pkmn-name">'.$data->cp.'</p> |
| 481 | 481 | <div class="progress" style="height: 4px; width: 40px; margin-bottom: 10px; margin-top: 2px; margin-left: auto; margin-right: auto"> |
| 482 | - <div title="Stamina IV: '.$data->iv_stamina.'" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$data->iv_stamina.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100/15)*$data->iv_stamina)/3).'%"> |
|
| 482 | + <div title="Stamina IV: '.$data->iv_stamina.'" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$data->iv_stamina.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $data->iv_stamina) / 3).'%"> |
|
| 483 | 483 | <span class="sr-only">Stamina IV: '.$data->iv_stamina.'</span> |
| 484 | 484 | </div> |
| 485 | 485 | |
| 486 | - <div title="Attack IV: '.$data->iv_attack.'" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$data->iv_attack.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100/15)*$data->iv_attack)/3).'%"> |
|
| 486 | + <div title="Attack IV: '.$data->iv_attack.'" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$data->iv_attack.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $data->iv_attack) / 3).'%"> |
|
| 487 | 487 | <span class="sr-only">Attack IV: '.$data->iv_attack.'</span> |
| 488 | 488 | </div> |
| 489 | 489 | |
| 490 | - <div title="Defense IV: '.$data->iv_defense.'" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$data->iv_defense.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100/15)*$data->iv_defense)/3).'%"> |
|
| 490 | + <div title="Defense IV: '.$data->iv_defense.'" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$data->iv_defense.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $data->iv_defense) / 3).'%"> |
|
| 491 | 491 | <span class="sr-only">Defense IV: '.$data->iv_defense.'</span> |
| 492 | 492 | </div> |
| 493 | 493 | </div> |
@@ -517,16 +517,16 @@ discard block |
||
| 517 | 517 | $name = ""; |
| 518 | 518 | $page = "0"; |
| 519 | 519 | $where = ""; |
| 520 | - $order=""; |
|
| 521 | - $team=0; |
|
| 522 | - $ranking=0; |
|
| 520 | + $order = ""; |
|
| 521 | + $team = 0; |
|
| 522 | + $ranking = 0; |
|
| 523 | 523 | if (isset($_GET['name'])) { |
| 524 | 524 | $trainer_name = mysqli_real_escape_string($mysqli, $_GET['name']); |
| 525 | 525 | $where = " HAVING name LIKE '%".$trainer_name."%'"; |
| 526 | 526 | } |
| 527 | - if (isset($_GET['team']) && $_GET['team']!=0) { |
|
| 527 | + if (isset($_GET['team']) && $_GET['team'] != 0) { |
|
| 528 | 528 | $team = mysqli_real_escape_string($mysqli, $_GET['team']); |
| 529 | - $where .= ($where==""?" HAVING":"AND ")." team = ".$team; |
|
| 529 | + $where .= ($where == "" ? " HAVING" : "AND ")." team = ".$team; |
|
| 530 | 530 | } |
| 531 | 531 | if (isset($_GET['page'])) { |
| 532 | 532 | $page = mysqli_real_escape_string($mysqli, $_GET['page']); |
@@ -537,16 +537,16 @@ discard block |
||
| 537 | 537 | |
| 538 | 538 | switch ($ranking) { |
| 539 | 539 | case 1: |
| 540 | - $order=" ORDER BY active DESC "; |
|
| 540 | + $order = " ORDER BY active DESC "; |
|
| 541 | 541 | break; |
| 542 | 542 | case 2: |
| 543 | - $order=" ORDER BY maxCp DESC "; |
|
| 543 | + $order = " ORDER BY maxCp DESC "; |
|
| 544 | 544 | break; |
| 545 | 545 | default: |
| 546 | - $order=" ORDER BY level DESC, active DESC "; |
|
| 546 | + $order = " ORDER BY level DESC, active DESC "; |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | - $limit = " LIMIT ".($page*10).",10 "; |
|
| 549 | + $limit = " LIMIT ".($page * 10).",10 "; |
|
| 550 | 550 | |
| 551 | 551 | |
| 552 | 552 | $req = "SELECT trainer.*, count(actives_pokemons.trainer_name) as active, max(actives_pokemons.cp) as maxCp ". |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | $reqRanking = "SELECT count(1) as rank FROM trainer where trainer.level >= ".$trainer->level; |
| 566 | 566 | $resultRanking = $mysqli->query($reqRanking); |
| 567 | 567 | while ($data = $resultRanking->fetch_object()) { |
| 568 | - $trainer->rank = $data->rank ; |
|
| 568 | + $trainer->rank = $data->rank; |
|
| 569 | 569 | } |
| 570 | 570 | $req = "(SELECT DISTINCT gympokemon.pokemon_id, gympokemon.pokemon_uid, gympokemon.cp, DATEDIFF(UTC_TIMESTAMP(), gympokemon.last_seen) AS last_scanned, gympokemon.trainer_name, gympokemon.iv_defense, gympokemon.iv_stamina, gympokemon.iv_attack, filtered_gymmember.gym_id, '1' as active ". |
| 571 | 571 | "FROM gympokemon INNER JOIN ". |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | |
| 576 | 576 | $resultPkms = $mysqli->query($req); |
| 577 | 577 | $trainer->pokemons = array(); |
| 578 | - $active_gyms=0; |
|
| 578 | + $active_gyms = 0; |
|
| 579 | 579 | $pkmCount = 0; |
| 580 | 580 | while ($resultPkms && $dataPkm = $resultPkms->fetch_object()) { |
| 581 | 581 | $active_gyms++; |
@@ -603,9 +603,9 @@ discard block |
||
| 603 | 603 | |
| 604 | 604 | case 'pokemon_slider_init': |
| 605 | 605 | |
| 606 | - $req = "SELECT MIN(pokemon.disappear_time) as min, MAX(pokemon.disappear_time) as max from pokemon"; |
|
| 606 | + $req = "SELECT MIN(pokemon.disappear_time) as min, MAX(pokemon.disappear_time) as max from pokemon"; |
|
| 607 | 607 | $result = $mysqli->query($req); |
| 608 | - $data = $result->fetch_object(); |
|
| 608 | + $data = $result->fetch_object(); |
|
| 609 | 609 | $bounds = $data; |
| 610 | 610 | |
| 611 | 611 | header('Content-Type: application/json'); |
@@ -618,19 +618,19 @@ discard block |
||
| 618 | 618 | |
| 619 | 619 | case 'pokemon_heatmap_points': |
| 620 | 620 | |
| 621 | - $json=""; |
|
| 622 | - if (isset($_GET['start'])&&isset($_GET['end']) && isset($_GET['pokemon_id'])) { |
|
| 623 | - $start = Date("Y-m-d H:i",(int)$_GET['start']); |
|
| 624 | - $end = Date("Y-m-d H:i",(int)$_GET['end']); |
|
| 621 | + $json = ""; |
|
| 622 | + if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['pokemon_id'])) { |
|
| 623 | + $start = Date("Y-m-d H:i", (int) $_GET['start']); |
|
| 624 | + $end = Date("Y-m-d H:i", (int) $_GET['end']); |
|
| 625 | 625 | $pokemon_id = mysqli_real_escape_string($mysqli, $_GET['pokemon_id']); |
| 626 | 626 | $where = " WHERE pokemon.pokemon_id = ".$pokemon_id." " |
| 627 | 627 | . "AND pokemon.disappear_time BETWEEN '".$start."' AND '".$end."'"; |
| 628 | 628 | |
| 629 | 629 | $req = "SELECT latitude, longitude FROM pokemon".$where; |
| 630 | - $result = $mysqli->query($req); |
|
| 630 | + $result = $mysqli->query($req); |
|
| 631 | 631 | $points = array(); |
| 632 | 632 | while ($result && $data = $result->fetch_object()) { |
| 633 | - $points[] = $data; |
|
| 633 | + $points[] = $data; |
|
| 634 | 634 | } |
| 635 | 635 | |
| 636 | 636 | $json = json_encode($points); |
@@ -5,45 +5,45 @@ discard block |
||
| 5 | 5 | // Total lured |
| 6 | 6 | // ----------------------------------------------------------------------------------------------------------- |
| 7 | 7 | |
| 8 | -$captcha_file = SYS_PATH.'/core/json/captcha.stats.json'; |
|
| 8 | +$captcha_file = SYS_PATH.'/core/json/captcha.stats.json'; |
|
| 9 | 9 | if (is_file($captcha_file)) { |
| 10 | - $capdatas = json_decode(file_get_contents($captcha_file), true); |
|
| 10 | + $capdatas = json_decode(file_get_contents($captcha_file), true); |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | $variables_secret = SYS_PATH.'/core/json/variables.secret.json'; |
| 15 | 15 | $config_secret = json_decode(file_get_contents($variables_secret)); |
| 16 | 16 | |
| 17 | -if ($config_secret->captcha_key=="") { |
|
| 17 | +if ($config_secret->captcha_key == "") { |
|
| 18 | 18 | $captcha['timestamp'] = $timestamp; |
| 19 | 19 | // get amount of accounts requiring a captcha |
| 20 | 20 | $req = "SELECT COUNT(*) as total " |
| 21 | 21 | . "FROM workerstatus WHERE message LIKE '%encountering a captcha%' " |
| 22 | 22 | . "AND last_modified >= UTC_TIMESTAMP() - INTERVAL 60 SECOND"; |
| 23 | - $result = $mysqli->query($req); |
|
| 24 | - $data = $result->fetch_object(); |
|
| 23 | + $result = $mysqli->query($req); |
|
| 24 | + $data = $result->fetch_object(); |
|
| 25 | 25 | $captcha['captcha_accs'] = $data->total; |
| 26 | 26 | // Add the datas in file |
| 27 | - $capdatas[] = $captcha; |
|
| 27 | + $capdatas[] = $captcha; |
|
| 28 | 28 | } else { |
| 29 | 29 | if (!empty($capdatas)) { |
| 30 | 30 | $lastCaptcha = array_pop($capdatas); |
| 31 | 31 | } else { |
| 32 | - $lastCaptcha["timestamp"]=strtotime("-7 days", strtotime(date("Y-m-d"))); |
|
| 32 | + $lastCaptcha["timestamp"] = strtotime("-7 days", strtotime(date("Y-m-d"))); |
|
| 33 | 33 | } |
| 34 | 34 | $lastCaptchaDate = date("Y-m-d", $lastCaptcha["timestamp"]); |
| 35 | 35 | $startTime = strtotime($lastCaptchaDate); |
| 36 | - $endTime = strtotime(date("Y-m-d"))+date("Z"); |
|
| 36 | + $endTime = strtotime(date("Y-m-d")) + date("Z"); |
|
| 37 | 37 | $timeDiff = abs($endTime - $startTime); |
| 38 | - $numberDays = intval($timeDiff/86400) ; // 86400 seconds in one day |
|
| 39 | - if ($numberDays>7) { |
|
| 40 | - $numberDays=7; |
|
| 38 | + $numberDays = intval($timeDiff / 86400); // 86400 seconds in one day |
|
| 39 | + if ($numberDays > 7) { |
|
| 40 | + $numberDays = 7; |
|
| 41 | 41 | } |
| 42 | - while ($numberDays>=0) { |
|
| 43 | - $day = $endTime-($numberDays*86400); |
|
| 42 | + while ($numberDays >= 0) { |
|
| 43 | + $day = $endTime - ($numberDays * 86400); |
|
| 44 | 44 | $captchaUrl = |
| 45 | - "http://2captcha.com/res.php?key=" . |
|
| 46 | - $config_secret->captcha_key . "&action=getstats&date=" . date("Y-m-d", $day); |
|
| 45 | + "http://2captcha.com/res.php?key=". |
|
| 46 | + $config_secret->captcha_key."&action=getstats&date=".date("Y-m-d", $day); |
|
| 47 | 47 | |
| 48 | 48 | $ch = curl_init(); |
| 49 | 49 | curl_setopt($ch, CURLOPT_URL, $captchaUrl); |
@@ -65,18 +65,18 @@ discard block |
||
| 65 | 65 | $capXml = simplexml_load_string($fileContents); |
| 66 | 66 | |
| 67 | 67 | foreach ($capXml as $key => $value) { |
| 68 | - if ( ($numberDays==0 |
|
| 69 | - && ((int)$value->Attributes()->hour >= (int)date("H", $lastCaptcha["timestamp"]) |
|
| 70 | - && ((int)$value->Attributes()->hour <= (int)date("H"))) |
|
| 71 | - ) || $numberDays>0) { |
|
| 68 | + if (($numberDays == 0 |
|
| 69 | + && ((int) $value->Attributes()->hour >= (int) date("H", $lastCaptcha["timestamp"]) |
|
| 70 | + && ((int) $value->Attributes()->hour <= (int) date("H"))) |
|
| 71 | + ) || $numberDays > 0) { |
|
| 72 | 72 | $captcha['timestamp'] = |
| 73 | - strtotime(date("Y-m-d", $day) . " " . $value->Attributes()->hour . ":00")+date("Z"); |
|
| 74 | - $captcha['captcha_accs'] = (string)$value->volume; |
|
| 75 | - $capdatas[] = $captcha; |
|
| 73 | + strtotime(date("Y-m-d", $day)." ".$value->Attributes()->hour.":00") + date("Z"); |
|
| 74 | + $captcha['captcha_accs'] = (string) $value->volume; |
|
| 75 | + $capdatas[] = $captcha; |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | --$numberDays; |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | -$json = json_encode($capdatas); |
|
| 81 | +$json = json_encode($capdatas); |
|
| 82 | 82 | file_put_contents($captcha_file, $json); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | <link href="https://fonts.googleapis.com/css?family=Lato:400,300,700" rel="stylesheet" type="text/css"> |
| 21 | 21 | <link href="core/css/font-awesome.min.css" rel="stylesheet"> |
| 22 | 22 | <link href="<?php auto_ver('core/css/style.css'); ?>" rel="stylesheet"> |
| 23 | - <?php if ($page=="pokemon") { ?> |
|
| 23 | + <?php if ($page == "pokemon") { ?> |
|
| 24 | 24 | <link href="<?php auto_ver('core/css/classic-min.css'); ?>" rel="stylesheet"> |
| 25 | 25 | <?php } ?> |
| 26 | 26 | </head> |