@@ -5,8 +5,11 @@ discard block |
||
| 5 | 5 | setcookie("MapFormat",'2d'); |
| 6 | 6 | |
| 7 | 7 | // Compressed GeoJson is used if true |
| 8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 9 | -else $compress = $globalJsonCompress; |
|
| 8 | +if (!isset($globalJsonCompress)) { |
|
| 9 | + $compress = true; |
|
| 10 | +} else { |
|
| 11 | + $compress = $globalJsonCompress; |
|
| 12 | +} |
|
| 10 | 13 | if (isset($_GET['archive'])) { |
| 11 | 14 | $archive = true; |
| 12 | 15 | //$archiveupdatetime = 50; |
@@ -17,8 +20,11 @@ discard block |
||
| 17 | 20 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
| 18 | 21 | //$lastupd = 20; |
| 19 | 22 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
| 20 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
| 21 | - else $enddate = time(); |
|
| 23 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
| 24 | + $enddate = $_GET['enddate']; |
|
| 25 | + } else { |
|
| 26 | + $enddate = time(); |
|
| 27 | + } |
|
| 22 | 28 | setcookie("archive_begin",$begindate); |
| 23 | 29 | setcookie("archive_end",$enddate); |
| 24 | 30 | setcookie("archive_update",$lastupd); |
@@ -105,7 +111,17 @@ discard block |
||
| 105 | 111 | } |
| 106 | 112 | |
| 107 | 113 | //create the map |
| 108 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
| 114 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
| 115 | + print $latitude; |
|
| 116 | +} else { |
|
| 117 | + print $globalCenterLatitude; |
|
| 118 | +} |
|
| 119 | +?>,<?php if (isset($longitude)) { |
|
| 120 | + print $longitude; |
|
| 121 | +} else { |
|
| 122 | + print $globalCenterLongitude; |
|
| 123 | +} |
|
| 124 | +?>], zoom); |
|
| 109 | 125 | <?php |
| 110 | 126 | } else { |
| 111 | 127 | ?> |
@@ -118,9 +134,19 @@ discard block |
||
| 118 | 134 | || navigator.userAgent.match(/BlackBerry/i) |
| 119 | 135 | || navigator.userAgent.match(/Windows Phone/i)) |
| 120 | 136 | { |
| 121 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
| 137 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
| 138 | + print $globalLiveZoom-1; |
|
| 139 | +} else { |
|
| 140 | + print '8'; |
|
| 141 | +} |
|
| 142 | +?>; |
|
| 122 | 143 | } else { |
| 123 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
| 144 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
| 145 | + print $globalLiveZoom; |
|
| 146 | +} else { |
|
| 147 | + print '9'; |
|
| 148 | +} |
|
| 149 | +?>; |
|
| 124 | 150 | } |
| 125 | 151 | |
| 126 | 152 | //create the map |
@@ -145,16 +171,27 @@ discard block |
||
| 145 | 171 | bounds = L.latLngBounds(southWest,northEast); |
| 146 | 172 | //a few title layers |
| 147 | 173 | <?php |
| 148 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
| 149 | - else $MapType = $globalMapProvider; |
|
| 174 | + if (isset($_COOKIE['MapType'])) { |
|
| 175 | + $MapType = $_COOKIE['MapType']; |
|
| 176 | + } else { |
|
| 177 | + $MapType = $globalMapProvider; |
|
| 178 | + } |
|
| 150 | 179 | |
| 151 | 180 | if ($MapType == 'Mapbox') { |
| 152 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
| 153 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 154 | -?> |
|
| 181 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
| 182 | + $MapBoxId = $globalMapboxId; |
|
| 183 | + } else { |
|
| 184 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 185 | + } |
|
| 186 | + ?> |
|
| 155 | 187 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
| 156 | 188 | maxZoom: 18, |
| 157 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 189 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 190 | + print 'false'; |
|
| 191 | +} else { |
|
| 192 | + print 'true'; |
|
| 193 | +} |
|
| 194 | +?>, |
|
| 158 | 195 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
| 159 | 196 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
| 160 | 197 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -166,7 +203,12 @@ discard block |
||
| 166 | 203 | ?> |
| 167 | 204 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
| 168 | 205 | maxZoom: 18, |
| 169 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 206 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 207 | + print 'false'; |
|
| 208 | +} else { |
|
| 209 | + print 'true'; |
|
| 210 | +} |
|
| 211 | +?>, |
|
| 170 | 212 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
| 171 | 213 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
| 172 | 214 | }).addTo(map); |
@@ -212,20 +254,26 @@ discard block |
||
| 212 | 254 | map.addLayer(yandexLayer); |
| 213 | 255 | <?php |
| 214 | 256 | } elseif ($MapType == 'Bing-Aerial') { |
| 215 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 216 | -?> |
|
| 257 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 258 | + setcookie('MapType','OpenStreetMap'); |
|
| 259 | + } |
|
| 260 | + ?> |
|
| 217 | 261 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
| 218 | 262 | map.addLayer(bingLayer); |
| 219 | 263 | <?php |
| 220 | 264 | } elseif ($MapType == 'Bing-Hybrid') { |
| 221 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 222 | -?> |
|
| 265 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 266 | + setcookie('MapType','OpenStreetMap'); |
|
| 267 | + } |
|
| 268 | + ?> |
|
| 223 | 269 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
| 224 | 270 | map.addLayer(bingLayer); |
| 225 | 271 | <?php |
| 226 | 272 | } elseif ($MapType == 'Bing-Road') { |
| 227 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
| 228 | -?> |
|
| 273 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
| 274 | + setcookie('MapType','OpenStreetMap'); |
|
| 275 | + } |
|
| 276 | + ?> |
|
| 229 | 277 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
| 230 | 278 | map.addLayer(bingLayer); |
| 231 | 279 | <?php |
@@ -248,9 +296,24 @@ discard block |
||
| 248 | 296 | $customid = $MapType; |
| 249 | 297 | ?> |
| 250 | 298 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
| 251 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
| 252 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
| 253 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 299 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
| 300 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
| 301 | +} else { |
|
| 302 | + print '18'; |
|
| 303 | +} |
|
| 304 | +?>, |
|
| 305 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
| 306 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
| 307 | +} else { |
|
| 308 | + print '0'; |
|
| 309 | +} |
|
| 310 | +?>, |
|
| 311 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 312 | + print 'false'; |
|
| 313 | +} else { |
|
| 314 | + print 'true'; |
|
| 315 | +} |
|
| 316 | +?>, |
|
| 254 | 317 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
| 255 | 318 | }).addTo(map); |
| 256 | 319 | |
@@ -284,7 +347,12 @@ discard block |
||
| 284 | 347 | } |
| 285 | 348 | } elseif ($globalBounding == 'circle') { |
| 286 | 349 | ?> |
| 287 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
| 350 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
| 351 | + print $globalBoundingCircleSize; |
|
| 352 | +} else { |
|
| 353 | + print '70000'; |
|
| 354 | +} |
|
| 355 | +?>,{ |
|
| 288 | 356 | color: '#92C7D1', |
| 289 | 357 | fillColor: '#92C7D1', |
| 290 | 358 | fillOpacity: 0.3, |
@@ -5,8 +5,11 @@ discard block |
||
| 5 | 5 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
| 6 | 6 | $current_page = $file_path['filename']; |
| 7 | 7 | date_default_timezone_set($globalTimezone); |
| 8 | -if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
|
| 9 | -else $MapType = $globalMapProvider; |
|
| 8 | +if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') { |
|
| 9 | + $MapType = $_COOKIE['MapType']; |
|
| 10 | +} else { |
|
| 11 | + $MapType = $globalMapProvider; |
|
| 12 | +} |
|
| 10 | 13 | if (isset($_GET['3d'])) { |
| 11 | 14 | setcookie('MapFormat','3d'); |
| 12 | 15 | } else if (isset($_GET['2d'])) { |
@@ -240,7 +243,13 @@ discard block |
||
| 240 | 243 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
| 241 | 244 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
| 242 | 245 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
| 243 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
| 246 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
| 247 | + print '&latitude='.$latitude; |
|
| 248 | +} |
|
| 249 | +?><?php if(isset($longitude)) { |
|
| 250 | + print '&longitude='.$longitude; |
|
| 251 | +} |
|
| 252 | +?>&<?php print time(); ?>"></script> |
|
| 244 | 253 | <?php |
| 245 | 254 | if (!isset($type) || $type == 'aircraft') { |
| 246 | 255 | ?> |
@@ -310,7 +319,13 @@ discard block |
||
| 310 | 319 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
| 311 | 320 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
| 312 | 321 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
| 313 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
| 322 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
| 323 | + print '&latitude='.$latitude; |
|
| 324 | +} |
|
| 325 | +?><?php if(isset($longitude)) { |
|
| 326 | + print '&longitude='.$longitude; |
|
| 327 | +} |
|
| 328 | +?>&<?php print time(); ?>"></script> |
|
| 314 | 329 | <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script> |
| 315 | 330 | <?php |
| 316 | 331 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
@@ -391,7 +406,12 @@ discard block |
||
| 391 | 406 | <span class="icon-bar"></span> |
| 392 | 407 | </button> |
| 393 | 408 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a> |
| 394 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
| 409 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
| 410 | + print '/'; |
|
| 411 | +} else { |
|
| 412 | + print $globalURL; |
|
| 413 | +} |
|
| 414 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
| 395 | 415 | </div> |
| 396 | 416 | <div class="collapse navbar-collapse"> |
| 397 | 417 | |
@@ -417,7 +437,10 @@ discard block |
||
| 417 | 437 | <?php |
| 418 | 438 | } |
| 419 | 439 | ?> |
| 420 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 440 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 441 | + echo 'right-'; |
|
| 442 | +} |
|
| 443 | +?>caret"></b></a> |
|
| 421 | 444 | <ul class="dropdown-menu"> |
| 422 | 445 | <li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li> |
| 423 | 446 | <li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li> |
@@ -474,8 +497,14 @@ discard block |
||
| 474 | 497 | </li> |
| 475 | 498 | <li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li> |
| 476 | 499 | <li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li> |
| 477 | - <li class="dropdown<?php if ($sub) echo '-submenu'; ?>"> |
|
| 478 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 500 | + <li class="dropdown<?php if ($sub) { |
|
| 501 | + echo '-submenu'; |
|
| 502 | +} |
|
| 503 | +?>"> |
|
| 504 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) { |
|
| 505 | + echo 'right-'; |
|
| 506 | +} |
|
| 507 | +?>caret"></b></a> |
|
| 479 | 508 | <ul class="dropdown-menu"> |
| 480 | 509 | <li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li> |
| 481 | 510 | <li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li> |
@@ -504,7 +533,10 @@ discard block |
||
| 504 | 533 | <?php |
| 505 | 534 | } |
| 506 | 535 | ?> |
| 507 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 536 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 537 | + echo 'right-'; |
|
| 538 | +} |
|
| 539 | +?>caret"></b></a> |
|
| 508 | 540 | <ul class="dropdown-menu"> |
| 509 | 541 | <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li> |
| 510 | 542 | <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -536,7 +568,10 @@ discard block |
||
| 536 | 568 | <?php |
| 537 | 569 | } |
| 538 | 570 | ?> |
| 539 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 571 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 572 | + echo 'right-'; |
|
| 573 | +} |
|
| 574 | +?>caret"></b></a> |
|
| 540 | 575 | <ul class="dropdown-menu"> |
| 541 | 576 | <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li> |
| 542 | 577 | <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -592,7 +627,9 @@ discard block |
||
| 592 | 627 | $alllang = $Language->getLanguages(); |
| 593 | 628 | foreach ($alllang as $key => $lang) { |
| 594 | 629 | print '<option value="'.$key.'"'; |
| 595 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
| 630 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
| 631 | + print ' selected '; |
|
| 632 | + } |
|
| 596 | 633 | print '>'.$lang[0].'</option>'; |
| 597 | 634 | } |
| 598 | 635 | ?> |
@@ -732,9 +769,24 @@ discard block |
||
| 732 | 769 | $customid = $globalMapProvider; |
| 733 | 770 | ?> |
| 734 | 771 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
| 735 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
| 736 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
| 737 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 772 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
| 773 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
| 774 | +} else { |
|
| 775 | + print '18'; |
|
| 776 | +} |
|
| 777 | +?>, |
|
| 778 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
| 779 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
| 780 | +} else { |
|
| 781 | + print '0'; |
|
| 782 | +} |
|
| 783 | +?>, |
|
| 784 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 785 | + print 'false'; |
|
| 786 | +} else { |
|
| 787 | + print 'true'; |
|
| 788 | +} |
|
| 789 | +?>, |
|
| 738 | 790 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
| 739 | 791 | }).addTo(map); |
| 740 | 792 | <?php |
@@ -757,4 +809,7 @@ discard block |
||
| 757 | 809 | |
| 758 | 810 | ?> |
| 759 | 811 | |
| 760 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
| 812 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
| 813 | + print 'index '; |
|
| 814 | +} |
|
| 815 | +?>clear"> |
|
@@ -9,14 +9,14 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | $from_archive = false; |
| 11 | 11 | if (isset($_GET['ident'])) { |
| 12 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 12 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 13 | 13 | if (isset($_GET['currenttime'])) { |
| 14 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
| 14 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
| 15 | 15 | $currenttime = round($currenttime/1000); |
| 16 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident,$currenttime); |
|
| 16 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident, $currenttime); |
|
| 17 | 17 | if (empty($spotter_array)) { |
| 18 | 18 | $from_archive = true; |
| 19 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident,$currenttime); |
|
| 19 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident, $currenttime); |
|
| 20 | 20 | } |
| 21 | 21 | } else { |
| 22 | 22 | $spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident); |
@@ -27,15 +27,15 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | if (isset($_GET['flightaware_id'])) { |
| 30 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 30 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 31 | 31 | if (isset($_GET['currenttime'])) { |
| 32 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
| 32 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
| 33 | 33 | $currenttime = round($currenttime/1000); |
| 34 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id,$currenttime); |
|
| 34 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id, $currenttime); |
|
| 35 | 35 | if (empty($spotter_array)) { |
| 36 | 36 | $from_archive = true; |
| 37 | 37 | // $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
| 38 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id,$currenttime); |
|
| 38 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id, $currenttime); |
|
| 39 | 39 | } |
| 40 | 40 | } else { |
| 41 | 41 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "") |
| 55 | 55 | { |
| 56 | 56 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 57 | - $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 57 | + $image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
| 58 | 58 | } else $image = $spotter_item['image_thumbnail']; |
| 59 | 59 | |
| 60 | 60 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
| 73 | 73 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
| 74 | 74 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 75 | - print '<br /><span class="time">'.date('H:m',$spotter_item['departure_airport_time']).'</span>'; |
|
| 75 | + print '<br /><span class="time">'.date('H:m', $spotter_item['departure_airport_time']).'</span>'; |
|
| 76 | 76 | } else { |
| 77 | 77 | print '<br /><span class="time">'.$spotter_item['departure_airport_time'].'</span>'; |
| 78 | 78 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country']; |
| 82 | 82 | if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
| 83 | 83 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 84 | - print '<br /><span class="time">'.date('H:m',$spotter_item['arrival_airport_time']).'</span>'; |
|
| 84 | + print '<br /><span class="time">'.date('H:m', $spotter_item['arrival_airport_time']).'</span>'; |
|
| 85 | 85 | } else { |
| 86 | 86 | print '<br /><span class="time">'.$spotter_item['arrival_airport_time'].'</span>'; |
| 87 | 87 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
| 153 | 153 | if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
| 154 | -if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 154 | +if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br/>', $spotter_item['acars']['message'])).'</div>'; |
|
| 155 | 155 | if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
| 156 | 156 | print '</div>'; |
| 157 | 157 | ?> |
@@ -55,7 +55,9 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 57 | 57 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 58 | - } else $image = $spotter_item['image_thumbnail']; |
|
| 58 | + } else { |
|
| 59 | + $image = $spotter_item['image_thumbnail']; |
|
| 60 | + } |
|
| 59 | 61 | |
| 60 | 62 | } |
| 61 | 63 | /* else { |
@@ -67,7 +69,9 @@ discard block |
||
| 67 | 69 | print '<div class="left"><img src="'.$image.'" alt="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].'" title="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' Image © '.$spotter_item['image_copyright'].'"/><br />Image © '.$spotter_item['image_copyright'].'</div>'; |
| 68 | 70 | } |
| 69 | 71 | print '<div class="right"><div class="callsign-details"><div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a></div>'; |
| 70 | -if (isset($spotter_item['airline_name'])) print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
| 72 | +if (isset($spotter_item['airline_name'])) { |
|
| 73 | + print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
| 74 | +} |
|
| 71 | 75 | print '</div>'; |
| 72 | 76 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
| 73 | 77 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
@@ -95,9 +99,14 @@ discard block |
||
| 95 | 99 | print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country']; |
| 96 | 100 | print '</div></div><div id="aircraft">'; |
| 97 | 101 | print '<span>'._("Aircraft").'</span>'; |
| 98 | -if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
| 99 | -if (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 100 | -else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
| 102 | +if (isset($spotter_item['aircraft_wiki'])) { |
|
| 103 | + print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
| 104 | +} |
|
| 105 | +if (isset($spotter_item['aircraft_type'])) { |
|
| 106 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 107 | +} else { |
|
| 108 | + print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
| 109 | +} |
|
| 101 | 110 | print '</div>'; |
| 102 | 111 | print '<div id ="altitude"><span>'._("Altitude").'</span>'; |
| 103 | 112 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
@@ -106,7 +115,9 @@ discard block |
||
| 106 | 115 | print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
| 107 | 116 | } |
| 108 | 117 | print '</div>'; |
| 109 | -if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
| 118 | +if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') { |
|
| 119 | + print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
| 120 | +} |
|
| 110 | 121 | print '<div id="speed"><span>'._("Speed").'</span>'; |
| 111 | 122 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
| 112 | 123 | print round($spotter_item['ground_speed']*1.15078).' mph'; |
@@ -120,8 +131,11 @@ discard block |
||
| 120 | 131 | print '<div id="heading"><span>'._("Heading").'</span>'.$spotter_item['heading'].'°</div>'; |
| 121 | 132 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') { |
| 122 | 133 | print '<div id="pilot"><span>'._("Pilot").'</span>'; |
| 123 | - if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 124 | - else print $spotter_item['pilot_name']; |
|
| 134 | + if (isset($spotter_item['pilot_id'])) { |
|
| 135 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 136 | + } else { |
|
| 137 | + print $spotter_item['pilot_name']; |
|
| 138 | + } |
|
| 125 | 139 | print '</div>'; |
| 126 | 140 | } |
| 127 | 141 | |
@@ -149,10 +163,18 @@ discard block |
||
| 149 | 163 | print '</div>'; |
| 150 | 164 | print '</div>'; |
| 151 | 165 | |
| 152 | -if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
| 153 | -if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
| 154 | -if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 155 | -if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
| 166 | +if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') { |
|
| 167 | + print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
| 168 | +} |
|
| 169 | +if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') { |
|
| 170 | + print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
| 171 | +} |
|
| 172 | +if (isset($spotter_item['acars']['message'])) { |
|
| 173 | + print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 174 | +} |
|
| 175 | +if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) { |
|
| 176 | + print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
| 177 | +} |
|
| 156 | 178 | print '</div>'; |
| 157 | 179 | ?> |
| 158 | 180 | </div> |
| 159 | 181 | \ No newline at end of file |