@@ -40,22 +40,43 @@ discard block |
||
40 | 40 | } |
41 | 41 | header('Content-Type: text/javascript'); |
42 | 42 | |
43 | -if (!isset($globalJsonCompress)) $compress = true; |
|
44 | -else $compress = $globalJsonCompress; |
|
43 | +if (!isset($globalJsonCompress)) { |
|
44 | + $compress = true; |
|
45 | +} else { |
|
46 | + $compress = $globalJsonCompress; |
|
47 | +} |
|
45 | 48 | |
46 | 49 | $from_archive = false; |
47 | 50 | $min = false; |
48 | 51 | $allhistory = false; |
49 | 52 | $filter['source'] = array(); |
50 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
51 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
52 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
53 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
54 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
55 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
56 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
57 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
58 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
53 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
54 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
55 | +} |
|
56 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
57 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
58 | +} |
|
59 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
60 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
61 | +} |
|
62 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
63 | + $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
64 | +} |
|
65 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
66 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
67 | +} |
|
68 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
69 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
70 | +} |
|
71 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
72 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
73 | +} |
|
74 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
75 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
76 | +} |
|
77 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
78 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
79 | +} |
|
59 | 80 | /* |
60 | 81 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
61 | 82 | $min = true; |
@@ -132,8 +153,12 @@ discard block |
||
132 | 153 | } else { |
133 | 154 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
134 | 155 | } |
135 | - if ($flightcnt == '') $flightcnt = 0; |
|
136 | -} else $flightcnt = 0; |
|
156 | + if ($flightcnt == '') { |
|
157 | + $flightcnt = 0; |
|
158 | + } |
|
159 | + } else { |
|
160 | + $flightcnt = 0; |
|
161 | +} |
|
137 | 162 | |
138 | 163 | $sqltime = round(microtime(true)-$begintime,2); |
139 | 164 | $minitime = time(); |
@@ -156,7 +181,9 @@ discard block |
||
156 | 181 | $j = 0; |
157 | 182 | $prev_flightaware_id = ''; |
158 | 183 | $speed = 1; |
159 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
184 | +if (isset($archivespeed)) { |
|
185 | + $speed = $archivespeed; |
|
186 | +} |
|
160 | 187 | $output = '['; |
161 | 188 | $output .= '{"id" : "document", "name" : "fam","version" : "1.0"'; |
162 | 189 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
@@ -226,7 +253,9 @@ discard block |
||
226 | 253 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
227 | 254 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
228 | 255 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
229 | - } else $aircraft_shadow = ''; |
|
256 | + } else { |
|
257 | + $aircraft_shadow = ''; |
|
258 | + } |
|
230 | 259 | if ($aircraft_shadow != '') { |
231 | 260 | if (isset($modelsdb[$aircraft_shadow])) { |
232 | 261 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20 ,'; |
@@ -323,7 +352,9 @@ discard block |
||
323 | 352 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20,'; |
324 | 353 | $output .= '"heightReference": "'.$heightrelative.'"},'; |
325 | 354 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
326 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
355 | + if ($spotter_item['aircraft_icao'] != '') { |
|
356 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
357 | + } |
|
327 | 358 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
328 | 359 | } |
329 | 360 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -335,7 +366,9 @@ discard block |
||
335 | 366 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20,'; |
336 | 367 | $output .= '"heightReference": "'.$heightrelative.'"},'; |
337 | 368 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
338 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
369 | + if ($spotter_item['aircraft_icao'] != '') { |
|
370 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
371 | + } |
|
339 | 372 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
340 | 373 | } |
341 | 374 | |
@@ -343,7 +376,9 @@ discard block |
||
343 | 376 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20,'; |
344 | 377 | $output .= '"heightReference": "'.$heightrelative.'"},'; |
345 | 378 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
346 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
379 | + if ($spotter_item['aircraft_icao'] != '') { |
|
380 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
381 | + } |
|
347 | 382 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
348 | 383 | } |
349 | 384 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
@@ -356,8 +391,12 @@ discard block |
||
356 | 391 | // $output .= '"interpolationDegree" : 5,'; |
357 | 392 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
358 | 393 | $output .= '"cartographicDegrees": ['; |
359 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
360 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
394 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
395 | + $minitime = strtotime($spotter_item['date']); |
|
396 | + } |
|
397 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
398 | + $maxitime = strtotime($spotter_item['date']); |
|
399 | + } |
|
361 | 400 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
362 | 401 | $output .= $spotter_item['longitude'].', '; |
363 | 402 | $output .= $spotter_item['latitude'].', '; |
@@ -371,7 +410,9 @@ discard block |
||
371 | 410 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
372 | 411 | } else { |
373 | 412 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
374 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
413 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
414 | + $maxitime = strtotime($spotter_item['date']); |
|
415 | + } |
|
375 | 416 | if ($spotter_item['ground_speed'] == 0) { |
376 | 417 | $output .= $prevlong.', '; |
377 | 418 | $output .= $prevlat.', '; |