@@ -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, |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | // When button "Remove all filters" is clicked |
29 | 29 | if (isset($_POST['removefilters'])) { |
30 | 30 | $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
31 | - return strpos($key,'filter_') === 0; |
|
31 | + return strpos($key,'filter_') === 0; |
|
32 | 32 | }); |
33 | 33 | foreach ($allfilters as $filt) { |
34 | 34 | unset($_COOKIE[$filt]); |
@@ -167,17 +167,17 @@ discard block |
||
167 | 167 | } |
168 | 168 | ?> |
169 | 169 | <?php |
170 | - if (isset($_POST['archive'])) { |
|
170 | + if (isset($_POST['archive'])) { |
|
171 | 171 | ?> |
172 | 172 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
173 | 173 | <?php |
174 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
174 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
175 | 175 | ?> |
176 | 176 | |
177 | 177 | <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script> |
178 | 178 | <?php |
179 | - } |
|
180 | - } else { |
|
179 | + } |
|
180 | + } else { |
|
181 | 181 | ?> |
182 | 182 | <?php |
183 | 183 | /* if (isset($globalBeta) && $globalBeta) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | ?> |
191 | 191 | <?php |
192 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
192 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
193 | 193 | ?> |
194 | 194 | <?php |
195 | 195 | // if (isset($globalBeta) && $globalBeta) { |
@@ -216,13 +216,13 @@ discard block |
||
216 | 216 | <script src="<?php print $globalURL; ?>/js/map-marine.2d.js.php?<?php print time(); ?>"></script> |
217 | 217 | <?php |
218 | 218 | } |
219 | - } |
|
219 | + } |
|
220 | 220 | ?> |
221 | 221 | <?php |
222 | 222 | // } |
223 | 223 | ?> |
224 | 224 | <?php |
225 | - } |
|
225 | + } |
|
226 | 226 | } |
227 | 227 | ?> |
228 | 228 | <?php |
@@ -398,24 +398,24 @@ discard block |
||
398 | 398 | <ul class="nav navbar-nav"> |
399 | 399 | |
400 | 400 | <?php |
401 | - $sub = false; |
|
402 | - if (((!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))) || (isset($globalMarine) && $globalMarine === TRUE && isset($globalTracker) && $globalTracker === TRUE)) { |
|
401 | + $sub = false; |
|
402 | + if (((!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))) || (isset($globalMarine) && $globalMarine === TRUE && isset($globalTracker) && $globalTracker === TRUE)) { |
|
403 | 403 | $sub = true; |
404 | - } |
|
404 | + } |
|
405 | 405 | ?> |
406 | 406 | <?php |
407 | - if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
407 | + if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
408 | 408 | ?> |
409 | 409 | <li class="dropdown"> |
410 | 410 | <?php |
411 | - if ($sub) { |
|
411 | + if ($sub) { |
|
412 | 412 | ?> |
413 | 413 | <li class="dropdown"> |
414 | 414 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Aircrafts"); ?> <b class="caret"></b></a> |
415 | 415 | <ul class="dropdown-menu multi-level"> |
416 | 416 | <li class="dropdown-submenu"> |
417 | 417 | <?php |
418 | - } |
|
418 | + } |
|
419 | 419 | ?> |
420 | 420 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
421 | 421 | <ul class="dropdown-menu"> |
@@ -423,15 +423,15 @@ discard block |
||
423 | 423 | <li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li> |
424 | 424 | <li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li> |
425 | 425 | <?php |
426 | - if ((!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM)) { |
|
426 | + if ((!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM)) { |
|
427 | 427 | ?> |
428 | 428 | <li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li> |
429 | 429 | <?php |
430 | - } else { |
|
430 | + } else { |
|
431 | 431 | ?> |
432 | 432 | <li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li> |
433 | 433 | <?php |
434 | - } |
|
434 | + } |
|
435 | 435 | ?> |
436 | 436 | <li><hr /></li> |
437 | 437 | <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li> |
@@ -439,34 +439,34 @@ discard block |
||
439 | 439 | <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li> |
440 | 440 | <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li> |
441 | 441 | <?php |
442 | - if ($globalACARS) { |
|
443 | - if (isset($globalDemo) && $globalDemo) { |
|
444 | - ?> |
|
442 | + if ($globalACARS) { |
|
443 | + if (isset($globalDemo) && $globalDemo) { |
|
444 | + ?> |
|
445 | 445 | <li><hr /></li> |
446 | 446 | <li><i><?php echo _('ACARS data not available publicly'); ?></i></li> |
447 | 447 | <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li> |
448 | 448 | <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li> |
449 | 449 | <?php |
450 | - } else { |
|
451 | - ?> |
|
450 | + } else { |
|
451 | + ?> |
|
452 | 452 | <li><hr /></li> |
453 | 453 | <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li> |
454 | 454 | <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li> |
455 | 455 | <?php |
456 | - } |
|
457 | - } |
|
458 | - ?> |
|
456 | + } |
|
457 | + } |
|
458 | + ?> |
|
459 | 459 | <?php |
460 | - if (isset($globalAccidents) && $globalAccidents) { |
|
461 | - ?> |
|
460 | + if (isset($globalAccidents) && $globalAccidents) { |
|
461 | + ?> |
|
462 | 462 | <li><hr /></li> |
463 | 463 | <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li> |
464 | 464 | <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li> |
465 | 465 | <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li> |
466 | 466 | <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li> |
467 | 467 | <?php |
468 | - } |
|
469 | - ?> |
|
468 | + } |
|
469 | + ?> |
|
470 | 470 | <li><hr /></li> |
471 | 471 | <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li> |
472 | 472 | <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li> |
@@ -489,14 +489,14 @@ discard block |
||
489 | 489 | </ul> |
490 | 490 | <?php |
491 | 491 | } |
492 | - } |
|
492 | + } |
|
493 | 493 | ?> |
494 | 494 | <?php |
495 | - if (isset($globalMarine) && $globalMarine) { |
|
495 | + if (isset($globalMarine) && $globalMarine) { |
|
496 | 496 | ?> |
497 | 497 | <li class="dropdown"> |
498 | 498 | <?php |
499 | - if ($sub) { |
|
499 | + if ($sub) { |
|
500 | 500 | ?> |
501 | 501 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Vessels"); ?> <b class="caret"></b></a> |
502 | 502 | <ul class="dropdown-menu multi-level"> |
@@ -521,14 +521,14 @@ discard block |
||
521 | 521 | } |
522 | 522 | ?> |
523 | 523 | <?php |
524 | - } |
|
524 | + } |
|
525 | 525 | ?> |
526 | 526 | <?php |
527 | - if (isset($globalTracker) && $globalTracker) { |
|
527 | + if (isset($globalTracker) && $globalTracker) { |
|
528 | 528 | ?> |
529 | 529 | <li class="dropdown"> |
530 | 530 | <?php |
531 | - if ($sub) { |
|
531 | + if ($sub) { |
|
532 | 532 | ?> |
533 | 533 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a> |
534 | 534 | <ul class="dropdown-menu multi-level"> |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | } |
554 | 554 | ?> |
555 | 555 | <?php |
556 | - } |
|
556 | + } |
|
557 | 557 | ?> |
558 | 558 | |
559 | 559 | <li class="dropdown"> |
@@ -562,12 +562,12 @@ discard block |
||
562 | 562 | <li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li> |
563 | 563 | <li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li> |
564 | 564 | <?php |
565 | - if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
565 | + if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
566 | 566 | ?> |
567 | 567 | <li><hr /></li> |
568 | 568 | <li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li> |
569 | 569 | <?php |
570 | - } |
|
570 | + } |
|
571 | 571 | ?> |
572 | 572 | <?php if (isset($globalContribute) && $globalContribute) { ?> |
573 | 573 | <li><hr /></li> |
@@ -588,14 +588,14 @@ discard block |
||
588 | 588 | <form> |
589 | 589 | <select class="selectpicker" data-width="120px" onchange="language(this);"> |
590 | 590 | <?php |
591 | - $Language = new Language(); |
|
592 | - $alllang = $Language->getLanguages(); |
|
593 | - foreach ($alllang as $key => $lang) { |
|
594 | - print '<option value="'.$key.'"'; |
|
595 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
596 | - print '>'.$lang[0].'</option>'; |
|
597 | - } |
|
598 | - ?> |
|
591 | + $Language = new Language(); |
|
592 | + $alllang = $Language->getLanguages(); |
|
593 | + foreach ($alllang as $key => $lang) { |
|
594 | + print '<option value="'.$key.'"'; |
|
595 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
596 | + print '>'.$lang[0].'</option>'; |
|
597 | + } |
|
598 | + ?> |
|
599 | 599 | </select> |
600 | 600 | </form> |
601 | 601 | </div> |
@@ -626,18 +626,18 @@ discard block |
||
626 | 626 | ?> |
627 | 627 | <div class="top-header clear" role="main"> |
628 | 628 | <?php |
629 | - if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
629 | + if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
630 | 630 | ?> |
631 | 631 | <div id="archive-map"></div> |
632 | 632 | <?php |
633 | - } |
|
633 | + } |
|
634 | 634 | ?> |
635 | 635 | </div> |
636 | 636 | <?php |
637 | 637 | } |
638 | 638 | if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
639 | 639 | { |
640 | - ?> |
|
640 | + ?> |
|
641 | 641 | <div class="top-header clear" role="main"> |
642 | 642 | <div id="map"></div> |
643 | 643 | <link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" /> |
@@ -648,15 +648,15 @@ discard block |
||
648 | 648 | var zoom = 13; |
649 | 649 | //create the map |
650 | 650 | <?php |
651 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
651 | + if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
652 | 652 | ?> |
653 | 653 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
654 | 654 | <?php |
655 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
655 | + } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
656 | 656 | ?> |
657 | 657 | map = L.map('map', { zoomControl:true }); |
658 | 658 | <?php |
659 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
659 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
660 | 660 | ?> |
661 | 661 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
662 | 662 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -664,22 +664,22 @@ discard block |
||
664 | 664 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
665 | 665 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
666 | 666 | <?php |
667 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
667 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
668 | 668 | ?> |
669 | 669 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
670 | 670 | <?php |
671 | - } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
671 | + } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
672 | 672 | ?> |
673 | 673 | map = L.map('map', { zoomControl:true }); |
674 | 674 | <?php |
675 | - } |
|
675 | + } |
|
676 | 676 | ?> |
677 | 677 | //initialize the layer group for the aircrft markers |
678 | 678 | var layer_data = L.layerGroup(); |
679 | 679 | |
680 | 680 | //a few title layers |
681 | 681 | <?php |
682 | - if ($globalMapProvider == 'Mapbox') { |
|
682 | + if ($globalMapProvider == 'Mapbox') { |
|
683 | 683 | ?> |
684 | 684 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
685 | 685 | maxZoom: 18, |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | token : '<?php print $globalMapboxToken; ?>' |
691 | 691 | }).addTo(map); |
692 | 692 | <?php |
693 | - } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
693 | + } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
694 | 694 | ?> |
695 | 695 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', { |
696 | 696 | maxZoom: 18, |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>' |
700 | 700 | }).addTo(map); |
701 | 701 | <?php |
702 | - } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
702 | + } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
703 | 703 | ?> |
704 | 704 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', { |
705 | 705 | maxZoom: 18, |
@@ -708,27 +708,27 @@ discard block |
||
708 | 708 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"' |
709 | 709 | }).addTo(map); |
710 | 710 | <?php |
711 | - } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
711 | + } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
712 | 712 | ?> |
713 | 713 | var googleLayer = new L.Google('ROADMAP'); |
714 | 714 | map.addLayer(googleLayer); |
715 | 715 | <?php |
716 | - } elseif ($globalMapProvider == 'Google-Satellite') { |
|
716 | + } elseif ($globalMapProvider == 'Google-Satellite') { |
|
717 | 717 | ?> |
718 | 718 | var googleLayer = new L.Google('SATELLITE'); |
719 | 719 | map.addLayer(googleLayer); |
720 | 720 | <?php |
721 | - } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
721 | + } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
722 | 722 | ?> |
723 | 723 | var googleLayer = new L.Google('HYBRID'); |
724 | 724 | map.addLayer(googleLayer); |
725 | 725 | <?php |
726 | - } elseif ($globalMapProvider == 'Google-Terrain') { |
|
726 | + } elseif ($globalMapProvider == 'Google-Terrain') { |
|
727 | 727 | ?> |
728 | 728 | var googleLayer = new L.Google('Terrain'); |
729 | 729 | map.addLayer(googleLayer); |
730 | 730 | <?php |
731 | - } elseif (isset($globalMapCustomLayer[$globalMapProvider])) { |
|
731 | + } elseif (isset($globalMapCustomLayer[$globalMapProvider])) { |
|
732 | 732 | $customid = $globalMapProvider; |
733 | 733 | ?> |
734 | 734 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
@@ -738,8 +738,8 @@ discard block |
||
738 | 738 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
739 | 739 | }).addTo(map); |
740 | 740 | <?php |
741 | - //} elseif ($globalMapProvider == 'OpenStreetMap') { |
|
742 | - } else { |
|
741 | + //} elseif ($globalMapProvider == 'OpenStreetMap') { |
|
742 | + } else { |
|
743 | 743 | ?> |
744 | 744 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
745 | 745 | maxZoom: 18, |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | }).addTo(map); |
749 | 749 | |
750 | 750 | <?php |
751 | - } |
|
751 | + } |
|
752 | 752 | ?> |
753 | 753 | </script> |
754 | 754 | </div> |
@@ -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 |