@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | $s3 = sin($bank/2); |
| 60 | 60 | $c1c2 = $c1*$c2; |
| 61 | 61 | $s1s2 = $s1*$s2; |
| 62 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
| 63 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
| 64 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 65 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 66 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
| 62 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
| 63 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
| 64 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 65 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 66 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
| 67 | 67 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
| 68 | 68 | |
| 69 | 69 | } |
@@ -84,17 +84,17 @@ discard block |
||
| 84 | 84 | $min = false; |
| 85 | 85 | $allhistory = false; |
| 86 | 86 | $filter['source'] = array(); |
| 87 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 88 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 89 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 90 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 91 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 92 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 93 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 94 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 95 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 96 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 97 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 87 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
| 88 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
| 89 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
| 90 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
| 91 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
| 92 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
| 93 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
| 94 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
| 95 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
| 96 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
| 97 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
| 98 | 98 | /* |
| 99 | 99 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 100 | 100 | $min = true; |
@@ -141,12 +141,12 @@ discard block |
||
| 141 | 141 | $from_archive = true; |
| 142 | 142 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 143 | 143 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 144 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
| 145 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
| 146 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
| 147 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 148 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 149 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
| 144 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
| 145 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
| 146 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
| 147 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 148 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 149 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
| 150 | 150 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
| 151 | 151 | $from_archive = true; |
| 152 | 152 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
@@ -156,55 +156,55 @@ discard block |
||
| 156 | 156 | $begindate = $_COOKIE['archive_begin']; |
| 157 | 157 | $enddate = $_COOKIE['archive_end']; |
| 158 | 158 | |
| 159 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
| 160 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 161 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 159 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
| 160 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 161 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 162 | 162 | // echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
| 163 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
| 163 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
| 164 | 164 | } elseif ($tracker) { |
| 165 | 165 | $coord = array(); |
| 166 | 166 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 167 | - $coord = explode(',',$_GET['coord']); |
|
| 168 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
| 167 | + $coord = explode(',', $_GET['coord']); |
|
| 168 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
| 169 | 169 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
| 170 | 170 | $coord = array(); |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
| 173 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
| 174 | 174 | } elseif ($marine) { |
| 175 | 175 | $coord = array(); |
| 176 | 176 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 177 | - $coord = explode(',',$_GET['coord']); |
|
| 178 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
| 177 | + $coord = explode(',', $_GET['coord']); |
|
| 178 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
| 179 | 179 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
| 180 | 180 | $coord = array(); |
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
| 183 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
| 184 | 184 | } else { |
| 185 | 185 | $coord = array(); |
| 186 | 186 | if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { |
| 187 | - $coord = explode(',',$_GET['coord']); |
|
| 188 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
| 187 | + $coord = explode(',', $_GET['coord']); |
|
| 188 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
| 189 | 189 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
| 190 | 190 | $coord = array(); |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | $previous_filter = $filter; |
| 194 | 194 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) { |
| 195 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrack'])); |
|
| 196 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
| 195 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrack'])); |
|
| 196 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
| 197 | 197 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
| 198 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true,$_COOKIE['MapTrack']); |
|
| 198 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true, $_COOKIE['MapTrack']); |
|
| 199 | 199 | } else { |
| 200 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
| 200 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
| 201 | 201 | } |
| 202 | 202 | $filter = $previous_filter; |
| 203 | 203 | } |
| 204 | 204 | //print_r($spotter_array); |
| 205 | 205 | if (!empty($spotter_array) && isset($coord)) { |
| 206 | 206 | if (isset($_GET['archive'])) { |
| 207 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
| 207 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
| 208 | 208 | } elseif ($tracker) { |
| 209 | 209 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
| 210 | 210 | } elseif ($marine) { |
@@ -215,17 +215,17 @@ discard block |
||
| 215 | 215 | if ($flightcnt == '') $flightcnt = 0; |
| 216 | 216 | } else $flightcnt = 0; |
| 217 | 217 | |
| 218 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 218 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 219 | 219 | $minitime = time(); |
| 220 | 220 | $minitracktime_begin = time(); |
| 221 | 221 | $minitracktime = $minitracktime_begin; |
| 222 | 222 | $maxitime = 0; |
| 223 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
| 223 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
| 224 | 224 | $modelsdb = array(); |
| 225 | 225 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
| 226 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
| 227 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
| 228 | - if (isset($row[1]) ){ |
|
| 226 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
| 227 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
| 228 | + if (isset($row[1])) { |
|
| 229 | 229 | $model = $row[0]; |
| 230 | 230 | $modelsdb[$model] = $row[1]; |
| 231 | 231 | } |
@@ -235,9 +235,9 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | $modelsdb2 = array(); |
| 237 | 237 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
| 238 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
| 239 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
| 240 | - if (isset($row[1]) ){ |
|
| 238 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
| 239 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
| 240 | + if (isset($row[1])) { |
|
| 241 | 241 | $model = $row[0]; |
| 242 | 242 | $glb = $row[1]; |
| 243 | 243 | if (isset($row[2])) { |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 282 | 282 | { |
| 283 | 283 | $nblatlong = 0; |
| 284 | - foreach($spotter_array as $spotter_item) |
|
| 284 | + foreach ($spotter_array as $spotter_item) |
|
| 285 | 285 | { |
| 286 | 286 | $j++; |
| 287 | 287 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -323,9 +323,9 @@ discard block |
||
| 323 | 323 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
| 324 | 324 | if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
| 325 | 325 | if ($tracker) { |
| 326 | - $output.= '"type": "tracker"'; |
|
| 326 | + $output .= '"type": "tracker"'; |
|
| 327 | 327 | } elseif ($marine) { |
| 328 | - $output.= '"type": "marine"'; |
|
| 328 | + $output .= '"type": "marine"'; |
|
| 329 | 329 | } else { |
| 330 | 330 | if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
| 331 | 331 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -339,14 +339,14 @@ discard block |
||
| 339 | 339 | if (isset($airline_icao)) { |
| 340 | 340 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
| 341 | 341 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
| 342 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
| 342 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
| 346 | + if ($ident != '') $output .= '"ident": "'.$ident.'",'; |
|
| 347 | 347 | } |
| 348 | - $output.= '"gltf2": %gltf2%,'; |
|
| 349 | - $output.= '"type": "flight"'; |
|
| 348 | + $output .= '"gltf2": %gltf2%,'; |
|
| 349 | + $output .= '"type": "flight"'; |
|
| 350 | 350 | } |
| 351 | 351 | $output .= '},'; |
| 352 | 352 | |
@@ -717,8 +717,8 @@ discard block |
||
| 717 | 717 | $output .= '},'; |
| 718 | 718 | } |
| 719 | 719 | } |
| 720 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 721 | - else $output = str_replace('%onground%','false',$output); |
|
| 720 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
| 721 | + else $output = str_replace('%onground%', 'false', $output); |
|
| 722 | 722 | |
| 723 | 723 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 724 | 724 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
| 735 | 735 | if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); |
| 736 | 736 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 737 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 737 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 738 | 738 | $output .= $spotter_item['longitude'].', '; |
| 739 | 739 | $output .= $spotter_item['latitude']; |
| 740 | 740 | $prevlong = $spotter_item['longitude']; |
@@ -762,8 +762,8 @@ discard block |
||
| 762 | 762 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 763 | 763 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
| 764 | 764 | } else { |
| 765 | - $nblatlong = $nblatlong+1; |
|
| 766 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 765 | + $nblatlong = $nblatlong + 1; |
|
| 766 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 767 | 767 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 768 | 768 | if ($spotter_item['ground_speed'] == 0) { |
| 769 | 769 | $output .= $prevlong.', '; |
@@ -803,21 +803,21 @@ discard block |
||
| 803 | 803 | } |
| 804 | 804 | $output .= ']'; |
| 805 | 805 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 806 | - if ((time()-$globalLiveInterval) > $minitime) { |
|
| 807 | - if (time()-$globalLiveInterval > $maxitime) { |
|
| 808 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
| 806 | + if ((time() - $globalLiveInterval) > $minitime) { |
|
| 807 | + if (time() - $globalLiveInterval > $maxitime) { |
|
| 808 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
| 809 | 809 | } else { |
| 810 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
| 810 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
| 811 | 811 | } |
| 812 | 812 | } |
| 813 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 813 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 814 | 814 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
| 815 | - $output = str_replace('%minitime%',date("c",$minitracktime),$output); |
|
| 815 | + $output = str_replace('%minitime%', date("c", $minitracktime), $output); |
|
| 816 | 816 | } else { |
| 817 | - $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 817 | + $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 818 | 818 | } |
| 819 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
| 820 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
| 821 | -else $output = str_replace('%gltf2%','false',$output); |
|
| 819 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
| 820 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
| 821 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
| 822 | 822 | print $output; |
| 823 | 823 | ?> |
@@ -19,8 +19,12 @@ discard block |
||
| 19 | 19 | } |
| 20 | 20 | $tracker = false; |
| 21 | 21 | $marine = false; |
| 22 | -if (isset($_GET['tracker'])) $tracker = true; |
|
| 23 | -if (isset($_GET['marine'])) $marine = true; |
|
| 22 | +if (isset($_GET['tracker'])) { |
|
| 23 | + $tracker = true; |
|
| 24 | +} |
|
| 25 | +if (isset($_GET['marine'])) { |
|
| 26 | + $marine = true; |
|
| 27 | +} |
|
| 24 | 28 | if ($tracker) { |
| 25 | 29 | require_once('require/class.Tracker.php'); |
| 26 | 30 | require_once('require/class.TrackerLive.php'); |
@@ -77,24 +81,49 @@ discard block |
||
| 77 | 81 | } |
| 78 | 82 | header('Content-Type: text/javascript'); |
| 79 | 83 | |
| 80 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 81 | -else $compress = $globalJsonCompress; |
|
| 84 | +if (!isset($globalJsonCompress)) { |
|
| 85 | + $compress = true; |
|
| 86 | +} else { |
|
| 87 | + $compress = $globalJsonCompress; |
|
| 88 | +} |
|
| 82 | 89 | |
| 83 | 90 | $from_archive = false; |
| 84 | 91 | $min = false; |
| 85 | 92 | $allhistory = false; |
| 86 | 93 | $filter['source'] = array(); |
| 87 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 88 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 89 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 90 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 91 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 92 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 93 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 94 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 95 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 96 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 97 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 94 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
| 95 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 96 | +} |
|
| 97 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
| 98 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 99 | +} |
|
| 100 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
| 101 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 102 | +} |
|
| 103 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
| 104 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 105 | +} |
|
| 106 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
| 107 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 108 | +} |
|
| 109 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
| 110 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 111 | +} |
|
| 112 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
| 113 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 114 | +} |
|
| 115 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
| 116 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 117 | +} |
|
| 118 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
| 119 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 120 | +} |
|
| 121 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
| 122 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 123 | +} |
|
| 124 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
| 125 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 126 | +} |
|
| 98 | 127 | /* |
| 99 | 128 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 100 | 129 | $min = true; |
@@ -212,8 +241,12 @@ discard block |
||
| 212 | 241 | } else { |
| 213 | 242 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
| 214 | 243 | } |
| 215 | - if ($flightcnt == '') $flightcnt = 0; |
|
| 216 | -} else $flightcnt = 0; |
|
| 244 | + if ($flightcnt == '') { |
|
| 245 | + $flightcnt = 0; |
|
| 246 | + } |
|
| 247 | + } else { |
|
| 248 | + $flightcnt = 0; |
|
| 249 | +} |
|
| 217 | 250 | |
| 218 | 251 | $sqltime = round(microtime(true)-$begintime,2); |
| 219 | 252 | $minitime = time(); |
@@ -257,7 +290,9 @@ discard block |
||
| 257 | 290 | $prev_flightaware_id = ''; |
| 258 | 291 | $speed = 1; |
| 259 | 292 | $gltf2 = false; |
| 260 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
| 293 | +if (isset($archivespeed)) { |
|
| 294 | + $speed = $archivespeed; |
|
| 295 | +} |
|
| 261 | 296 | $output = '['; |
| 262 | 297 | if ($tracker) { |
| 263 | 298 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -293,9 +328,13 @@ discard block |
||
| 293 | 328 | $image = "images/placeholder_thumb.png"; |
| 294 | 329 | } |
| 295 | 330 | |
| 296 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
| 297 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
| 298 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
| 331 | + if (isset($spotter_item['flightaware_id'])) { |
|
| 332 | + $id = $spotter_item['flightaware_id']; |
|
| 333 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
| 334 | + $id = $spotter_item['famtrackid']; |
|
| 335 | + } elseif (isset($spotter_item['fammarine_id'])) { |
|
| 336 | + $id = $spotter_item['fammarine_id']; |
|
| 337 | + } |
|
| 299 | 338 | if ($prev_flightaware_id != $id) { |
| 300 | 339 | if ($prev_flightaware_id != '') { |
| 301 | 340 | /* |
@@ -321,7 +360,9 @@ discard block |
||
| 321 | 360 | $output .= '"flightcnt": "'.$flightcnt.'",'; |
| 322 | 361 | $output .= '"onground": %onground%,'; |
| 323 | 362 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
| 324 | - if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
| 363 | + if (isset($spotter_item['format_source'])) { |
|
| 364 | + $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
| 365 | + } |
|
| 325 | 366 | if ($tracker) { |
| 326 | 367 | $output.= '"type": "tracker"'; |
| 327 | 368 | } elseif ($marine) { |
@@ -343,7 +384,9 @@ discard block |
||
| 343 | 384 | } |
| 344 | 385 | } |
| 345 | 386 | } |
| 346 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
| 387 | + if ($ident != '') { |
|
| 388 | + $output.= '"ident": "'.$ident.'",'; |
|
| 389 | + } |
|
| 347 | 390 | } |
| 348 | 391 | $output.= '"gltf2": %gltf2%,'; |
| 349 | 392 | $output.= '"type": "flight"'; |
@@ -375,7 +418,9 @@ discard block |
||
| 375 | 418 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
| 376 | 419 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 377 | 420 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 378 | - } else $aircraft_shadow = ''; |
|
| 421 | + } else { |
|
| 422 | + $aircraft_shadow = ''; |
|
| 423 | + } |
|
| 379 | 424 | $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
| 380 | 425 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
| 381 | 426 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
@@ -383,7 +428,9 @@ discard block |
||
| 383 | 428 | } |
| 384 | 429 | $output .= '},'; |
| 385 | 430 | } |
| 386 | - } else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgK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/E4YXWccP9AAd6dAx+ox/WTArNzY1t64B0f8K0DyLXuUvRGZfcpCo1VX4tg6wB76WMB0dALf526foAX8cqUot2pGP8B2Kz+krBeNYjS8636dh/8Beo2deoA9TWp76pd6g0q9cDNwKvAD8A84EfglLRBe2g+JWAfcEF68bPABOCoAl/gIPA5MA64FVgGnNhP292W3r0SeB1YVlJXAjcBP8XwyQUj9AKwAzg2+/fQSsBhoJxBAaALaIzenZGnD911wA7gEDAD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
| 431 | + } else { |
|
| 432 | + $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/r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pql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
| 433 | + } |
|
| 387 | 434 | } elseif ($one3dmodel) { |
| 388 | 435 | if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
| 389 | 436 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -423,7 +470,9 @@ discard block |
||
| 423 | 470 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
| 424 | 471 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 425 | 472 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 426 | - } else $aircraft_shadow = ''; |
|
| 473 | + } else { |
|
| 474 | + $aircraft_shadow = ''; |
|
| 475 | + } |
|
| 427 | 476 | if ($aircraft_shadow != '') { |
| 428 | 477 | if (isset($modelsdb2[$aircraft_shadow])) { |
| 429 | 478 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/gltf2/'.$modelsdb2[$aircraft_shadow]['glb'].'","scale" : 1.0,"minimumPixelSize": '.$modelsdb2[$aircraft_shadow]['size']; |
@@ -578,7 +627,9 @@ discard block |
||
| 578 | 627 | } |
| 579 | 628 | $output .= '},'; |
| 580 | 629 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 581 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 630 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 631 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 632 | + } |
|
| 582 | 633 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 583 | 634 | } |
| 584 | 635 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -600,7 +651,9 @@ discard block |
||
| 600 | 651 | } |
| 601 | 652 | $output .= '},'; |
| 602 | 653 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 603 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 654 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 655 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 656 | + } |
|
| 604 | 657 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 605 | 658 | } |
| 606 | 659 | } else { |
@@ -613,7 +666,9 @@ discard block |
||
| 613 | 666 | } |
| 614 | 667 | $output .= '},'; |
| 615 | 668 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 616 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 669 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 670 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 671 | + } |
|
| 617 | 672 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 618 | 673 | } |
| 619 | 674 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -717,8 +772,11 @@ discard block |
||
| 717 | 772 | $output .= '},'; |
| 718 | 773 | } |
| 719 | 774 | } |
| 720 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 721 | - else $output = str_replace('%onground%','false',$output); |
|
| 775 | + if (isset($onground) && $onground) { |
|
| 776 | + $output = str_replace('%onground%','true',$output); |
|
| 777 | + } else { |
|
| 778 | + $output = str_replace('%onground%','false',$output); |
|
| 779 | + } |
|
| 722 | 780 | |
| 723 | 781 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 724 | 782 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -731,9 +789,15 @@ discard block |
||
| 731 | 789 | // $output .= '"interpolationDegree" : 5,'; |
| 732 | 790 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
| 733 | 791 | $output .= '"cartographicDegrees": ['; |
| 734 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
| 735 | - if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); |
|
| 736 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
| 792 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
| 793 | + $minitime = strtotime($spotter_item['date']); |
|
| 794 | + } |
|
| 795 | + if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) { |
|
| 796 | + $minitracktime = strtotime($spotter_item['date']); |
|
| 797 | + } |
|
| 798 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
| 799 | + $maxitime = strtotime($spotter_item['date']); |
|
| 800 | + } |
|
| 737 | 801 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
| 738 | 802 | $output .= $spotter_item['longitude'].', '; |
| 739 | 803 | $output .= $spotter_item['latitude']; |
@@ -756,7 +820,9 @@ discard block |
||
| 756 | 820 | $output .= ', '.round($spotter_item['altitude']*30.48); |
| 757 | 821 | $prevalt = round($spotter_item['altitude']*30.48); |
| 758 | 822 | } |
| 759 | - } else $output .= ', 0'; |
|
| 823 | + } else { |
|
| 824 | + $output .= ', 0'; |
|
| 825 | + } |
|
| 760 | 826 | //$orientation = '"orientation" : { '; |
| 761 | 827 | //$orientation .= '"unitQuaternion": ['; |
| 762 | 828 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
@@ -764,13 +830,18 @@ discard block |
||
| 764 | 830 | } else { |
| 765 | 831 | $nblatlong = $nblatlong+1; |
| 766 | 832 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
| 767 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
| 833 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
| 834 | + $maxitime = strtotime($spotter_item['date']); |
|
| 835 | + } |
|
| 768 | 836 | if ($spotter_item['ground_speed'] == 0) { |
| 769 | 837 | $output .= $prevlong.', '; |
| 770 | 838 | $output .= $prevlat; |
| 771 | 839 | //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
| 772 | - if (!$marine) $output .= ', '.$prevalt; |
|
| 773 | - else $output .= ', 0'; |
|
| 840 | + if (!$marine) { |
|
| 841 | + $output .= ', '.$prevalt; |
|
| 842 | + } else { |
|
| 843 | + $output .= ', 0'; |
|
| 844 | + } |
|
| 774 | 845 | } else { |
| 775 | 846 | $output .= $spotter_item['longitude'].', '; |
| 776 | 847 | $output .= $spotter_item['latitude']; |
@@ -783,14 +854,17 @@ discard block |
||
| 783 | 854 | $output .= ', 0'; |
| 784 | 855 | } |
| 785 | 856 | } else { |
| 786 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
| 787 | - elseif ($tracker) { |
|
| 857 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
| 858 | + $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
| 859 | + } elseif ($tracker) { |
|
| 788 | 860 | $output .= ', '.round($spotter_item['altitude']*0.3048); |
| 789 | 861 | } else { |
| 790 | 862 | $output .= ', '.round($spotter_item['altitude']*30.48); |
| 791 | 863 | } |
| 792 | 864 | } |
| 793 | - } else $output .= ', 0'; |
|
| 865 | + } else { |
|
| 866 | + $output .= ', 0'; |
|
| 867 | + } |
|
| 794 | 868 | } |
| 795 | 869 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 796 | 870 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
@@ -809,15 +883,19 @@ discard block |
||
| 809 | 883 | } else { |
| 810 | 884 | $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
| 811 | 885 | } |
| 886 | + } else { |
|
| 887 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 812 | 888 | } |
| 813 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 814 | -} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
|
| 889 | + } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
|
| 815 | 890 | $output = str_replace('%minitime%',date("c",$minitracktime),$output); |
| 816 | 891 | } else { |
| 817 | 892 | $output = str_replace('%minitime%',date("c",$minitime),$output); |
| 818 | 893 | } |
| 819 | 894 | $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
| 820 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
| 821 | -else $output = str_replace('%gltf2%','false',$output); |
|
| 895 | +if ($gltf2) { |
|
| 896 | + $output = str_replace('%gltf2%','true',$output); |
|
| 897 | +} else { |
|
| 898 | + $output = str_replace('%gltf2%','false',$output); |
|
| 899 | +} |
|
| 822 | 900 | print $output; |
| 823 | 901 | ?> |