@@ -254,6 +254,7 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @param String $aircraft_registration the registration of the aircraft |
256 | 256 | * @param String $aircraft_name type of the aircraft |
257 | + * @param string $type |
|
257 | 258 | * @return Array the aircraft thumbnail, orignal url and copyright |
258 | 259 | * |
259 | 260 | */ |
@@ -287,6 +288,7 @@ discard block |
||
287 | 288 | * |
288 | 289 | * @param String $registration the registration of the aircraft |
289 | 290 | * @param String $name type of the aircraft |
291 | + * @param string $type |
|
290 | 292 | * @return Array the aircraft thumbnail, orignal url and copyright |
291 | 293 | * |
292 | 294 | */ |
@@ -325,6 +327,7 @@ discard block |
||
325 | 327 | * |
326 | 328 | * @param String $aircraft_registration the registration of the aircraft |
327 | 329 | * @param String $aircraft_name type of the aircraft |
330 | + * @param string $type |
|
328 | 331 | * @return Array the aircraft thumbnail, orignal url and copyright |
329 | 332 | * |
330 | 333 | */ |
@@ -367,6 +370,7 @@ discard block |
||
367 | 370 | * |
368 | 371 | * @param String $aircraft_registration the registration of the aircraft |
369 | 372 | * @param String $aircraft_name type of the aircraft |
373 | + * @param string $type |
|
370 | 374 | * @return Array the aircraft thumbnail, orignal url and copyright |
371 | 375 | * |
372 | 376 | */ |
@@ -401,6 +405,7 @@ discard block |
||
401 | 405 | * |
402 | 406 | * @param String $registration the registration of the aircraft |
403 | 407 | * @param String $name type of the aircraft |
408 | + * @param string $type |
|
404 | 409 | * @return Array the aircraft thumbnail, orignal url and copyright |
405 | 410 | * |
406 | 411 | */ |
@@ -429,6 +434,10 @@ discard block |
||
429 | 434 | return false; |
430 | 435 | } |
431 | 436 | |
437 | + /** |
|
438 | + * @param string $type |
|
439 | + * @param string $aircraft_icao |
|
440 | + */ |
|
432 | 441 | public function fromIvaoMtl($type,$aircraft_icao,$airline_icao) { |
433 | 442 | $Common = new Common(); |
434 | 443 | //echo "\n".'SEARCH IMAGE : http://mtlcatalog.ivao.aero/images/aircraft/'.$aircraft_icao.$airline_icao.'.jpg'; |
@@ -450,6 +459,7 @@ discard block |
||
450 | 459 | * |
451 | 460 | * @param String $aircraft_registration the registration of the aircraft |
452 | 461 | * @param String $aircraft_name type of the aircraft |
462 | + * @param string $type |
|
453 | 463 | * @return Array the aircraft thumbnail, orignal url and copyright |
454 | 464 | * |
455 | 465 | */ |
@@ -482,6 +492,7 @@ discard block |
||
482 | 492 | * |
483 | 493 | * @param String $aircraft_registration the registration of the aircraft |
484 | 494 | * @param String $aircraft_name type of the aircraft |
495 | + * @param string $type |
|
485 | 496 | * @return Array the aircraft thumbnail, orignal url and copyright |
486 | 497 | * |
487 | 498 | */ |
@@ -507,6 +518,7 @@ discard block |
||
507 | 518 | * |
508 | 519 | * @param String $registration the registration of the aircraft/mmsi |
509 | 520 | * @param String $name name |
521 | + * @param string $type |
|
510 | 522 | * @return Array the aircraft thumbnail, orignal url and copyright |
511 | 523 | * |
512 | 524 | */ |
@@ -568,6 +580,7 @@ discard block |
||
568 | 580 | * |
569 | 581 | * @param String $registration the registration of the aircraft |
570 | 582 | * @param String $name type of the aircraft |
583 | + * @param string $type |
|
571 | 584 | * @return Array the aircraft thumbnail, orignal url and copyright |
572 | 585 | * |
573 | 586 | */ |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | /** |
15 | - * Gets the images based on the aircraft registration |
|
16 | - * |
|
17 | - * @return Array the images list |
|
18 | - * |
|
19 | - */ |
|
15 | + * Gets the images based on the aircraft registration |
|
16 | + * |
|
17 | + * @return Array the images list |
|
18 | + * |
|
19 | + */ |
|
20 | 20 | public function getSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
21 | 21 | { |
22 | 22 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * Gets the images based on the ship name |
|
41 | - * |
|
42 | - * @return Array the images list |
|
43 | - * |
|
44 | - */ |
|
40 | + * Gets the images based on the ship name |
|
41 | + * |
|
42 | + * @return Array the images list |
|
43 | + * |
|
44 | + */ |
|
45 | 45 | public function getMarineImage($mmsi,$imo = '',$name = '') |
46 | 46 | { |
47 | 47 | $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * Gets the image copyright based on the Exif data |
|
72 | - * |
|
73 | - * @return String image copyright |
|
74 | - * |
|
75 | - */ |
|
71 | + * Gets the image copyright based on the Exif data |
|
72 | + * |
|
73 | + * @return String image copyright |
|
74 | + * |
|
75 | + */ |
|
76 | 76 | public function getExifCopyright($url) { |
77 | 77 | $exif = exif_read_data($url); |
78 | 78 | $copyright = ''; |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * Adds the images based on the aircraft registration |
|
91 | - * |
|
92 | - * @return String either success or error |
|
93 | - * |
|
94 | - */ |
|
90 | + * Adds the images based on the aircraft registration |
|
91 | + * |
|
92 | + * @return String either success or error |
|
93 | + * |
|
94 | + */ |
|
95 | 95 | public function addSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
96 | 96 | { |
97 | 97 | global $globalDebug,$globalAircraftImageFetch; |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
122 | - * Adds the images based on the marine name |
|
123 | - * |
|
124 | - * @return String either success or error |
|
125 | - * |
|
126 | - */ |
|
122 | + * Adds the images based on the marine name |
|
123 | + * |
|
124 | + * @return String either success or error |
|
125 | + * |
|
126 | + */ |
|
127 | 127 | public function addMarineImage($mmsi,$imo = '',$name = '') |
128 | 128 | { |
129 | 129 | global $globalDebug,$globalMarineImageFetch; |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
163 | - * Gets the aircraft image |
|
164 | - * |
|
165 | - * @param String $aircraft_registration the registration of the aircraft |
|
166 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
167 | - * |
|
168 | - */ |
|
163 | + * Gets the aircraft image |
|
164 | + * |
|
165 | + * @param String $aircraft_registration the registration of the aircraft |
|
166 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
167 | + * |
|
168 | + */ |
|
169 | 169 | public function findAircraftImage($aircraft_registration, $aircraft_icao = '', $airline_icao = '') |
170 | 170 | { |
171 | 171 | global $globalAircraftImageSources, $globalIVAO, $globalAircraftImageCheckICAO; |
@@ -209,14 +209,14 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
212 | - * Gets the vessel image |
|
213 | - * |
|
214 | - * @param String $mmsi the vessel mmsi |
|
215 | - * @param String $imo the vessel imo |
|
216 | - * @param String $name the vessel name |
|
217 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
218 | - * |
|
219 | - */ |
|
212 | + * Gets the vessel image |
|
213 | + * |
|
214 | + * @param String $mmsi the vessel mmsi |
|
215 | + * @param String $imo the vessel imo |
|
216 | + * @param String $name the vessel name |
|
217 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
218 | + * |
|
219 | + */ |
|
220 | 220 | public function findMarineImage($mmsi,$imo = '',$name = '') |
221 | 221 | { |
222 | 222 | global $globalMarineImageSources; |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
253 | - * Gets the aircraft image from Planespotters |
|
254 | - * |
|
255 | - * @param String $aircraft_registration the registration of the aircraft |
|
256 | - * @param String $aircraft_name type of the aircraft |
|
257 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
258 | - * |
|
259 | - */ |
|
253 | + * Gets the aircraft image from Planespotters |
|
254 | + * |
|
255 | + * @param String $aircraft_registration the registration of the aircraft |
|
256 | + * @param String $aircraft_name type of the aircraft |
|
257 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
258 | + * |
|
259 | + */ |
|
260 | 260 | public function fromPlanespotters($type,$aircraft_registration, $aircraft_name='') { |
261 | 261 | $Common = new Common(); |
262 | 262 | // If aircraft registration is only number, also check with aircraft model |
@@ -283,13 +283,13 @@ discard block |
||
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
286 | - * Gets the aircraft image from Deviantart |
|
287 | - * |
|
288 | - * @param String $registration the registration of the aircraft |
|
289 | - * @param String $name type of the aircraft |
|
290 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
291 | - * |
|
292 | - */ |
|
286 | + * Gets the aircraft image from Deviantart |
|
287 | + * |
|
288 | + * @param String $registration the registration of the aircraft |
|
289 | + * @param String $name type of the aircraft |
|
290 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
291 | + * |
|
292 | + */ |
|
293 | 293 | public function fromDeviantart($type,$registration, $name='') { |
294 | 294 | $Common = new Common(); |
295 | 295 | if ($type == 'aircraft') { |
@@ -321,13 +321,13 @@ discard block |
||
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
324 | - * Gets the aircraft image from JetPhotos |
|
325 | - * |
|
326 | - * @param String $aircraft_registration the registration of the aircraft |
|
327 | - * @param String $aircraft_name type of the aircraft |
|
328 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
329 | - * |
|
330 | - */ |
|
324 | + * Gets the aircraft image from JetPhotos |
|
325 | + * |
|
326 | + * @param String $aircraft_registration the registration of the aircraft |
|
327 | + * @param String $aircraft_name type of the aircraft |
|
328 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
329 | + * |
|
330 | + */ |
|
331 | 331 | public function fromJetPhotos($type,$aircraft_registration, $aircraft_name='') { |
332 | 332 | $Common = new Common(); |
333 | 333 | $url= 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | } |
364 | 364 | |
365 | 365 | /** |
366 | - * Gets the aircraft image from PlanePictures |
|
367 | - * |
|
368 | - * @param String $aircraft_registration the registration of the aircraft |
|
369 | - * @param String $aircraft_name type of the aircraft |
|
370 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
371 | - * |
|
372 | - */ |
|
366 | + * Gets the aircraft image from PlanePictures |
|
367 | + * |
|
368 | + * @param String $aircraft_registration the registration of the aircraft |
|
369 | + * @param String $aircraft_name type of the aircraft |
|
370 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
371 | + * |
|
372 | + */ |
|
373 | 373 | public function fromPlanePictures($type,$aircraft_registration, $aircraft_name='') { |
374 | 374 | $Common = new Common(); |
375 | 375 | $url= 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | /** |
400 | - * Gets the aircraft image from Flickr |
|
401 | - * |
|
402 | - * @param String $registration the registration of the aircraft |
|
403 | - * @param String $name type of the aircraft |
|
404 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
405 | - * |
|
406 | - */ |
|
400 | + * Gets the aircraft image from Flickr |
|
401 | + * |
|
402 | + * @param String $registration the registration of the aircraft |
|
403 | + * @param String $name type of the aircraft |
|
404 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
405 | + * |
|
406 | + */ |
|
407 | 407 | public function fromFlickr($type,$registration,$name='') { |
408 | 408 | $Common = new Common(); |
409 | 409 | if ($type == 'aircraft') { |
@@ -446,13 +446,13 @@ discard block |
||
446 | 446 | } |
447 | 447 | |
448 | 448 | /** |
449 | - * Gets the aircraft image from Bing |
|
450 | - * |
|
451 | - * @param String $aircraft_registration the registration of the aircraft |
|
452 | - * @param String $aircraft_name type of the aircraft |
|
453 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
454 | - * |
|
455 | - */ |
|
449 | + * Gets the aircraft image from Bing |
|
450 | + * |
|
451 | + * @param String $aircraft_registration the registration of the aircraft |
|
452 | + * @param String $aircraft_name type of the aircraft |
|
453 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
454 | + * |
|
455 | + */ |
|
456 | 456 | public function fromBing($type,$aircraft_registration,$aircraft_name='') { |
457 | 457 | global $globalImageBingKey; |
458 | 458 | $Common = new Common(); |
@@ -478,13 +478,13 @@ discard block |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | /** |
481 | - * Gets the aircraft image from airport-data |
|
482 | - * |
|
483 | - * @param String $aircraft_registration the registration of the aircraft |
|
484 | - * @param String $aircraft_name type of the aircraft |
|
485 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
486 | - * |
|
487 | - */ |
|
481 | + * Gets the aircraft image from airport-data |
|
482 | + * |
|
483 | + * @param String $aircraft_registration the registration of the aircraft |
|
484 | + * @param String $aircraft_name type of the aircraft |
|
485 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
486 | + * |
|
487 | + */ |
|
488 | 488 | public function fromAirportData($type,$aircraft_registration,$aircraft_name='') { |
489 | 489 | $Common = new Common(); |
490 | 490 | $url = 'http://www.airport-data.com/api/ac_thumb.json?&n=1&r='.$aircraft_registration; |
@@ -503,13 +503,13 @@ discard block |
||
503 | 503 | } |
504 | 504 | |
505 | 505 | /** |
506 | - * Gets image from WikiMedia |
|
507 | - * |
|
508 | - * @param String $registration the registration of the aircraft/mmsi |
|
509 | - * @param String $name name |
|
510 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
511 | - * |
|
512 | - */ |
|
506 | + * Gets image from WikiMedia |
|
507 | + * |
|
508 | + * @param String $registration the registration of the aircraft/mmsi |
|
509 | + * @param String $name name |
|
510 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
511 | + * |
|
512 | + */ |
|
513 | 513 | public function fromWikimedia($type,$registration,$name='') { |
514 | 514 | $Common = new Common(); |
515 | 515 | if ($type == 'aircraft') { |
@@ -564,13 +564,13 @@ discard block |
||
564 | 564 | } |
565 | 565 | |
566 | 566 | /** |
567 | - * Gets the aircraft image from custom url |
|
568 | - * |
|
569 | - * @param String $registration the registration of the aircraft |
|
570 | - * @param String $name type of the aircraft |
|
571 | - * @return Array the aircraft thumbnail, orignal url and copyright |
|
572 | - * |
|
573 | - */ |
|
567 | + * Gets the aircraft image from custom url |
|
568 | + * |
|
569 | + * @param String $registration the registration of the aircraft |
|
570 | + * @param String $name type of the aircraft |
|
571 | + * @return Array the aircraft thumbnail, orignal url and copyright |
|
572 | + * |
|
573 | + */ |
|
574 | 574 | public function fromCustomSource($type,$registration,$name='') { |
575 | 575 | global $globalAircraftImageCustomSources, $globalMarineImageCustomSources, $globalDebug; |
576 | 576 | //$globalAircraftImageCustomSource[] = array('thumbnail' => '','original' => '', 'copyright' => '', 'source_website' => '', 'source' => '','exif' => true); |
@@ -17,22 +17,22 @@ discard block |
||
17 | 17 | * @return Array the images list |
18 | 18 | * |
19 | 19 | */ |
20 | - public function getSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
|
20 | + public function getSpotterImage($registration, $aircraft_icao = '', $airline_icao = '') |
|
21 | 21 | { |
22 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
23 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
24 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
22 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
23 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
24 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
25 | 25 | $reg = $registration; |
26 | 26 | if ($reg == '' && $aircraft_icao != '') $reg = $aircraft_icao.$airline_icao; |
27 | 27 | $reg = trim($reg); |
28 | - $query = "SELECT spotter_image.image, spotter_image.image_thumbnail, spotter_image.image_source, spotter_image.image_source_website,spotter_image.image_copyright, spotter_image.registration |
|
28 | + $query = "SELECT spotter_image.image, spotter_image.image_thumbnail, spotter_image.image_source, spotter_image.image_source_website,spotter_image.image_copyright, spotter_image.registration |
|
29 | 29 | FROM spotter_image |
30 | 30 | WHERE spotter_image.registration = :registration LIMIT 1"; |
31 | 31 | $sth = $this->db->prepare($query); |
32 | 32 | $sth->execute(array(':registration' => $reg)); |
33 | 33 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
34 | 34 | if (!empty($result)) return $result; |
35 | - elseif ($registration != '') return $this->getSpotterImage('',$aircraft_icao,$airline_icao); |
|
35 | + elseif ($registration != '') return $this->getSpotterImage('', $aircraft_icao, $airline_icao); |
|
36 | 36 | else return array(); |
37 | 37 | } |
38 | 38 | |
@@ -42,23 +42,23 @@ discard block |
||
42 | 42 | * @return Array the images list |
43 | 43 | * |
44 | 44 | */ |
45 | - public function getMarineImage($mmsi,$imo = '',$name = '') |
|
45 | + public function getMarineImage($mmsi, $imo = '', $name = '') |
|
46 | 46 | { |
47 | - $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
|
48 | - $imo = filter_var($imo,FILTER_SANITIZE_STRING); |
|
49 | - $name = filter_var($name,FILTER_SANITIZE_STRING); |
|
47 | + $mmsi = filter_var($mmsi, FILTER_SANITIZE_STRING); |
|
48 | + $imo = filter_var($imo, FILTER_SANITIZE_STRING); |
|
49 | + $name = filter_var($name, FILTER_SANITIZE_STRING); |
|
50 | 50 | $name = trim($name); |
51 | - $query = "SELECT marine_image.image, marine_image.image_thumbnail, marine_image.image_source, marine_image.image_source_website,marine_image.image_copyright, marine_image.mmsi, marine_image.imo, marine_image.name |
|
51 | + $query = "SELECT marine_image.image, marine_image.image_thumbnail, marine_image.image_source, marine_image.image_source_website,marine_image.image_copyright, marine_image.mmsi, marine_image.imo, marine_image.name |
|
52 | 52 | FROM marine_image |
53 | 53 | WHERE marine_image.mmsi = :mmsi"; |
54 | 54 | $query_data = array(':mmsi' => $mmsi); |
55 | 55 | if ($imo != '') { |
56 | 56 | $query .= " AND marine_image.imo = :imo"; |
57 | - $query_data = array_merge($query_data,array(':imo' => $imo)); |
|
57 | + $query_data = array_merge($query_data, array(':imo' => $imo)); |
|
58 | 58 | } |
59 | 59 | if ($name != '') { |
60 | 60 | $query .= " AND marine_image.name = :name"; |
61 | - $query_data = array_merge($query_data,array(':name' => $name)); |
|
61 | + $query_data = array_merge($query_data, array(':name' => $name)); |
|
62 | 62 | } |
63 | 63 | $query .= " LIMIT 1"; |
64 | 64 | $sth = $this->db->prepare($query); |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | if (isset($exif['COMPUTED']['copyright'])) $copyright = $exif['COMPUTED']['copyright']; |
80 | 80 | elseif (isset($exif['copyright'])) $copyright = $exif['copyright']; |
81 | 81 | if ($copyright != '') { |
82 | - $copyright = str_replace('Copyright ','',$copyright); |
|
83 | - $copyright = str_replace('© ','',$copyright); |
|
84 | - $copyright = str_replace('(c) ','',$copyright); |
|
82 | + $copyright = str_replace('Copyright ', '', $copyright); |
|
83 | + $copyright = str_replace('© ', '', $copyright); |
|
84 | + $copyright = str_replace('(c) ', '', $copyright); |
|
85 | 85 | } |
86 | 86 | return $copyright; |
87 | 87 | } |
@@ -92,25 +92,25 @@ discard block |
||
92 | 92 | * @return String either success or error |
93 | 93 | * |
94 | 94 | */ |
95 | - public function addSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
|
95 | + public function addSpotterImage($registration, $aircraft_icao = '', $airline_icao = '') |
|
96 | 96 | { |
97 | - global $globalDebug,$globalAircraftImageFetch; |
|
97 | + global $globalDebug, $globalAircraftImageFetch; |
|
98 | 98 | if (isset($globalAircraftImageFetch) && !$globalAircraftImageFetch) return ''; |
99 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
99 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
100 | 100 | $registration = trim($registration); |
101 | 101 | //getting the aircraft image |
102 | 102 | if ($globalDebug && $registration != '') echo 'Try to find an aircraft image for '.$registration.'...'; |
103 | 103 | elseif ($globalDebug && $aircraft_icao != '') echo 'Try to find an aircraft image for '.$aircraft_icao.'...'; |
104 | 104 | elseif ($globalDebug && $airline_icao != '') echo 'Try to find an aircraft image for '.$airline_icao.'...'; |
105 | - $image_url = $this->findAircraftImage($registration,$aircraft_icao,$airline_icao); |
|
105 | + $image_url = $this->findAircraftImage($registration, $aircraft_icao, $airline_icao); |
|
106 | 106 | if ($registration == '' && $aircraft_icao != '') $registration = $aircraft_icao.$airline_icao; |
107 | 107 | if ($image_url['original'] != '') { |
108 | 108 | if ($globalDebug) echo 'Found !'."\n"; |
109 | - $query = "INSERT INTO spotter_image (registration, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:registration,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
109 | + $query = "INSERT INTO spotter_image (registration, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:registration,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
110 | 110 | try { |
111 | 111 | $sth = $this->db->prepare($query); |
112 | - $sth->execute(array(':registration' => $registration,':image' => $image_url['original'],':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'],':source' => $image_url['source'],':source_website' => $image_url['source_website'])); |
|
113 | - } catch(PDOException $e) { |
|
112 | + $sth->execute(array(':registration' => $registration, ':image' => $image_url['original'], ':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'], ':source' => $image_url['source'], ':source_website' => $image_url['source_website'])); |
|
113 | + } catch (PDOException $e) { |
|
114 | 114 | echo $e->getMessage()."\n"; |
115 | 115 | return "error"; |
116 | 116 | } |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | * @return String either success or error |
125 | 125 | * |
126 | 126 | */ |
127 | - public function addMarineImage($mmsi,$imo = '',$name = '') |
|
127 | + public function addMarineImage($mmsi, $imo = '', $name = '') |
|
128 | 128 | { |
129 | - global $globalDebug,$globalMarineImageFetch; |
|
129 | + global $globalDebug, $globalMarineImageFetch; |
|
130 | 130 | if (isset($globalMarineImageFetch) && !$globalMarineImageFetch) return ''; |
131 | - $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
|
132 | - $imo = filter_var($imo,FILTER_SANITIZE_STRING); |
|
133 | - $name = filter_var($name,FILTER_SANITIZE_STRING); |
|
131 | + $mmsi = filter_var($mmsi, FILTER_SANITIZE_STRING); |
|
132 | + $imo = filter_var($imo, FILTER_SANITIZE_STRING); |
|
133 | + $name = filter_var($name, FILTER_SANITIZE_STRING); |
|
134 | 134 | $name = trim($name); |
135 | 135 | $Marine = new Marine($this->db); |
136 | 136 | if ($imo == '' || $name == '') { |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | |
145 | 145 | //getting the aircraft image |
146 | 146 | if ($globalDebug && $name != '') echo 'Try to find an vessel image for '.$name.'...'; |
147 | - $image_url = $this->findMarineImage($mmsi,$imo,$name); |
|
147 | + $image_url = $this->findMarineImage($mmsi, $imo, $name); |
|
148 | 148 | if ($image_url['original'] != '') { |
149 | 149 | if ($globalDebug) echo 'Found !'."\n"; |
150 | - $query = "INSERT INTO marine_image (mmsi,imo,name, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:mmsi,:imo,:name,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
150 | + $query = "INSERT INTO marine_image (mmsi,imo,name, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:mmsi,:imo,:name,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
151 | 151 | try { |
152 | 152 | $sth = $this->db->prepare($query); |
153 | - $sth->execute(array(':mmsi' => $mmsi,':imo' => $imo,':name' => $name,':image' => $image_url['original'],':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'],':source' => $image_url['source'],':source_website' => $image_url['source_website'])); |
|
154 | - } catch(PDOException $e) { |
|
153 | + $sth->execute(array(':mmsi' => $mmsi, ':imo' => $imo, ':name' => $name, ':image' => $image_url['original'], ':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'], ':source' => $image_url['source'], ':source_website' => $image_url['source_website'])); |
|
154 | + } catch (PDOException $e) { |
|
155 | 155 | echo $e->getMessage()."\n"; |
156 | 156 | return "error"; |
157 | 157 | } |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | global $globalAircraftImageSources, $globalIVAO, $globalAircraftImageCheckICAO; |
172 | 172 | $Spotter = new Spotter($this->db); |
173 | 173 | if (!isset($globalIVAO)) $globalIVAO = FALSE; |
174 | - $aircraft_registration = filter_var($aircraft_registration,FILTER_SANITIZE_STRING); |
|
174 | + $aircraft_registration = filter_var($aircraft_registration, FILTER_SANITIZE_STRING); |
|
175 | 175 | if ($aircraft_registration != '') { |
176 | - if (strpos($aircraft_registration,'/') !== false) return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
176 | + if (strpos($aircraft_registration, '/') !== false) return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
177 | 177 | $aircraft_registration = urlencode(trim($aircraft_registration)); |
178 | 178 | $aircraft_info = $Spotter->getAircraftInfoByRegistration($aircraft_registration); |
179 | 179 | if (isset($aircraft_info[0]['aircraft_name'])) $aircraft_name = $aircraft_info[0]['aircraft_name']; |
@@ -187,25 +187,25 @@ discard block |
||
187 | 187 | if (isset($aircraft_info[0]['type'])) $aircraft_name = $aircraft_info[0]['type']; |
188 | 188 | else $aircraft_name = ''; |
189 | 189 | $aircraft_registration = $aircraft_icao; |
190 | - } else return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
190 | + } else return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
191 | 191 | unset($Spotter); |
192 | - if (!isset($globalAircraftImageSources)) $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
192 | + if (!isset($globalAircraftImageSources)) $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
193 | 193 | foreach ($globalAircraftImageSources as $source) { |
194 | 194 | $source = strtolower($source); |
195 | - if ($source == 'ivaomtl' && $globalIVAO && $aircraft_icao != '' && $airline_icao != '') $images_array = $this->fromIvaoMtl('aircraft',$aircraft_icao,$airline_icao); |
|
196 | - if ($source == 'planespotters' && !$globalIVAO) $images_array = $this->fromPlanespotters('aircraft',$aircraft_registration,$aircraft_name); |
|
197 | - if ($source == 'flickr') $images_array = $this->fromFlickr('aircraft',$aircraft_registration,$aircraft_name); |
|
198 | - if ($source == 'bing') $images_array = $this->fromBing('aircraft',$aircraft_registration,$aircraft_name); |
|
199 | - if ($source == 'deviantart') $images_array = $this->fromDeviantart('aircraft',$aircraft_registration,$aircraft_name); |
|
200 | - if ($source == 'wikimedia') $images_array = $this->fromWikimedia('aircraft',$aircraft_registration,$aircraft_name); |
|
201 | - if ($source == 'jetphotos' && !$globalIVAO) $images_array = $this->fromJetPhotos('aircraft',$aircraft_registration,$aircraft_name); |
|
202 | - if ($source == 'planepictures' && !$globalIVAO) $images_array = $this->fromPlanePictures('aircraft',$aircraft_registration,$aircraft_name); |
|
203 | - if ($source == 'airportdata' && !$globalIVAO) $images_array = $this->fromAirportData('aircraft',$aircraft_registration,$aircraft_name); |
|
204 | - if ($source == 'customsources') $images_array = $this->fromCustomSource('aircraft',$aircraft_registration,$aircraft_name); |
|
195 | + if ($source == 'ivaomtl' && $globalIVAO && $aircraft_icao != '' && $airline_icao != '') $images_array = $this->fromIvaoMtl('aircraft', $aircraft_icao, $airline_icao); |
|
196 | + if ($source == 'planespotters' && !$globalIVAO) $images_array = $this->fromPlanespotters('aircraft', $aircraft_registration, $aircraft_name); |
|
197 | + if ($source == 'flickr') $images_array = $this->fromFlickr('aircraft', $aircraft_registration, $aircraft_name); |
|
198 | + if ($source == 'bing') $images_array = $this->fromBing('aircraft', $aircraft_registration, $aircraft_name); |
|
199 | + if ($source == 'deviantart') $images_array = $this->fromDeviantart('aircraft', $aircraft_registration, $aircraft_name); |
|
200 | + if ($source == 'wikimedia') $images_array = $this->fromWikimedia('aircraft', $aircraft_registration, $aircraft_name); |
|
201 | + if ($source == 'jetphotos' && !$globalIVAO) $images_array = $this->fromJetPhotos('aircraft', $aircraft_registration, $aircraft_name); |
|
202 | + if ($source == 'planepictures' && !$globalIVAO) $images_array = $this->fromPlanePictures('aircraft', $aircraft_registration, $aircraft_name); |
|
203 | + if ($source == 'airportdata' && !$globalIVAO) $images_array = $this->fromAirportData('aircraft', $aircraft_registration, $aircraft_name); |
|
204 | + if ($source == 'customsources') $images_array = $this->fromCustomSource('aircraft', $aircraft_registration, $aircraft_name); |
|
205 | 205 | if (isset($images_array) && $images_array['original'] != '') return $images_array; |
206 | 206 | } |
207 | 207 | if ((!isset($globalAircraftImageCheckICAO) || $globalAircraftImageCheckICAO === TRUE) && isset($aircraft_icao)) return $this->findAircraftImage($aircraft_icao); |
208 | - return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
208 | + return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -217,14 +217,14 @@ discard block |
||
217 | 217 | * @return Array the aircraft thumbnail, orignal url and copyright |
218 | 218 | * |
219 | 219 | */ |
220 | - public function findMarineImage($mmsi,$imo = '',$name = '') |
|
220 | + public function findMarineImage($mmsi, $imo = '', $name = '') |
|
221 | 221 | { |
222 | 222 | global $globalMarineImageSources; |
223 | - $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
|
223 | + $mmsi = filter_var($mmsi, FILTER_SANITIZE_STRING); |
|
224 | 224 | //$imo = filter_var($imo,FILTER_SANITIZE_STRING); |
225 | - $name = filter_var($name,FILTER_SANITIZE_STRING); |
|
225 | + $name = filter_var($name, FILTER_SANITIZE_STRING); |
|
226 | 226 | $name = trim($name); |
227 | - if (strlen($name) < 4) return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
227 | + if (strlen($name) < 4) return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
228 | 228 | /* |
229 | 229 | $Marine = new Marine($this->db); |
230 | 230 | if ($imo == '' || $name == '') { |
@@ -236,17 +236,17 @@ discard block |
||
236 | 236 | } |
237 | 237 | unset($Marine); |
238 | 238 | */ |
239 | - if (!isset($globalMarineImageSources)) $globalMarineImageSources = array('wikimedia','deviantart','flickr','bing'); |
|
239 | + if (!isset($globalMarineImageSources)) $globalMarineImageSources = array('wikimedia', 'deviantart', 'flickr', 'bing'); |
|
240 | 240 | foreach ($globalMarineImageSources as $source) { |
241 | 241 | $source = strtolower($source); |
242 | - if ($source == 'flickr') $images_array = $this->fromFlickr('marine',$mmsi,$name); |
|
243 | - if ($source == 'bing') $images_array = $this->fromBing('marine',$mmsi,$name); |
|
244 | - if ($source == 'deviantart') $images_array = $this->fromDeviantart('marine',$mmsi,$name); |
|
245 | - if ($source == 'wikimedia') $images_array = $this->fromWikimedia('marine',$mmsi,$name); |
|
246 | - if ($source == 'customsources') $images_array = $this->fromCustomSource('marine',$mmsi,$name); |
|
242 | + if ($source == 'flickr') $images_array = $this->fromFlickr('marine', $mmsi, $name); |
|
243 | + if ($source == 'bing') $images_array = $this->fromBing('marine', $mmsi, $name); |
|
244 | + if ($source == 'deviantart') $images_array = $this->fromDeviantart('marine', $mmsi, $name); |
|
245 | + if ($source == 'wikimedia') $images_array = $this->fromWikimedia('marine', $mmsi, $name); |
|
246 | + if ($source == 'customsources') $images_array = $this->fromCustomSource('marine', $mmsi, $name); |
|
247 | 247 | if (isset($images_array) && $images_array['original'] != '') return $images_array; |
248 | 248 | } |
249 | - return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
249 | + return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -257,24 +257,24 @@ discard block |
||
257 | 257 | * @return Array the aircraft thumbnail, orignal url and copyright |
258 | 258 | * |
259 | 259 | */ |
260 | - public function fromPlanespotters($type,$aircraft_registration, $aircraft_name='') { |
|
260 | + public function fromPlanespotters($type, $aircraft_registration, $aircraft_name = '') { |
|
261 | 261 | $Common = new Common(); |
262 | 262 | // If aircraft registration is only number, also check with aircraft model |
263 | - if (preg_match('/^[[:digit]]+$/',$aircraft_registration) && $aircraft_name != '') { |
|
264 | - $url= 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$aircraft_registration.'&actype=s_'.urlencode($aircraft_name).'&output=rss'; |
|
263 | + if (preg_match('/^[[:digit]]+$/', $aircraft_registration) && $aircraft_name != '') { |
|
264 | + $url = 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$aircraft_registration.'&actype=s_'.urlencode($aircraft_name).'&output=rss'; |
|
265 | 265 | } else { |
266 | 266 | //$url= 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$airline_aircraft_type.'&output=rss'; |
267 | - $url= 'http://www.planespotters.net/Aviation_Photos/search.php?reg='.$aircraft_registration.'&output=rss'; |
|
267 | + $url = 'http://www.planespotters.net/Aviation_Photos/search.php?reg='.$aircraft_registration.'&output=rss'; |
|
268 | 268 | } |
269 | 269 | $data = $Common->getData($url); |
270 | 270 | if ($xml = simplexml_load_string($data)) { |
271 | 271 | if (isset($xml->channel->item)) { |
272 | 272 | $image_url = array(); |
273 | - $thumbnail_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
273 | + $thumbnail_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
274 | 274 | $image_url['thumbnail'] = $thumbnail_url; |
275 | - $image_url['original'] = str_replace('thumbnail','original',$thumbnail_url); |
|
276 | - $image_url['copyright'] = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright); |
|
277 | - $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
275 | + $image_url['original'] = str_replace('thumbnail', 'original', $thumbnail_url); |
|
276 | + $image_url['copyright'] = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright); |
|
277 | + $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
278 | 278 | $image_url['source'] = 'planespotters'; |
279 | 279 | return $image_url; |
280 | 280 | } |
@@ -290,29 +290,29 @@ discard block |
||
290 | 290 | * @return Array the aircraft thumbnail, orignal url and copyright |
291 | 291 | * |
292 | 292 | */ |
293 | - public function fromDeviantart($type,$registration, $name='') { |
|
293 | + public function fromDeviantart($type, $registration, $name = '') { |
|
294 | 294 | $Common = new Common(); |
295 | 295 | if ($type == 'aircraft') { |
296 | 296 | // If aircraft registration is only number, also check with aircraft model |
297 | - if (preg_match('/^[[:digit]]+$/',$registration) && $name != '') { |
|
298 | - $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q='.$registration.'%20'.urlencode($name); |
|
297 | + if (preg_match('/^[[:digit]]+$/', $registration) && $name != '') { |
|
298 | + $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q='.$registration.'%20'.urlencode($name); |
|
299 | 299 | } else { |
300 | - $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q=aircraft%20'.$registration; |
|
300 | + $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q=aircraft%20'.$registration; |
|
301 | 301 | } |
302 | 302 | } elseif ($type == 'marine') { |
303 | - $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q="'.urlencode($name).'"'; |
|
303 | + $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q="'.urlencode($name).'"'; |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | $data = $Common->getData($url); |
307 | 307 | if ($xml = simplexml_load_string($data)) { |
308 | 308 | if (isset($xml->channel->item->link)) { |
309 | 309 | $image_url = array(); |
310 | - $thumbnail_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
310 | + $thumbnail_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
311 | 311 | $image_url['thumbnail'] = $thumbnail_url; |
312 | - $original_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->content->attributes()->url); |
|
312 | + $original_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->content->attributes()->url); |
|
313 | 313 | $image_url['original'] = $original_url; |
314 | - $image_url['copyright'] = str_replace('Copyright ','',trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright)); |
|
315 | - $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
314 | + $image_url['copyright'] = str_replace('Copyright ', '', trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright)); |
|
315 | + $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
316 | 316 | $image_url['source'] = 'deviantart'; |
317 | 317 | return $image_url; |
318 | 318 | } |
@@ -328,32 +328,32 @@ discard block |
||
328 | 328 | * @return Array the aircraft thumbnail, orignal url and copyright |
329 | 329 | * |
330 | 330 | */ |
331 | - public function fromJetPhotos($type,$aircraft_registration, $aircraft_name='') { |
|
331 | + public function fromJetPhotos($type, $aircraft_registration, $aircraft_name = '') { |
|
332 | 332 | $Common = new Common(); |
333 | - $url= 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
|
333 | + $url = 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
|
334 | 334 | $data = $Common->getData($url); |
335 | 335 | $dom = new DOMDocument(); |
336 | 336 | @$dom->loadHTML($data); |
337 | 337 | $all_pics = array(); |
338 | - foreach($dom->getElementsByTagName('img') as $image) { |
|
338 | + foreach ($dom->getElementsByTagName('img') as $image) { |
|
339 | 339 | if ($image->getAttribute('itemprop') == "http://schema.org/image") { |
340 | 340 | $all_pics[] = $image->getAttribute('src'); |
341 | 341 | } |
342 | 342 | } |
343 | 343 | $all_authors = array(); |
344 | - foreach($dom->getElementsByTagName('meta') as $author) { |
|
344 | + foreach ($dom->getElementsByTagName('meta') as $author) { |
|
345 | 345 | if ($author->getAttribute('itemprop') == "http://schema.org/author") { |
346 | 346 | $all_authors[] = $author->getAttribute('content'); |
347 | 347 | } |
348 | 348 | } |
349 | 349 | $all_ref = array(); |
350 | - foreach($dom->getElementsByTagName('a') as $link) { |
|
350 | + foreach ($dom->getElementsByTagName('a') as $link) { |
|
351 | 351 | $all_ref[] = $link->getAttribute('href'); |
352 | 352 | } |
353 | 353 | if (isset($all_pics[0])) { |
354 | 354 | $image_url = array(); |
355 | 355 | $image_url['thumbnail'] = $all_pics[0]; |
356 | - $image_url['original'] = str_replace('_tb','',$all_pics[0]); |
|
356 | + $image_url['original'] = str_replace('_tb', '', $all_pics[0]); |
|
357 | 357 | $image_url['copyright'] = $all_authors[0]; |
358 | 358 | $image_url['source_website'] = 'http://jetphotos.net'.$all_ref[8]; |
359 | 359 | $image_url['source'] = 'JetPhotos'; |
@@ -370,24 +370,24 @@ discard block |
||
370 | 370 | * @return Array the aircraft thumbnail, orignal url and copyright |
371 | 371 | * |
372 | 372 | */ |
373 | - public function fromPlanePictures($type,$aircraft_registration, $aircraft_name='') { |
|
373 | + public function fromPlanePictures($type, $aircraft_registration, $aircraft_name = '') { |
|
374 | 374 | $Common = new Common(); |
375 | - $url= 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
|
375 | + $url = 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
|
376 | 376 | $data = $Common->getData($url); |
377 | 377 | $dom = new DOMDocument(); |
378 | 378 | @$dom->loadHTML($data); |
379 | 379 | $all_pics = array(); |
380 | - foreach($dom->getElementsByTagName('img') as $image) { |
|
380 | + foreach ($dom->getElementsByTagName('img') as $image) { |
|
381 | 381 | $all_pics[] = $image->getAttribute('src'); |
382 | 382 | } |
383 | 383 | $all_links = array(); |
384 | - foreach($dom->getElementsByTagName('a') as $link) { |
|
385 | - $all_links[] = array('text' => $link->textContent,'href' => $link->getAttribute('href')); |
|
384 | + foreach ($dom->getElementsByTagName('a') as $link) { |
|
385 | + $all_links[] = array('text' => $link->textContent, 'href' => $link->getAttribute('href')); |
|
386 | 386 | } |
387 | - if (isset($all_pics[1]) && !preg_match('/bit.ly/',$all_pics[1]) && !preg_match('/flagge/',$all_pics[1])) { |
|
387 | + if (isset($all_pics[1]) && !preg_match('/bit.ly/', $all_pics[1]) && !preg_match('/flagge/', $all_pics[1])) { |
|
388 | 388 | $image_url = array(); |
389 | 389 | $image_url['thumbnail'] = 'http://www.planepictures.net/'.$all_pics[1]; |
390 | - $image_url['original'] = 'http://www.planepictures.net/'.str_replace('_TN','',$all_pics[1]); |
|
390 | + $image_url['original'] = 'http://www.planepictures.net/'.str_replace('_TN', '', $all_pics[1]); |
|
391 | 391 | $image_url['copyright'] = $all_links[6]['text']; |
392 | 392 | $image_url['source_website'] = 'http://www.planepictures.net/'.$all_links[2]['href']; |
393 | 393 | $image_url['source'] = 'PlanePictures'; |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | * @return Array the aircraft thumbnail, orignal url and copyright |
405 | 405 | * |
406 | 406 | */ |
407 | - public function fromFlickr($type,$registration,$name='') { |
|
407 | + public function fromFlickr($type, $registration, $name = '') { |
|
408 | 408 | $Common = new Common(); |
409 | 409 | if ($type == 'aircraft') { |
410 | 410 | if ($name != '') $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$registration.','.urlencode($name); |
@@ -416,12 +416,12 @@ discard block |
||
416 | 416 | $data = $Common->getData($url); |
417 | 417 | if ($xml = simplexml_load_string($data)) { |
418 | 418 | if (isset($xml->channel->item)) { |
419 | - $original_url = trim((string)$xml->channel->item->enclosure->attributes()->url); |
|
419 | + $original_url = trim((string) $xml->channel->item->enclosure->attributes()->url); |
|
420 | 420 | $image_url = array(); |
421 | 421 | $image_url['thumbnail'] = $original_url; |
422 | 422 | $image_url['original'] = $original_url; |
423 | - $image_url['copyright'] = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->credit); |
|
424 | - $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
423 | + $image_url['copyright'] = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->credit); |
|
424 | + $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
425 | 425 | $image_url['source'] = 'flickr'; |
426 | 426 | return $image_url; |
427 | 427 | } |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | return false; |
430 | 430 | } |
431 | 431 | |
432 | - public function fromIvaoMtl($type,$aircraft_icao,$airline_icao) { |
|
432 | + public function fromIvaoMtl($type, $aircraft_icao, $airline_icao) { |
|
433 | 433 | $Common = new Common(); |
434 | 434 | //echo "\n".'SEARCH IMAGE : http://mtlcatalog.ivao.aero/images/aircraft/'.$aircraft_icao.$airline_icao.'.jpg'; |
435 | 435 | if ($Common->urlexist('http://mtlcatalog.ivao.aero/images/aircraft/'.$aircraft_icao.$airline_icao.'.jpg')) { |
@@ -453,14 +453,14 @@ discard block |
||
453 | 453 | * @return Array the aircraft thumbnail, orignal url and copyright |
454 | 454 | * |
455 | 455 | */ |
456 | - public function fromBing($type,$aircraft_registration,$aircraft_name='') { |
|
456 | + public function fromBing($type, $aircraft_registration, $aircraft_name = '') { |
|
457 | 457 | global $globalImageBingKey; |
458 | 458 | $Common = new Common(); |
459 | 459 | if (!isset($globalImageBingKey) || $globalImageBingKey == '') return false; |
460 | 460 | if ($aircraft_name != '') $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27'.$aircraft_registration.'%20'.urlencode($aircraft_name).'%20-site:planespotters.com%20-site:flickr.com%27'; |
461 | 461 | else $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27%2B'.$aircraft_registration.'%20%2Baircraft%20-site:planespotters.com%20-site:flickr.com%27'; |
462 | - $headers = array("Authorization: Basic " . base64_encode("ignored:".$globalImageBingKey)); |
|
463 | - $data = $Common->getData($url,'get','',$headers); |
|
462 | + $headers = array("Authorization: Basic ".base64_encode("ignored:".$globalImageBingKey)); |
|
463 | + $data = $Common->getData($url, 'get', '', $headers); |
|
464 | 464 | $result = json_decode($data); |
465 | 465 | if (isset($result->d->results[0]->MediaUrl)) { |
466 | 466 | $image_url = array(); |
@@ -485,14 +485,14 @@ discard block |
||
485 | 485 | * @return Array the aircraft thumbnail, orignal url and copyright |
486 | 486 | * |
487 | 487 | */ |
488 | - public function fromAirportData($type,$aircraft_registration,$aircraft_name='') { |
|
488 | + public function fromAirportData($type, $aircraft_registration, $aircraft_name = '') { |
|
489 | 489 | $Common = new Common(); |
490 | 490 | $url = 'http://www.airport-data.com/api/ac_thumb.json?&n=1&r='.$aircraft_registration; |
491 | 491 | $data = $Common->getData($url); |
492 | 492 | $result = json_decode($data); |
493 | 493 | if (isset($result->count) && $result->count > 0) { |
494 | 494 | $image_url = array(); |
495 | - $image_url['original'] = str_replace('thumbnails','large',$result->data[0]->image); |
|
495 | + $image_url['original'] = str_replace('thumbnails', 'large', $result->data[0]->image); |
|
496 | 496 | $image_url['source_website'] = $result->data[0]->link; |
497 | 497 | $image_url['thumbnail'] = $result->data[0]->image; |
498 | 498 | $image_url['copyright'] = $result->data[0]->photographer; |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | * @return Array the aircraft thumbnail, orignal url and copyright |
511 | 511 | * |
512 | 512 | */ |
513 | - public function fromWikimedia($type,$registration,$name='') { |
|
513 | + public function fromWikimedia($type, $registration, $name = '') { |
|
514 | 514 | $Common = new Common(); |
515 | 515 | if ($type == 'aircraft') { |
516 | 516 | if ($name != '') $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$registration.'"%20'.urlencode($name); |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | $result = json_decode($data); |
524 | 524 | if (isset($result->query->search[0]->title)) { |
525 | 525 | $fileo = $result->query->search[0]->title; |
526 | - if (substr($fileo,-3) == 'pdf') return false; |
|
526 | + if (substr($fileo, -3) == 'pdf') return false; |
|
527 | 527 | $file = urlencode($fileo); |
528 | 528 | $url2 = 'https://commons.wikimedia.org/w/api.php?action=query&format=json&continue&iilimit=500&prop=imageinfo&iiprop=user|url|size|mime|sha1|timestamp&iiurlwidth=200%27&titles='.$file; |
529 | 529 | $data2 = $Common->getData($url2); |
@@ -548,11 +548,11 @@ discard block |
||
548 | 548 | if (isset($result2->query->pages)) { |
549 | 549 | foreach ($result2->query->pages as $page) { |
550 | 550 | if (isset($page->imageinfo[0]->extmetadata->Artist)) { |
551 | - $image_url['copyright'] = preg_replace('/ from(.*)/','',strip_tags($page->imageinfo[0]->extmetadata->Artist->value)); |
|
551 | + $image_url['copyright'] = preg_replace('/ from(.*)/', '', strip_tags($page->imageinfo[0]->extmetadata->Artist->value)); |
|
552 | 552 | if (isset($page->imageinfo[0]->extmetadata->License->value)) { |
553 | 553 | $image_url['copyright'] = $image_url['copyright'].' (under '.$page->imageinfo[0]->extmetadata->License->value.')'; |
554 | 554 | } |
555 | - $image_url['copyright'] = trim(str_replace('\n','',$image_url['copyright'])); |
|
555 | + $image_url['copyright'] = trim(str_replace('\n', '', $image_url['copyright'])); |
|
556 | 556 | return $image_url; |
557 | 557 | } |
558 | 558 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | * @return Array the aircraft thumbnail, orignal url and copyright |
572 | 572 | * |
573 | 573 | */ |
574 | - public function fromCustomSource($type,$registration,$name='') { |
|
574 | + public function fromCustomSource($type, $registration, $name = '') { |
|
575 | 575 | global $globalAircraftImageCustomSources, $globalMarineImageCustomSources, $globalDebug; |
576 | 576 | //$globalAircraftImageCustomSource[] = array('thumbnail' => '','original' => '', 'copyright' => '', 'source_website' => '', 'source' => '','exif' => true); |
577 | 577 | if (!empty($globalAircraftImageCustomSources) && $type == 'aircraft') { |
@@ -588,15 +588,15 @@ discard block |
||
588 | 588 | print_r($source); |
589 | 589 | print_r($customsources); |
590 | 590 | } |
591 | - $url = str_replace('{registration}',$registration,$source['original']); |
|
592 | - $url_thumbnail = str_replace('{registration}',$registration,$source['thumbnail']); |
|
591 | + $url = str_replace('{registration}', $registration, $source['original']); |
|
592 | + $url_thumbnail = str_replace('{registration}', $registration, $source['thumbnail']); |
|
593 | 593 | if ($Common->urlexist($url)) { |
594 | 594 | $image_url = array(); |
595 | 595 | $image_url['thumbnail'] = $url_thumbnail; |
596 | 596 | $image_url['original'] = $url; |
597 | 597 | if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) $exifCopyright = $this->getExifCopyright($url); |
598 | 598 | else $exifCopyright = ''; |
599 | - if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
599 | + if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
600 | 600 | elseif (isset($source['copyright'])) $image_url['copyright'] = $source['copyright']; |
601 | 601 | else $image_url['copyright'] = $source['source_website']; |
602 | 602 | $image_url['source_website'] = $source['source_website']; |
@@ -620,19 +620,19 @@ discard block |
||
620 | 620 | print_r($source); |
621 | 621 | print_r($customsources); |
622 | 622 | } |
623 | - $url = str_replace('{registration}',$registration,$source['original']); |
|
624 | - $url = str_replace('{mmsi}',$registration,$url); |
|
625 | - $url = str_replace('{name}',$name,$url); |
|
626 | - $url_thumbnail = str_replace('{registration}',$registration,$source['thumbnail']); |
|
627 | - $url_thumbnail = str_replace('{mmsi}',$registration,$url_thumbnail); |
|
628 | - $url_thumbnail = str_replace('{name}',$name,$url_thumbnail); |
|
623 | + $url = str_replace('{registration}', $registration, $source['original']); |
|
624 | + $url = str_replace('{mmsi}', $registration, $url); |
|
625 | + $url = str_replace('{name}', $name, $url); |
|
626 | + $url_thumbnail = str_replace('{registration}', $registration, $source['thumbnail']); |
|
627 | + $url_thumbnail = str_replace('{mmsi}', $registration, $url_thumbnail); |
|
628 | + $url_thumbnail = str_replace('{name}', $name, $url_thumbnail); |
|
629 | 629 | if ($Common->urlexist($url)) { |
630 | 630 | $image_url = array(); |
631 | 631 | $image_url['thumbnail'] = $url_thumbnail; |
632 | 632 | $image_url['original'] = $url; |
633 | 633 | if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) $exifCopyright = $this->getExifCopyright($url); |
634 | 634 | else $exifCopyright = ''; |
635 | - if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
635 | + if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
636 | 636 | elseif (isset($source['copyright'])) $image_url['copyright'] = $source['copyright']; |
637 | 637 | else $image_url['copyright'] = $source['source_website']; |
638 | 638 | $image_url['source_website'] = $source['source_website']; |
@@ -23,7 +23,9 @@ discard block |
||
23 | 23 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
24 | 24 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
25 | 25 | $reg = $registration; |
26 | - if ($reg == '' && $aircraft_icao != '') $reg = $aircraft_icao.$airline_icao; |
|
26 | + if ($reg == '' && $aircraft_icao != '') { |
|
27 | + $reg = $aircraft_icao.$airline_icao; |
|
28 | + } |
|
27 | 29 | $reg = trim($reg); |
28 | 30 | $query = "SELECT spotter_image.image, spotter_image.image_thumbnail, spotter_image.image_source, spotter_image.image_source_website,spotter_image.image_copyright, spotter_image.registration |
29 | 31 | FROM spotter_image |
@@ -31,9 +33,13 @@ discard block |
||
31 | 33 | $sth = $this->db->prepare($query); |
32 | 34 | $sth->execute(array(':registration' => $reg)); |
33 | 35 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
34 | - if (!empty($result)) return $result; |
|
35 | - elseif ($registration != '') return $this->getSpotterImage('',$aircraft_icao,$airline_icao); |
|
36 | - else return array(); |
|
36 | + if (!empty($result)) { |
|
37 | + return $result; |
|
38 | + } elseif ($registration != '') { |
|
39 | + return $this->getSpotterImage('',$aircraft_icao,$airline_icao); |
|
40 | + } else { |
|
41 | + return array(); |
|
42 | + } |
|
37 | 43 | } |
38 | 44 | |
39 | 45 | /** |
@@ -76,8 +82,11 @@ discard block |
||
76 | 82 | public function getExifCopyright($url) { |
77 | 83 | $exif = exif_read_data($url); |
78 | 84 | $copyright = ''; |
79 | - if (isset($exif['COMPUTED']['copyright'])) $copyright = $exif['COMPUTED']['copyright']; |
|
80 | - elseif (isset($exif['copyright'])) $copyright = $exif['copyright']; |
|
85 | + if (isset($exif['COMPUTED']['copyright'])) { |
|
86 | + $copyright = $exif['COMPUTED']['copyright']; |
|
87 | + } elseif (isset($exif['copyright'])) { |
|
88 | + $copyright = $exif['copyright']; |
|
89 | + } |
|
81 | 90 | if ($copyright != '') { |
82 | 91 | $copyright = str_replace('Copyright ','',$copyright); |
83 | 92 | $copyright = str_replace('© ','',$copyright); |
@@ -95,17 +104,27 @@ discard block |
||
95 | 104 | public function addSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
96 | 105 | { |
97 | 106 | global $globalDebug,$globalAircraftImageFetch; |
98 | - if (isset($globalAircraftImageFetch) && !$globalAircraftImageFetch) return ''; |
|
107 | + if (isset($globalAircraftImageFetch) && !$globalAircraftImageFetch) { |
|
108 | + return ''; |
|
109 | + } |
|
99 | 110 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
100 | 111 | $registration = trim($registration); |
101 | 112 | //getting the aircraft image |
102 | - if ($globalDebug && $registration != '') echo 'Try to find an aircraft image for '.$registration.'...'; |
|
103 | - elseif ($globalDebug && $aircraft_icao != '') echo 'Try to find an aircraft image for '.$aircraft_icao.'...'; |
|
104 | - elseif ($globalDebug && $airline_icao != '') echo 'Try to find an aircraft image for '.$airline_icao.'...'; |
|
113 | + if ($globalDebug && $registration != '') { |
|
114 | + echo 'Try to find an aircraft image for '.$registration.'...'; |
|
115 | + } elseif ($globalDebug && $aircraft_icao != '') { |
|
116 | + echo 'Try to find an aircraft image for '.$aircraft_icao.'...'; |
|
117 | + } elseif ($globalDebug && $airline_icao != '') { |
|
118 | + echo 'Try to find an aircraft image for '.$airline_icao.'...'; |
|
119 | + } |
|
105 | 120 | $image_url = $this->findAircraftImage($registration,$aircraft_icao,$airline_icao); |
106 | - if ($registration == '' && $aircraft_icao != '') $registration = $aircraft_icao.$airline_icao; |
|
121 | + if ($registration == '' && $aircraft_icao != '') { |
|
122 | + $registration = $aircraft_icao.$airline_icao; |
|
123 | + } |
|
107 | 124 | if ($image_url['original'] != '') { |
108 | - if ($globalDebug) echo 'Found !'."\n"; |
|
125 | + if ($globalDebug) { |
|
126 | + echo 'Found !'."\n"; |
|
127 | + } |
|
109 | 128 | $query = "INSERT INTO spotter_image (registration, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:registration,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
110 | 129 | try { |
111 | 130 | $sth = $this->db->prepare($query); |
@@ -114,7 +133,9 @@ discard block |
||
114 | 133 | echo $e->getMessage()."\n"; |
115 | 134 | return "error"; |
116 | 135 | } |
117 | - } elseif ($globalDebug) echo "Not found :'(\n"; |
|
136 | + } elseif ($globalDebug) { |
|
137 | + echo "Not found :'(\n"; |
|
138 | + } |
|
118 | 139 | return "success"; |
119 | 140 | } |
120 | 141 | |
@@ -127,7 +148,9 @@ discard block |
||
127 | 148 | public function addMarineImage($mmsi,$imo = '',$name = '') |
128 | 149 | { |
129 | 150 | global $globalDebug,$globalMarineImageFetch; |
130 | - if (isset($globalMarineImageFetch) && !$globalMarineImageFetch) return ''; |
|
151 | + if (isset($globalMarineImageFetch) && !$globalMarineImageFetch) { |
|
152 | + return ''; |
|
153 | + } |
|
131 | 154 | $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
132 | 155 | $imo = filter_var($imo,FILTER_SANITIZE_STRING); |
133 | 156 | $name = filter_var($name,FILTER_SANITIZE_STRING); |
@@ -137,16 +160,22 @@ discard block |
||
137 | 160 | $identity = $Marine->getIdentity($mmsi); |
138 | 161 | if (isset($identity[0]['mmsi'])) { |
139 | 162 | $imo = $identity[0]['imo']; |
140 | - if ($identity[0]['ship_name'] != '') $name = $identity[0]['ship_name']; |
|
163 | + if ($identity[0]['ship_name'] != '') { |
|
164 | + $name = $identity[0]['ship_name']; |
|
165 | + } |
|
141 | 166 | } |
142 | 167 | } |
143 | 168 | unset($Marine); |
144 | 169 | |
145 | 170 | //getting the aircraft image |
146 | - if ($globalDebug && $name != '') echo 'Try to find an vessel image for '.$name.'...'; |
|
171 | + if ($globalDebug && $name != '') { |
|
172 | + echo 'Try to find an vessel image for '.$name.'...'; |
|
173 | + } |
|
147 | 174 | $image_url = $this->findMarineImage($mmsi,$imo,$name); |
148 | 175 | if ($image_url['original'] != '') { |
149 | - if ($globalDebug) echo 'Found !'."\n"; |
|
176 | + if ($globalDebug) { |
|
177 | + echo 'Found !'."\n"; |
|
178 | + } |
|
150 | 179 | $query = "INSERT INTO marine_image (mmsi,imo,name, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:mmsi,:imo,:name,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
151 | 180 | try { |
152 | 181 | $sth = $this->db->prepare($query); |
@@ -155,7 +184,9 @@ discard block |
||
155 | 184 | echo $e->getMessage()."\n"; |
156 | 185 | return "error"; |
157 | 186 | } |
158 | - } elseif ($globalDebug) echo "Not found :'(\n"; |
|
187 | + } elseif ($globalDebug) { |
|
188 | + echo "Not found :'(\n"; |
|
189 | + } |
|
159 | 190 | return "success"; |
160 | 191 | } |
161 | 192 | |
@@ -170,41 +201,85 @@ discard block |
||
170 | 201 | { |
171 | 202 | global $globalAircraftImageSources, $globalIVAO, $globalAircraftImageCheckICAO; |
172 | 203 | $Spotter = new Spotter($this->db); |
173 | - if (!isset($globalIVAO)) $globalIVAO = FALSE; |
|
204 | + if (!isset($globalIVAO)) { |
|
205 | + $globalIVAO = FALSE; |
|
206 | + } |
|
174 | 207 | $aircraft_registration = filter_var($aircraft_registration,FILTER_SANITIZE_STRING); |
175 | 208 | if ($aircraft_registration != '') { |
176 | - if (strpos($aircraft_registration,'/') !== false) return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
209 | + if (strpos($aircraft_registration,'/') !== false) { |
|
210 | + return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
211 | + } |
|
177 | 212 | $aircraft_registration = urlencode(trim($aircraft_registration)); |
178 | 213 | $aircraft_info = $Spotter->getAircraftInfoByRegistration($aircraft_registration); |
179 | - if (isset($aircraft_info[0]['aircraft_name'])) $aircraft_name = $aircraft_info[0]['aircraft_name']; |
|
180 | - else $aircraft_name = ''; |
|
181 | - if (isset($aircraft_info[0]['aircraft_icao'])) $aircraft_name = $aircraft_info[0]['aircraft_icao']; |
|
182 | - else $aircraft_icao = ''; |
|
183 | - if (isset($aircraft_info[0]['airline_icao'])) $airline_icao = $aircraft_info[0]['airline_icao']; |
|
184 | - else $airline_icao = ''; |
|
214 | + if (isset($aircraft_info[0]['aircraft_name'])) { |
|
215 | + $aircraft_name = $aircraft_info[0]['aircraft_name']; |
|
216 | + } else { |
|
217 | + $aircraft_name = ''; |
|
218 | + } |
|
219 | + if (isset($aircraft_info[0]['aircraft_icao'])) { |
|
220 | + $aircraft_name = $aircraft_info[0]['aircraft_icao']; |
|
221 | + } else { |
|
222 | + $aircraft_icao = ''; |
|
223 | + } |
|
224 | + if (isset($aircraft_info[0]['airline_icao'])) { |
|
225 | + $airline_icao = $aircraft_info[0]['airline_icao']; |
|
226 | + } else { |
|
227 | + $airline_icao = ''; |
|
228 | + } |
|
185 | 229 | } elseif ($aircraft_icao != '') { |
186 | 230 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao); |
187 | - if (isset($aircraft_info[0]['type'])) $aircraft_name = $aircraft_info[0]['type']; |
|
188 | - else $aircraft_name = ''; |
|
231 | + if (isset($aircraft_info[0]['type'])) { |
|
232 | + $aircraft_name = $aircraft_info[0]['type']; |
|
233 | + } else { |
|
234 | + $aircraft_name = ''; |
|
235 | + } |
|
189 | 236 | $aircraft_registration = $aircraft_icao; |
190 | - } else return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
237 | + } else { |
|
238 | + return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
239 | + } |
|
191 | 240 | unset($Spotter); |
192 | - if (!isset($globalAircraftImageSources)) $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
241 | + if (!isset($globalAircraftImageSources)) { |
|
242 | + $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
243 | + } |
|
193 | 244 | foreach ($globalAircraftImageSources as $source) { |
194 | 245 | $source = strtolower($source); |
195 | - if ($source == 'ivaomtl' && $globalIVAO && $aircraft_icao != '' && $airline_icao != '') $images_array = $this->fromIvaoMtl('aircraft',$aircraft_icao,$airline_icao); |
|
196 | - if ($source == 'planespotters' && !$globalIVAO) $images_array = $this->fromPlanespotters('aircraft',$aircraft_registration,$aircraft_name); |
|
197 | - if ($source == 'flickr') $images_array = $this->fromFlickr('aircraft',$aircraft_registration,$aircraft_name); |
|
198 | - if ($source == 'bing') $images_array = $this->fromBing('aircraft',$aircraft_registration,$aircraft_name); |
|
199 | - if ($source == 'deviantart') $images_array = $this->fromDeviantart('aircraft',$aircraft_registration,$aircraft_name); |
|
200 | - if ($source == 'wikimedia') $images_array = $this->fromWikimedia('aircraft',$aircraft_registration,$aircraft_name); |
|
201 | - if ($source == 'jetphotos' && !$globalIVAO) $images_array = $this->fromJetPhotos('aircraft',$aircraft_registration,$aircraft_name); |
|
202 | - if ($source == 'planepictures' && !$globalIVAO) $images_array = $this->fromPlanePictures('aircraft',$aircraft_registration,$aircraft_name); |
|
203 | - if ($source == 'airportdata' && !$globalIVAO) $images_array = $this->fromAirportData('aircraft',$aircraft_registration,$aircraft_name); |
|
204 | - if ($source == 'customsources') $images_array = $this->fromCustomSource('aircraft',$aircraft_registration,$aircraft_name); |
|
205 | - if (isset($images_array) && $images_array['original'] != '') return $images_array; |
|
206 | - } |
|
207 | - if ((!isset($globalAircraftImageCheckICAO) || $globalAircraftImageCheckICAO === TRUE) && isset($aircraft_icao)) return $this->findAircraftImage($aircraft_icao); |
|
246 | + if ($source == 'ivaomtl' && $globalIVAO && $aircraft_icao != '' && $airline_icao != '') { |
|
247 | + $images_array = $this->fromIvaoMtl('aircraft',$aircraft_icao,$airline_icao); |
|
248 | + } |
|
249 | + if ($source == 'planespotters' && !$globalIVAO) { |
|
250 | + $images_array = $this->fromPlanespotters('aircraft',$aircraft_registration,$aircraft_name); |
|
251 | + } |
|
252 | + if ($source == 'flickr') { |
|
253 | + $images_array = $this->fromFlickr('aircraft',$aircraft_registration,$aircraft_name); |
|
254 | + } |
|
255 | + if ($source == 'bing') { |
|
256 | + $images_array = $this->fromBing('aircraft',$aircraft_registration,$aircraft_name); |
|
257 | + } |
|
258 | + if ($source == 'deviantart') { |
|
259 | + $images_array = $this->fromDeviantart('aircraft',$aircraft_registration,$aircraft_name); |
|
260 | + } |
|
261 | + if ($source == 'wikimedia') { |
|
262 | + $images_array = $this->fromWikimedia('aircraft',$aircraft_registration,$aircraft_name); |
|
263 | + } |
|
264 | + if ($source == 'jetphotos' && !$globalIVAO) { |
|
265 | + $images_array = $this->fromJetPhotos('aircraft',$aircraft_registration,$aircraft_name); |
|
266 | + } |
|
267 | + if ($source == 'planepictures' && !$globalIVAO) { |
|
268 | + $images_array = $this->fromPlanePictures('aircraft',$aircraft_registration,$aircraft_name); |
|
269 | + } |
|
270 | + if ($source == 'airportdata' && !$globalIVAO) { |
|
271 | + $images_array = $this->fromAirportData('aircraft',$aircraft_registration,$aircraft_name); |
|
272 | + } |
|
273 | + if ($source == 'customsources') { |
|
274 | + $images_array = $this->fromCustomSource('aircraft',$aircraft_registration,$aircraft_name); |
|
275 | + } |
|
276 | + if (isset($images_array) && $images_array['original'] != '') { |
|
277 | + return $images_array; |
|
278 | + } |
|
279 | + } |
|
280 | + if ((!isset($globalAircraftImageCheckICAO) || $globalAircraftImageCheckICAO === TRUE) && isset($aircraft_icao)) { |
|
281 | + return $this->findAircraftImage($aircraft_icao); |
|
282 | + } |
|
208 | 283 | return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
209 | 284 | } |
210 | 285 | |
@@ -224,7 +299,9 @@ discard block |
||
224 | 299 | //$imo = filter_var($imo,FILTER_SANITIZE_STRING); |
225 | 300 | $name = filter_var($name,FILTER_SANITIZE_STRING); |
226 | 301 | $name = trim($name); |
227 | - if (strlen($name) < 4) return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
302 | + if (strlen($name) < 4) { |
|
303 | + return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
304 | + } |
|
228 | 305 | /* |
229 | 306 | $Marine = new Marine($this->db); |
230 | 307 | if ($imo == '' || $name == '') { |
@@ -236,15 +313,29 @@ discard block |
||
236 | 313 | } |
237 | 314 | unset($Marine); |
238 | 315 | */ |
239 | - if (!isset($globalMarineImageSources)) $globalMarineImageSources = array('wikimedia','deviantart','flickr','bing'); |
|
316 | + if (!isset($globalMarineImageSources)) { |
|
317 | + $globalMarineImageSources = array('wikimedia','deviantart','flickr','bing'); |
|
318 | + } |
|
240 | 319 | foreach ($globalMarineImageSources as $source) { |
241 | 320 | $source = strtolower($source); |
242 | - if ($source == 'flickr') $images_array = $this->fromFlickr('marine',$mmsi,$name); |
|
243 | - if ($source == 'bing') $images_array = $this->fromBing('marine',$mmsi,$name); |
|
244 | - if ($source == 'deviantart') $images_array = $this->fromDeviantart('marine',$mmsi,$name); |
|
245 | - if ($source == 'wikimedia') $images_array = $this->fromWikimedia('marine',$mmsi,$name); |
|
246 | - if ($source == 'customsources') $images_array = $this->fromCustomSource('marine',$mmsi,$name); |
|
247 | - if (isset($images_array) && $images_array['original'] != '') return $images_array; |
|
321 | + if ($source == 'flickr') { |
|
322 | + $images_array = $this->fromFlickr('marine',$mmsi,$name); |
|
323 | + } |
|
324 | + if ($source == 'bing') { |
|
325 | + $images_array = $this->fromBing('marine',$mmsi,$name); |
|
326 | + } |
|
327 | + if ($source == 'deviantart') { |
|
328 | + $images_array = $this->fromDeviantart('marine',$mmsi,$name); |
|
329 | + } |
|
330 | + if ($source == 'wikimedia') { |
|
331 | + $images_array = $this->fromWikimedia('marine',$mmsi,$name); |
|
332 | + } |
|
333 | + if ($source == 'customsources') { |
|
334 | + $images_array = $this->fromCustomSource('marine',$mmsi,$name); |
|
335 | + } |
|
336 | + if (isset($images_array) && $images_array['original'] != '') { |
|
337 | + return $images_array; |
|
338 | + } |
|
248 | 339 | } |
249 | 340 | return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
250 | 341 | } |
@@ -407,11 +498,17 @@ discard block |
||
407 | 498 | public function fromFlickr($type,$registration,$name='') { |
408 | 499 | $Common = new Common(); |
409 | 500 | if ($type == 'aircraft') { |
410 | - if ($name != '') $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$registration.','.urlencode($name); |
|
411 | - else $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$registration.',aircraft'; |
|
501 | + if ($name != '') { |
|
502 | + $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$registration.','.urlencode($name); |
|
503 | + } else { |
|
504 | + $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$registration.',aircraft'; |
|
505 | + } |
|
412 | 506 | } elseif ($type == 'marine') { |
413 | - if ($name != '') $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.urlencode($name); |
|
414 | - else $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$registration.',vessel'; |
|
507 | + if ($name != '') { |
|
508 | + $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.urlencode($name); |
|
509 | + } else { |
|
510 | + $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$registration.',vessel'; |
|
511 | + } |
|
415 | 512 | } |
416 | 513 | $data = $Common->getData($url); |
417 | 514 | if ($xml = simplexml_load_string($data)) { |
@@ -456,9 +553,14 @@ discard block |
||
456 | 553 | public function fromBing($type,$aircraft_registration,$aircraft_name='') { |
457 | 554 | global $globalImageBingKey; |
458 | 555 | $Common = new Common(); |
459 | - if (!isset($globalImageBingKey) || $globalImageBingKey == '') return false; |
|
460 | - if ($aircraft_name != '') $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27'.$aircraft_registration.'%20'.urlencode($aircraft_name).'%20-site:planespotters.com%20-site:flickr.com%27'; |
|
461 | - else $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27%2B'.$aircraft_registration.'%20%2Baircraft%20-site:planespotters.com%20-site:flickr.com%27'; |
|
556 | + if (!isset($globalImageBingKey) || $globalImageBingKey == '') { |
|
557 | + return false; |
|
558 | + } |
|
559 | + if ($aircraft_name != '') { |
|
560 | + $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27'.$aircraft_registration.'%20'.urlencode($aircraft_name).'%20-site:planespotters.com%20-site:flickr.com%27'; |
|
561 | + } else { |
|
562 | + $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27%2B'.$aircraft_registration.'%20%2Baircraft%20-site:planespotters.com%20-site:flickr.com%27'; |
|
563 | + } |
|
462 | 564 | $headers = array("Authorization: Basic " . base64_encode("ignored:".$globalImageBingKey)); |
463 | 565 | $data = $Common->getData($url,'get','',$headers); |
464 | 566 | $result = json_decode($data); |
@@ -513,17 +615,25 @@ discard block |
||
513 | 615 | public function fromWikimedia($type,$registration,$name='') { |
514 | 616 | $Common = new Common(); |
515 | 617 | if ($type == 'aircraft') { |
516 | - if ($name != '') $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$registration.'"%20'.urlencode($name); |
|
517 | - else $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$registration.'"%20aircraft'; |
|
618 | + if ($name != '') { |
|
619 | + $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$registration.'"%20'.urlencode($name); |
|
620 | + } else { |
|
621 | + $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$registration.'"%20aircraft'; |
|
622 | + } |
|
518 | 623 | } elseif ($type == 'marine') { |
519 | - if ($name != '') $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.urlencode($name).'"'; |
|
520 | - else return false; |
|
624 | + if ($name != '') { |
|
625 | + $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.urlencode($name).'"'; |
|
626 | + } else { |
|
627 | + return false; |
|
628 | + } |
|
521 | 629 | } |
522 | 630 | $data = $Common->getData($url); |
523 | 631 | $result = json_decode($data); |
524 | 632 | if (isset($result->query->search[0]->title)) { |
525 | 633 | $fileo = $result->query->search[0]->title; |
526 | - if (substr($fileo,-3) == 'pdf') return false; |
|
634 | + if (substr($fileo,-3) == 'pdf') { |
|
635 | + return false; |
|
636 | + } |
|
527 | 637 | $file = urlencode($fileo); |
528 | 638 | $url2 = 'https://commons.wikimedia.org/w/api.php?action=query&format=json&continue&iilimit=500&prop=imageinfo&iiprop=user|url|size|mime|sha1|timestamp&iiurlwidth=200%27&titles='.$file; |
529 | 639 | $data2 = $Common->getData($url2); |
@@ -594,18 +704,27 @@ discard block |
||
594 | 704 | $image_url = array(); |
595 | 705 | $image_url['thumbnail'] = $url_thumbnail; |
596 | 706 | $image_url['original'] = $url; |
597 | - if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) $exifCopyright = $this->getExifCopyright($url); |
|
598 | - else $exifCopyright = ''; |
|
599 | - if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
600 | - elseif (isset($source['copyright'])) $image_url['copyright'] = $source['copyright']; |
|
601 | - else $image_url['copyright'] = $source['source_website']; |
|
707 | + if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) { |
|
708 | + $exifCopyright = $this->getExifCopyright($url); |
|
709 | + } else { |
|
710 | + $exifCopyright = ''; |
|
711 | + } |
|
712 | + if ($exifCopyright != '') { |
|
713 | + $image_url['copyright'] = $exifCopyright; |
|
714 | + } elseif (isset($source['copyright'])) { |
|
715 | + $image_url['copyright'] = $source['copyright']; |
|
716 | + } else { |
|
717 | + $image_url['copyright'] = $source['source_website']; |
|
718 | + } |
|
602 | 719 | $image_url['source_website'] = $source['source_website']; |
603 | 720 | $image_url['source'] = $source['source']; |
604 | 721 | return $image_url; |
605 | 722 | } |
606 | 723 | } |
607 | 724 | return false; |
608 | - } else return false; |
|
725 | + } else { |
|
726 | + return false; |
|
727 | + } |
|
609 | 728 | if (!empty($globalMarineImageCustomSources) && $type == 'marine') { |
610 | 729 | $customsources = array(); |
611 | 730 | if (!isset($globalMarineImageCustomSources[0])) { |
@@ -630,18 +749,27 @@ discard block |
||
630 | 749 | $image_url = array(); |
631 | 750 | $image_url['thumbnail'] = $url_thumbnail; |
632 | 751 | $image_url['original'] = $url; |
633 | - if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) $exifCopyright = $this->getExifCopyright($url); |
|
634 | - else $exifCopyright = ''; |
|
635 | - if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
636 | - elseif (isset($source['copyright'])) $image_url['copyright'] = $source['copyright']; |
|
637 | - else $image_url['copyright'] = $source['source_website']; |
|
752 | + if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) { |
|
753 | + $exifCopyright = $this->getExifCopyright($url); |
|
754 | + } else { |
|
755 | + $exifCopyright = ''; |
|
756 | + } |
|
757 | + if ($exifCopyright != '') { |
|
758 | + $image_url['copyright'] = $exifCopyright; |
|
759 | + } elseif (isset($source['copyright'])) { |
|
760 | + $image_url['copyright'] = $source['copyright']; |
|
761 | + } else { |
|
762 | + $image_url['copyright'] = $source['source_website']; |
|
763 | + } |
|
638 | 764 | $image_url['source_website'] = $source['source_website']; |
639 | 765 | $image_url['source'] = $source['source']; |
640 | 766 | return $image_url; |
641 | 767 | } |
642 | 768 | } |
643 | 769 | return false; |
644 | - } else return false; |
|
770 | + } else { |
|
771 | + return false; |
|
772 | + } |
|
645 | 773 | } |
646 | 774 | } |
647 | 775 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | require_once(dirname(__FILE__).'/class.create_db.php'); |
11 | 11 | require_once(dirname(__FILE__).'/class.update_schema.php'); |
12 | 12 | require_once(dirname(__FILE__).'/class.settings.php'); |
13 | -$title="Install"; |
|
13 | +$title = "Install"; |
|
14 | 14 | require(dirname(__FILE__).'/../require/settings.php'); |
15 | 15 | require(dirname(__FILE__).'/header.php'); |
16 | 16 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | if (!extension_loaded('curl')) { |
70 | 70 | $error[] = "Curl is not loaded."; |
71 | 71 | } |
72 | -if(function_exists('apache_get_modules') ){ |
|
73 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
72 | +if (function_exists('apache_get_modules')) { |
|
73 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
74 | 74 | $error[] = "mod_rewrite is not available."; |
75 | 75 | } |
76 | 76 | /* |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>'; |
87 | 87 | if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { |
88 | 88 | if (function_exists('get_headers')) { |
89 | - $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); |
|
90 | - if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { |
|
89 | + $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); |
|
90 | + if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { |
|
91 | 91 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>'; |
92 | 92 | } |
93 | 93 | } |
@@ -439,13 +439,13 @@ discard block |
||
439 | 439 | ?> |
440 | 440 | <tr> |
441 | 441 | <?php |
442 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
442 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
443 | 443 | ?> |
444 | 444 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
445 | 445 | <td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td> |
446 | 446 | <?php |
447 | 447 | } else { |
448 | - $hostport = explode(':',$source['host']); |
|
448 | + $hostport = explode(':', $source['host']); |
|
449 | 449 | if (isset($hostport[1])) { |
450 | 450 | $host = $hostport[0]; |
451 | 451 | $port = $hostport[1]; |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | <br /> |
790 | 790 | <p> |
791 | 791 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
792 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
792 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
793 | 793 | </p> |
794 | 794 | <br /> |
795 | 795 | <p> |
@@ -835,14 +835,14 @@ discard block |
||
835 | 835 | $error = ''; |
836 | 836 | |
837 | 837 | if (isset($_POST['dbtype'])) { |
838 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
839 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
840 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
841 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
842 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
843 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
844 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
845 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
838 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
839 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
840 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
841 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
842 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
843 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
844 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
845 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
846 | 846 | |
847 | 847 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
848 | 848 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -862,48 +862,48 @@ discard block |
||
862 | 862 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
863 | 863 | */ |
864 | 864 | |
865 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
865 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
866 | 866 | |
867 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
868 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
869 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
870 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
871 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
867 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
868 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
869 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
870 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
871 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
872 | 872 | |
873 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
874 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
875 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
876 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
877 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
878 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
879 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
880 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
881 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey)); |
|
873 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
874 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
875 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
876 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
877 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
878 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
879 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
880 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
881 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey)); |
|
882 | 882 | |
883 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
884 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
885 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
886 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
887 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
888 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
883 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
884 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
885 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
886 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
887 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
888 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
889 | 889 | |
890 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
891 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
890 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
891 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
892 | 892 | |
893 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
894 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
895 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
893 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
894 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
895 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
896 | 896 | |
897 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
897 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
898 | 898 | if ($acars == 'acars') { |
899 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
899 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
900 | 900 | } else { |
901 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
901 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
902 | 902 | } |
903 | 903 | |
904 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
905 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
906 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
904 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
905 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
906 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
907 | 907 | |
908 | 908 | $source_name = $_POST['source_name']; |
909 | 909 | $source_latitude = $_POST['source_latitude']; |
@@ -917,8 +917,8 @@ discard block |
||
917 | 917 | |
918 | 918 | $sources = array(); |
919 | 919 | foreach ($source_name as $keys => $name) { |
920 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
921 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
920 | + if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]); |
|
921 | + else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]); |
|
922 | 922 | } |
923 | 923 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
924 | 924 | |
@@ -931,23 +931,23 @@ discard block |
||
931 | 931 | $sbsurl = $_POST['sbsurl']; |
932 | 932 | */ |
933 | 933 | |
934 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
935 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
936 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
937 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING); |
|
938 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
939 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
940 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
934 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
935 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
936 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
937 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING); |
|
938 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
939 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
940 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
941 | 941 | |
942 | - $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
|
943 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
944 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
945 | - $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
|
946 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
947 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
948 | - $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
|
949 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
950 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
942 | + $globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING); |
|
943 | + if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE')); |
|
944 | + else $settings = array_merge($settings, array('globalAircraft' => 'FALSE')); |
|
945 | + $globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING); |
|
946 | + if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE')); |
|
947 | + else $settings = array_merge($settings, array('globalTracker' => 'FALSE')); |
|
948 | + $globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING); |
|
949 | + if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE')); |
|
950 | + else $settings = array_merge($settings, array('globalMarine' => 'FALSE')); |
|
951 | 951 | |
952 | 952 | /* |
953 | 953 | $globalSBS1Hosts = array(); |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | } |
964 | 964 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
965 | 965 | */ |
966 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
966 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
967 | 967 | $host = $_POST['host']; |
968 | 968 | $port = $_POST['port']; |
969 | 969 | $name = $_POST['name']; |
@@ -978,96 +978,96 @@ discard block |
||
978 | 978 | else $cov = 'FALSE'; |
979 | 979 | if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
980 | 980 | else $arch = 'FALSE'; |
981 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch); |
|
981 | + if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch); |
|
982 | 982 | } |
983 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
983 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
984 | 984 | |
985 | 985 | /* |
986 | 986 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
987 | 987 | $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
988 | 988 | */ |
989 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
990 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
991 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
989 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
990 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
991 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
992 | 992 | |
993 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
994 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
993 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
994 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
995 | 995 | |
996 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
997 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
998 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
999 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
996 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
997 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
998 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
999 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
1000 | 1000 | |
1001 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
1002 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
1003 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
1001 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
1002 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
1003 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
1004 | 1004 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1005 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
1006 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1005 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
1006 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
1007 | 1007 | |
1008 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
1009 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
1010 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
1011 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
1012 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
1013 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
1014 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
1015 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
1008 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
1009 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
1010 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
1011 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
1012 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
1013 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
1014 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
1015 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
1016 | 1016 | |
1017 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
1018 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
1017 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
1018 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
1019 | 1019 | |
1020 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
1021 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
1020 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
1021 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
1022 | 1022 | |
1023 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
1023 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
1024 | 1024 | if ($archiveyear == "archiveyear") { |
1025 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
1025 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
1026 | 1026 | } else { |
1027 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
1027 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
1028 | 1028 | } |
1029 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1030 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1031 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1032 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1029 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1030 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1031 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1032 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1033 | 1033 | |
1034 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
1035 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
1036 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
1037 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
1034 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
1035 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
1036 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
1037 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
1038 | 1038 | |
1039 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
1040 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
1041 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
1039 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
1040 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
1041 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
1042 | 1042 | |
1043 | 1043 | // Create in settings.php keys not yet configurable if not already here |
1044 | 1044 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1045 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1045 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
1046 | 1046 | |
1047 | - $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
|
1047 | + $resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING); |
|
1048 | 1048 | if ($resetyearstats == 'resetyearstats') { |
1049 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE')); |
|
1049 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE')); |
|
1050 | 1050 | } else { |
1051 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE')); |
|
1051 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE')); |
|
1052 | 1052 | } |
1053 | 1053 | |
1054 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
1054 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
1055 | 1055 | if ($archive == 'archive') { |
1056 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
1056 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
1057 | 1057 | } else { |
1058 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
1058 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
1059 | 1059 | } |
1060 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
1060 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
1061 | 1061 | if ($daemon == 'daemon') { |
1062 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
1062 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
1063 | 1063 | } else { |
1064 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
1064 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
1065 | 1065 | } |
1066 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
1066 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
1067 | 1067 | if ($schedules == 'schedules') { |
1068 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
1068 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
1069 | 1069 | } else { |
1070 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
1070 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
1071 | 1071 | } |
1072 | 1072 | |
1073 | 1073 | /* |
@@ -1078,183 +1078,183 @@ discard block |
||
1078 | 1078 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
1079 | 1079 | } |
1080 | 1080 | */ |
1081 | - $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
|
1082 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1083 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1084 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1085 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1081 | + $settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); |
|
1082 | + if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); |
|
1083 | + else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); |
|
1084 | + if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); |
|
1085 | + else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); |
|
1086 | 1086 | if ($globalivao == 'ivao') { |
1087 | 1087 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
1088 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
1089 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1088 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
1089 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
1090 | 1090 | if ($globalvatsim == 'vatsim') { |
1091 | 1091 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
1092 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
1093 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1092 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
1093 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
1094 | 1094 | if ($globalphpvms == 'phpvms') { |
1095 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
1096 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1095 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
1096 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
1097 | 1097 | if ($globalvam == 'vam') { |
1098 | - $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
|
1099 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1098 | + $settings = array_merge($settings, array('globalVAM' => 'TRUE')); |
|
1099 | + } else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); |
|
1100 | 1100 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
1101 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
1102 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1101 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
1102 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
1103 | 1103 | |
1104 | 1104 | |
1105 | 1105 | |
1106 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
1106 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
1107 | 1107 | if ($notam == 'notam') { |
1108 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
1108 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
1109 | 1109 | } else { |
1110 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
1110 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
1111 | 1111 | } |
1112 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
1112 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
1113 | 1113 | if ($owner == 'owner') { |
1114 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
1114 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
1115 | 1115 | } else { |
1116 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
1116 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
1117 | 1117 | } |
1118 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING); |
|
1118 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING); |
|
1119 | 1119 | if ($map3d == 'map3d') { |
1120 | - $settings = array_merge($settings,array('globalMap3D' => 'TRUE')); |
|
1120 | + $settings = array_merge($settings, array('globalMap3D' => 'TRUE')); |
|
1121 | 1121 | } else { |
1122 | - $settings = array_merge($settings,array('globalMap3D' => 'FALSE')); |
|
1122 | + $settings = array_merge($settings, array('globalMap3D' => 'FALSE')); |
|
1123 | 1123 | } |
1124 | - $crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING); |
|
1124 | + $crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING); |
|
1125 | 1125 | if ($crash == 'crash') { |
1126 | - $settings = array_merge($settings,array('globalAccidents' => 'TRUE')); |
|
1126 | + $settings = array_merge($settings, array('globalAccidents' => 'TRUE')); |
|
1127 | 1127 | } else { |
1128 | - $settings = array_merge($settings,array('globalAccidents' => 'FALSE')); |
|
1128 | + $settings = array_merge($settings, array('globalAccidents' => 'FALSE')); |
|
1129 | 1129 | } |
1130 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING); |
|
1130 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING); |
|
1131 | 1131 | if ($mapsatellites == 'mapsatellites') { |
1132 | - $settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); |
|
1132 | + $settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); |
|
1133 | 1133 | } else { |
1134 | - $settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); |
|
1134 | + $settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); |
|
1135 | 1135 | } |
1136 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING); |
|
1136 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING); |
|
1137 | 1137 | if ($map3ddefault == 'map3ddefault') { |
1138 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); |
|
1138 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); |
|
1139 | 1139 | } else { |
1140 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); |
|
1140 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); |
|
1141 | 1141 | } |
1142 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
1142 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
1143 | 1143 | if ($translate == 'translate') { |
1144 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
1144 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
1145 | 1145 | } else { |
1146 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
1146 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
1147 | 1147 | } |
1148 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING); |
|
1148 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING); |
|
1149 | 1149 | if ($realairlines == 'realairlines') { |
1150 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); |
|
1150 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); |
|
1151 | 1151 | } else { |
1152 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); |
|
1152 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); |
|
1153 | 1153 | } |
1154 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
1154 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
1155 | 1155 | if ($estimation == 'estimation') { |
1156 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
1156 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
1157 | 1157 | } else { |
1158 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
1158 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
1159 | 1159 | } |
1160 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
1160 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
1161 | 1161 | if ($metar == 'metar') { |
1162 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
1162 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
1163 | 1163 | } else { |
1164 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
1164 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
1165 | 1165 | } |
1166 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
1166 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
1167 | 1167 | if ($metarcycle == 'metarcycle') { |
1168 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
1168 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
1169 | 1169 | } else { |
1170 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
1170 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
1171 | 1171 | } |
1172 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
1172 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
1173 | 1173 | if ($fork == 'fork') { |
1174 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
1174 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
1175 | 1175 | } else { |
1176 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
1176 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
1177 | 1177 | } |
1178 | 1178 | |
1179 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
1179 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
1180 | 1180 | if ($colormap == 'colormap') { |
1181 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
1181 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
1182 | 1182 | } else { |
1183 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
1183 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
1184 | 1184 | } |
1185 | 1185 | |
1186 | 1186 | if (isset($_POST['aircrafticoncolor'])) { |
1187 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
1188 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
1187 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
1188 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
1189 | 1189 | } |
1190 | 1190 | |
1191 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
1192 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
1191 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
1192 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
1193 | 1193 | |
1194 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
1195 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
1196 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
1197 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
1198 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
1199 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
1194 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
1195 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
1196 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
1197 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
1198 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
1199 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
1200 | 1200 | |
1201 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
1201 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
1202 | 1202 | if ($mappopup == 'mappopup') { |
1203 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
1203 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
1204 | 1204 | } else { |
1205 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
1205 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
1206 | 1206 | } |
1207 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
1207 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
1208 | 1208 | if ($airportpopup == 'airportpopup') { |
1209 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
1209 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
1210 | 1210 | } else { |
1211 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
1211 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
1212 | 1212 | } |
1213 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
1213 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
1214 | 1214 | if ($maphistory == 'maphistory') { |
1215 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
1215 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
1216 | 1216 | } else { |
1217 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
1217 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
1218 | 1218 | } |
1219 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
1219 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
1220 | 1220 | if ($flightroute == 'flightroute') { |
1221 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
1221 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
1222 | 1222 | } else { |
1223 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
1223 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
1224 | 1224 | } |
1225 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING); |
|
1225 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING); |
|
1226 | 1226 | if ($allflights == 'allflights') { |
1227 | - $settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); |
|
1227 | + $settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); |
|
1228 | 1228 | } else { |
1229 | - $settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); |
|
1229 | + $settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); |
|
1230 | 1230 | } |
1231 | - $bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING); |
|
1231 | + $bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING); |
|
1232 | 1232 | if ($bbox == 'bbox') { |
1233 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE')); |
|
1233 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE')); |
|
1234 | 1234 | } else { |
1235 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE')); |
|
1235 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE')); |
|
1236 | 1236 | } |
1237 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING); |
|
1237 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING); |
|
1238 | 1238 | if ($waypoints == 'waypoints') { |
1239 | - $settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); |
|
1239 | + $settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); |
|
1240 | 1240 | } else { |
1241 | - $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
|
1241 | + $settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); |
|
1242 | 1242 | } |
1243 | 1243 | |
1244 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1244 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
1245 | 1245 | |
1246 | 1246 | // Set some defaults values... |
1247 | 1247 | if (!isset($globalAircraftImageSources)) { |
1248 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1249 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1248 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
1249 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1250 | 1250 | } |
1251 | 1251 | |
1252 | 1252 | if (!isset($globalSchedulesSources)) { |
1253 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1254 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1253 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
1254 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1255 | 1255 | } |
1256 | 1256 | |
1257 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
1257 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
1258 | 1258 | |
1259 | 1259 | if ($error == '') settings::modify_settings($settings); |
1260 | 1260 | if ($error == '') settings::comment_settings($settings_comment); |
@@ -131,45 +131,72 @@ discard block |
||
131 | 131 | </div> |
132 | 132 | <p> |
133 | 133 | <label for="dbhost">Database hostname</label> |
134 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
134 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
135 | + print $globalDBhost; |
|
136 | +} |
|
137 | +?>" /> |
|
135 | 138 | </p> |
136 | 139 | <p> |
137 | 140 | <label for="dbport">Database port</label> |
138 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
141 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
142 | + print $globalDBport; |
|
143 | +} |
|
144 | +?>" /> |
|
139 | 145 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
140 | 146 | </p> |
141 | 147 | <p> |
142 | 148 | <label for="dbname">Database name</label> |
143 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
149 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
150 | + print $globalDBname; |
|
151 | +} |
|
152 | +?>" /> |
|
144 | 153 | </p> |
145 | 154 | <p> |
146 | 155 | <label for="dbuser">Database user</label> |
147 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
156 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
157 | + print $globalDBuser; |
|
158 | +} |
|
159 | +?>" /> |
|
148 | 160 | </p> |
149 | 161 | <p> |
150 | 162 | <label for="dbuserpass">Database user password</label> |
151 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
163 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
164 | + print $globalDBpass; |
|
165 | +} |
|
166 | +?>" /> |
|
152 | 167 | </p> |
153 | 168 | </fieldset> |
154 | 169 | <fieldset id="site"> |
155 | 170 | <legend>Site configuration</legend> |
156 | 171 | <p> |
157 | 172 | <label for="sitename">Site name</label> |
158 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
173 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
174 | + print $globalName; |
|
175 | +} |
|
176 | +?>" /> |
|
159 | 177 | </p> |
160 | 178 | <p> |
161 | 179 | <label for="siteurl">Site directory</label> |
162 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
180 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
181 | + print $globalURL; |
|
182 | +} |
|
183 | +?>" /> |
|
163 | 184 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
164 | 185 | </p> |
165 | 186 | <p> |
166 | 187 | <label for="timezone">Timezone</label> |
167 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
188 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
189 | + print $globalTimezone; |
|
190 | +} |
|
191 | +?>" /> |
|
168 | 192 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
169 | 193 | </p> |
170 | 194 | <p> |
171 | 195 | <label for="language">Language</label> |
172 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
196 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
197 | + print $globalLanguage; |
|
198 | +} |
|
199 | +?>" /> |
|
173 | 200 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
174 | 201 | </p> |
175 | 202 | </fieldset> |
@@ -190,11 +217,17 @@ discard block |
||
190 | 217 | <div id="mapbox_data"> |
191 | 218 | <p> |
192 | 219 | <label for="mapboxid">Mapbox id</label> |
193 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
220 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
221 | + print $globalMapboxId; |
|
222 | +} |
|
223 | +?>" /> |
|
194 | 224 | </p> |
195 | 225 | <p> |
196 | 226 | <label for="mapboxtoken">Mapbox token</label> |
197 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
227 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
228 | + print $globalMapboxToken; |
|
229 | +} |
|
230 | +?>" /> |
|
198 | 231 | </p> |
199 | 232 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
200 | 233 | </div> |
@@ -202,7 +235,10 @@ discard block |
||
202 | 235 | <div id="google_data"> |
203 | 236 | <p> |
204 | 237 | <label for="googlekey">Google API key</label> |
205 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
238 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
239 | + print $globalGoogleAPIKey; |
|
240 | +} |
|
241 | +?>" /> |
|
206 | 242 | <p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p> |
207 | 243 | </p> |
208 | 244 | </div> |
@@ -210,7 +246,10 @@ discard block |
||
210 | 246 | <div id="bing_data"> |
211 | 247 | <p> |
212 | 248 | <label for="bingkey">Bing Map key</label> |
213 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
249 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
250 | + print $globalBingMapKey; |
|
251 | +} |
|
252 | +?>" /> |
|
214 | 253 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
215 | 254 | </p> |
216 | 255 | </div> |
@@ -218,7 +257,10 @@ discard block |
||
218 | 257 | <div id="mapquest_data"> |
219 | 258 | <p> |
220 | 259 | <label for="mapquestkey">MapQuest key</label> |
221 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
260 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
261 | + print $globalMapQuestKey; |
|
262 | +} |
|
263 | +?>" /> |
|
222 | 264 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
223 | 265 | </p> |
224 | 266 | </div> |
@@ -226,11 +268,17 @@ discard block |
||
226 | 268 | <div id="here_data"> |
227 | 269 | <p> |
228 | 270 | <label for="hereappid">Here App_Id</label> |
229 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
271 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
272 | + print $globalHereappId; |
|
273 | +} |
|
274 | +?>" /> |
|
230 | 275 | </p> |
231 | 276 | <p> |
232 | 277 | <label for="hereappcode">Here App_Code</label> |
233 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
278 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
279 | + print $globalHereappCode; |
|
280 | +} |
|
281 | +?>" /> |
|
234 | 282 | </p> |
235 | 283 | <p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p> |
236 | 284 | </div> |
@@ -239,42 +287,86 @@ discard block |
||
239 | 287 | <legend>Coverage area</legend> |
240 | 288 | <p> |
241 | 289 | <label for="latitudemax">The maximum latitude (north)</label> |
242 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
290 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
291 | + print $globalLatitudeMax; |
|
292 | +} |
|
293 | +?>" /> |
|
243 | 294 | </p> |
244 | 295 | <p> |
245 | 296 | <label for="latitudemin">The minimum latitude (south)</label> |
246 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
297 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
298 | + print $globalLatitudeMin; |
|
299 | +} |
|
300 | +?>" /> |
|
247 | 301 | </p> |
248 | 302 | <p> |
249 | 303 | <label for="longitudemax">The maximum longitude (west)</label> |
250 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
304 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
305 | + print $globalLongitudeMax; |
|
306 | +} |
|
307 | +?>" /> |
|
251 | 308 | </p> |
252 | 309 | <p> |
253 | 310 | <label for="longitudemin">The minimum longitude (east)</label> |
254 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
311 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
312 | + print $globalLongitudeMin; |
|
313 | +} |
|
314 | +?>" /> |
|
255 | 315 | </p> |
256 | 316 | <p> |
257 | 317 | <label for="latitudecenter">The latitude center</label> |
258 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
318 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
319 | + print $globalCenterLatitude; |
|
320 | +} |
|
321 | +?>" /> |
|
259 | 322 | </p> |
260 | 323 | <p> |
261 | 324 | <label for="longitudecenter">The longitude center</label> |
262 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
325 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
326 | + print $globalCenterLongitude; |
|
327 | +} |
|
328 | +?>" /> |
|
263 | 329 | </p> |
264 | 330 | <p> |
265 | 331 | <label for="livezoom">Default Zoom on live map</label> |
266 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
332 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
333 | + print $globalLiveZoom; |
|
334 | +} else { |
|
335 | + print '9'; |
|
336 | +} |
|
337 | +?>" /> |
|
267 | 338 | </p> |
268 | 339 | <p> |
269 | 340 | <label for="squawk_country">Country for squawk usage</label> |
270 | 341 | <select name="squawk_country" id="squawk_country"> |
271 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
272 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
273 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
274 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
275 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
276 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
277 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
342 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
343 | + print ' selected '; |
|
344 | +} |
|
345 | +?>>UK</option> |
|
346 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
347 | + print ' selected '; |
|
348 | +} |
|
349 | +?>>NZ</option> |
|
350 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
351 | + print ' selected '; |
|
352 | +} |
|
353 | +?>>US</option> |
|
354 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
355 | + print ' selected '; |
|
356 | +} |
|
357 | +?>>AU</option> |
|
358 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
359 | + print ' selected '; |
|
360 | +} |
|
361 | +?>>NL</option> |
|
362 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
363 | + print ' selected '; |
|
364 | +} |
|
365 | +?>>FR</option> |
|
366 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
367 | + print ' selected '; |
|
368 | +} |
|
369 | +?>>TR</option> |
|
278 | 370 | </select> |
279 | 371 | </p> |
280 | 372 | </fieldset> |
@@ -283,15 +375,24 @@ discard block |
||
283 | 375 | <p><i>Only put in DB flights that are inside a circle</i></p> |
284 | 376 | <p> |
285 | 377 | <label for="latitude">Center latitude</label> |
286 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
378 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
379 | + echo $globalDistanceIgnore['latitude']; |
|
380 | +} |
|
381 | +?>" /> |
|
287 | 382 | </p> |
288 | 383 | <p> |
289 | 384 | <label for="longitude">Center longitude</label> |
290 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
385 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
386 | + echo $globalDistanceIgnore['longitude']; |
|
387 | +} |
|
388 | +?>" /> |
|
291 | 389 | </p> |
292 | 390 | <p> |
293 | 391 | <label for="Distance">Distance (in km)</label> |
294 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
392 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
393 | + echo $globalDistanceIgnore['distance']; |
|
394 | +} |
|
395 | +?>" /> |
|
295 | 396 | </p> |
296 | 397 | </fieldset> |
297 | 398 | <fieldset id="sourceloc"> |
@@ -397,11 +498,17 @@ discard block |
||
397 | 498 | <div id="flightaware_data"> |
398 | 499 | <p> |
399 | 500 | <label for="flightawareusername">FlightAware username</label> |
400 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
501 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
502 | + print $globalFlightAwareUsername; |
|
503 | +} |
|
504 | +?>" /> |
|
401 | 505 | </p> |
402 | 506 | <p> |
403 | 507 | <label for="flightawarepassword">FlightAware password/API key</label> |
404 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
508 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
509 | + print $globalFlightAwarePassword; |
|
510 | +} |
|
511 | +?>" /> |
|
405 | 512 | </p> |
406 | 513 | </div> |
407 | 514 | --> |
@@ -461,28 +568,88 @@ discard block |
||
461 | 568 | ?> |
462 | 569 | <td> |
463 | 570 | <select name="format[]" id="format"> |
464 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
465 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
466 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
467 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
468 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
469 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
470 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
471 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
472 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
473 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
474 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
475 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
476 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
477 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
478 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
479 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
480 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
571 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
572 | + print 'selected'; |
|
573 | +} |
|
574 | +?>>Auto</option> |
|
575 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
576 | + print 'selected'; |
|
577 | +} |
|
578 | +?>>SBS</option> |
|
579 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
580 | + print 'selected'; |
|
581 | +} |
|
582 | +?>>TSV</option> |
|
583 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
584 | + print 'selected'; |
|
585 | +} |
|
586 | +?>>Raw</option> |
|
587 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
588 | + print 'selected'; |
|
589 | +} |
|
590 | +?>>APRS</option> |
|
591 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
592 | + print 'selected'; |
|
593 | +} |
|
594 | +?>>Radarcape deltadb.txt</option> |
|
595 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
596 | + print 'selected'; |
|
597 | +} |
|
598 | +?>>Vatsim</option> |
|
599 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
600 | + print 'selected'; |
|
601 | +} |
|
602 | +?>>Virtual Radar Server AircraftList.json</option> |
|
603 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
604 | + print 'selected'; |
|
605 | +} |
|
606 | +?>>Virtual Radar Server TCP</option> |
|
607 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
608 | + print 'selected'; |
|
609 | +} |
|
610 | +?>>phpVMS</option> |
|
611 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
612 | + print 'selected'; |
|
613 | +} |
|
614 | +?>>Virtual Airlines Manager</option> |
|
615 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
616 | + print 'selected'; |
|
617 | +} |
|
618 | +?>>IVAO</option> |
|
619 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
620 | + print 'selected'; |
|
621 | +} |
|
622 | +?>>FlightGear Multiplayer</option> |
|
623 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
624 | + print 'selected'; |
|
625 | +} |
|
626 | +?>>FlightGear Singleplayer</option> |
|
627 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
628 | + print 'selected'; |
|
629 | +} |
|
630 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
631 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
632 | + print 'selected'; |
|
633 | +} |
|
634 | +?>>ACARS SBS-3 over TCP</option> |
|
635 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
636 | + print 'selected'; |
|
637 | +} |
|
638 | +?>>NMEA AIS over TCP</option> |
|
481 | 639 | </select> |
482 | 640 | </td> |
483 | - <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /></td> |
|
484 | - <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td> |
|
485 | - <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td> |
|
641 | + <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
642 | + print $source['name']; |
|
643 | +} |
|
644 | +?>" /></td> |
|
645 | + <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) { |
|
646 | + print 'checked'; |
|
647 | +} |
|
648 | +?> /></td> |
|
649 | + <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) { |
|
650 | + print 'checked'; |
|
651 | +} |
|
652 | +?> /></td> |
|
486 | 653 | <td><input type="button" id="delhost" value="Delete" onclick="deleteRow(this)" /> <input type="button" id="addhost" value="Add" onclick="insRow()" /></td> |
487 | 654 | </tr> |
488 | 655 | <?php |
@@ -531,11 +698,17 @@ discard block |
||
531 | 698 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
532 | 699 | <p> |
533 | 700 | <label for="acarshost">ACARS UDP host</label> |
534 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
701 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
702 | + print $globalACARSHost; |
|
703 | +} |
|
704 | +?>" /> |
|
535 | 705 | </p> |
536 | 706 | <p> |
537 | 707 | <label for="acarsport">ACARS UDP port</label> |
538 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
708 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
709 | + print $globalACARSPort; |
|
710 | +} |
|
711 | +?>" /> |
|
539 | 712 | </p> |
540 | 713 | </fieldset> |
541 | 714 | </div> |
@@ -615,13 +788,19 @@ discard block |
||
615 | 788 | <div id="schedules_options"> |
616 | 789 | <p> |
617 | 790 | <label for="britishairways">British Airways API Key</label> |
618 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
791 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
792 | + print $globalBritishAirwaysKey; |
|
793 | +} |
|
794 | +?>" /> |
|
619 | 795 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
620 | 796 | </p> |
621 | 797 | <!-- |
622 | 798 | <p> |
623 | 799 | <label for="transavia">Transavia Test API Consumer Key</label> |
624 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
800 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
801 | + print $globalTransaviaKey; |
|
802 | +} |
|
803 | +?>" /> |
|
625 | 804 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
626 | 805 | </p> |
627 | 806 | --> |
@@ -630,10 +809,16 @@ discard block |
||
630 | 809 | <b>Lufthansa API Key</b> |
631 | 810 | <p> |
632 | 811 | <label for="lufthansakey">Key</label> |
633 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
812 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
813 | + print $globalLufthansaKey['key']; |
|
814 | +} |
|
815 | +?>" /> |
|
634 | 816 | </p><p> |
635 | 817 | <label for="lufthansasecret">Secret</label> |
636 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
818 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
819 | + print $globalLufthansaKey['secret']; |
|
820 | +} |
|
821 | +?>" /> |
|
637 | 822 | </p> |
638 | 823 | </div> |
639 | 824 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -653,7 +838,10 @@ discard block |
||
653 | 838 | </p> |
654 | 839 | <p> |
655 | 840 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
656 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
841 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
842 | + print $globalNOTAMSource; |
|
843 | +} |
|
844 | +?>" /> |
|
657 | 845 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
658 | 846 | </p> |
659 | 847 | <br /> |
@@ -669,14 +857,20 @@ discard block |
||
669 | 857 | <div id="metarsrc"> |
670 | 858 | <p> |
671 | 859 | <label for="metarsource">URL of your METAR source</label> |
672 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
860 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
861 | + print $globalMETARurl; |
|
862 | +} |
|
863 | +?>" /> |
|
673 | 864 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
674 | 865 | </p> |
675 | 866 | </div> |
676 | 867 | <br /> |
677 | 868 | <p> |
678 | 869 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
679 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
870 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
871 | + print $globalBitlyAccessToken; |
|
872 | +} |
|
873 | +?>" /> |
|
680 | 874 | </p> |
681 | 875 | <br /> |
682 | 876 | <p> |
@@ -696,7 +890,12 @@ discard block |
||
696 | 890 | </p> |
697 | 891 | <p> |
698 | 892 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
699 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" /> |
|
893 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
894 | + print $globalArchiveMonths; |
|
895 | +} else { |
|
896 | + echo '0'; |
|
897 | +} |
|
898 | +?>" /> |
|
700 | 899 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
701 | 900 | </p> |
702 | 901 | <p> |
@@ -706,12 +905,22 @@ discard block |
||
706 | 905 | </p> |
707 | 906 | <p> |
708 | 907 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
709 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" /> |
|
908 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
909 | + print $globalArchiveKeepMonths; |
|
910 | +} else { |
|
911 | + echo '0'; |
|
912 | +} |
|
913 | +?>" /> |
|
710 | 914 | <p class="help-block">0 to disable</p> |
711 | 915 | </p> |
712 | 916 | <p> |
713 | 917 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
714 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" /> |
|
918 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
919 | + print $globalArchiveKeepTrackMonths; |
|
920 | +} else { |
|
921 | + echo '0'; |
|
922 | +} |
|
923 | +?>" /> |
|
715 | 924 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
716 | 925 | </p> |
717 | 926 | <br /> |
@@ -721,7 +930,12 @@ discard block |
||
721 | 930 | <p class="help-block">Uncheck if the script is running as cron job</p> |
722 | 931 | <div id="cronends"> |
723 | 932 | <label for="cronend">Run script for xx seconds</label> |
724 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
933 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
934 | + print $globalCronEnd; |
|
935 | +} else { |
|
936 | + print '0'; |
|
937 | +} |
|
938 | +?>" /> |
|
725 | 939 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
726 | 940 | </div> |
727 | 941 | </p> |
@@ -766,15 +980,30 @@ discard block |
||
766 | 980 | <br /> |
767 | 981 | <p> |
768 | 982 | <label for="refresh">Show flights detected since xxx seconds</label> |
769 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
983 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
984 | + echo $globalLiveInterval; |
|
985 | +} else { |
|
986 | + echo '200'; |
|
987 | +} |
|
988 | +?>" /> |
|
770 | 989 | </p> |
771 | 990 | <p> |
772 | 991 | <label for="maprefresh">Live map refresh (in seconds)</label> |
773 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
992 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
993 | + echo $globalMapRefresh; |
|
994 | +} else { |
|
995 | + echo '30'; |
|
996 | +} |
|
997 | +?>" /> |
|
774 | 998 | </p> |
775 | 999 | <p> |
776 | 1000 | <label for="mapidle">Map idle timeout (in minutes)</label> |
777 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
1001 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
1002 | + echo $globalMapIdleTimeout; |
|
1003 | +} else { |
|
1004 | + echo '30'; |
|
1005 | +} |
|
1006 | +?>" /> |
|
778 | 1007 | <p class="help-block">0 to disable</p> |
779 | 1008 | </p> |
780 | 1009 | <p> |
@@ -784,12 +1013,20 @@ discard block |
||
784 | 1013 | <br /> |
785 | 1014 | <p> |
786 | 1015 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
787 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
1016 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
1017 | + echo $globalClosestMinDist; |
|
1018 | +} else { |
|
1019 | + echo '50'; |
|
1020 | +} |
|
1021 | +?>" /> |
|
788 | 1022 | </p> |
789 | 1023 | <br /> |
790 | 1024 | <p> |
791 | 1025 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
792 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
1026 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
1027 | + echo $globalAircraftSize; |
|
1028 | +} |
|
1029 | +?>" /> |
|
793 | 1030 | </p> |
794 | 1031 | <br /> |
795 | 1032 | <p> |
@@ -797,7 +1034,12 @@ discard block |
||
797 | 1034 | if (extension_loaded('gd') && function_exists('gd_info')) { |
798 | 1035 | ?> |
799 | 1036 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
800 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
1037 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
1038 | + echo $globalAircraftIconColor; |
|
1039 | +} else { |
|
1040 | + echo '1a3151'; |
|
1041 | +} |
|
1042 | +?>" /> |
|
801 | 1043 | <?php |
802 | 1044 | if (!is_writable('../cache')) { |
803 | 1045 | ?> |
@@ -815,8 +1057,18 @@ discard block |
||
815 | 1057 | <p> |
816 | 1058 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
817 | 1059 | <div class="range"> |
818 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
819 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
1060 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
1061 | + echo $globalAirportZoom; |
|
1062 | +} else { |
|
1063 | + echo '7'; |
|
1064 | +} |
|
1065 | +?>" /> |
|
1066 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
1067 | + echo $globalAirportZoom; |
|
1068 | +} else { |
|
1069 | + echo '7'; |
|
1070 | +} |
|
1071 | +?></output> |
|
820 | 1072 | </div> |
821 | 1073 | </p> |
822 | 1074 | </fieldset> |
@@ -844,8 +1096,12 @@ discard block |
||
844 | 1096 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
845 | 1097 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
846 | 1098 | |
847 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
848 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1099 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
1100 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
1101 | + } |
|
1102 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
1103 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1104 | + } |
|
849 | 1105 | |
850 | 1106 | $_SESSION['database_root'] = $dbroot; |
851 | 1107 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -912,15 +1168,23 @@ discard block |
||
912 | 1168 | $source_city = $_POST['source_city']; |
913 | 1169 | $source_country = $_POST['source_country']; |
914 | 1170 | $source_ref = $_POST['source_ref']; |
915 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
916 | - else $source_id = array(); |
|
1171 | + if (isset($source_id)) { |
|
1172 | + $source_id = $_POST['source_id']; |
|
1173 | + } else { |
|
1174 | + $source_id = array(); |
|
1175 | + } |
|
917 | 1176 | |
918 | 1177 | $sources = array(); |
919 | 1178 | foreach ($source_name as $keys => $name) { |
920 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
921 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1179 | + if (isset($source_id[$keys])) { |
|
1180 | + $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1181 | + } else { |
|
1182 | + $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1183 | + } |
|
1184 | + } |
|
1185 | + if (count($sources) > 0) { |
|
1186 | + $_SESSION['sources'] = $sources; |
|
922 | 1187 | } |
923 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
924 | 1188 | |
925 | 1189 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
926 | 1190 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -940,14 +1204,23 @@ discard block |
||
940 | 1204 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
941 | 1205 | |
942 | 1206 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
943 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
944 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1207 | + if ($globalaircraft == 'aircraft') { |
|
1208 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1209 | + } else { |
|
1210 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1211 | + } |
|
945 | 1212 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
946 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
947 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1213 | + if ($globaltracker == 'tracker') { |
|
1214 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1215 | + } else { |
|
1216 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1217 | + } |
|
948 | 1218 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
949 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
950 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1219 | + if ($globalmarine == 'marine') { |
|
1220 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1221 | + } else { |
|
1222 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1223 | + } |
|
951 | 1224 | |
952 | 1225 | /* |
953 | 1226 | $globalSBS1Hosts = array(); |
@@ -968,17 +1241,31 @@ discard block |
||
968 | 1241 | $port = $_POST['port']; |
969 | 1242 | $name = $_POST['name']; |
970 | 1243 | $format = $_POST['format']; |
971 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
972 | - else $sourcestats = array(); |
|
973 | - if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive']; |
|
974 | - else $noarchive = array(); |
|
1244 | + if (isset($_POST['sourcestats'])) { |
|
1245 | + $sourcestats = $_POST['sourcestats']; |
|
1246 | + } else { |
|
1247 | + $sourcestats = array(); |
|
1248 | + } |
|
1249 | + if (isset($_POST['noarchive'])) { |
|
1250 | + $noarchive = $_POST['noarchive']; |
|
1251 | + } else { |
|
1252 | + $noarchive = array(); |
|
1253 | + } |
|
975 | 1254 | $gSources = array(); |
976 | 1255 | foreach ($host as $key => $h) { |
977 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
978 | - else $cov = 'FALSE'; |
|
979 | - if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
|
980 | - else $arch = 'FALSE'; |
|
981 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch); |
|
1256 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
1257 | + $cov = 'TRUE'; |
|
1258 | + } else { |
|
1259 | + $cov = 'FALSE'; |
|
1260 | + } |
|
1261 | + if (isset($noarchive[$key]) && $noarchive[$key] == 1) { |
|
1262 | + $arch = 'TRUE'; |
|
1263 | + } else { |
|
1264 | + $arch = 'FALSE'; |
|
1265 | + } |
|
1266 | + if ($h != '') { |
|
1267 | + $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch); |
|
1268 | + } |
|
982 | 1269 | } |
983 | 1270 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
984 | 1271 | |
@@ -1003,7 +1290,9 @@ discard block |
||
1003 | 1290 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
1004 | 1291 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1005 | 1292 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
1006 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1293 | + } else { |
|
1294 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1295 | + } |
|
1007 | 1296 | |
1008 | 1297 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
1009 | 1298 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1042,7 +1331,9 @@ discard block |
||
1042 | 1331 | |
1043 | 1332 | // Create in settings.php keys not yet configurable if not already here |
1044 | 1333 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1045 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1334 | + if (!isset($globalDebug)) { |
|
1335 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1336 | + } |
|
1046 | 1337 | |
1047 | 1338 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
1048 | 1339 | if ($resetyearstats == 'resetyearstats') { |
@@ -1079,27 +1370,43 @@ discard block |
||
1079 | 1370 | } |
1080 | 1371 | */ |
1081 | 1372 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
1082 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1083 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1084 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1085 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1373 | + if ($globalsbs == 'sbs') { |
|
1374 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1375 | + } else { |
|
1376 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1377 | + } |
|
1378 | + if ($globalaprs == 'aprs') { |
|
1379 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1380 | + } else { |
|
1381 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1382 | + } |
|
1086 | 1383 | if ($globalivao == 'ivao') { |
1087 | 1384 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
1088 | 1385 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
1089 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1386 | + } else { |
|
1387 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1388 | + } |
|
1090 | 1389 | if ($globalvatsim == 'vatsim') { |
1091 | 1390 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
1092 | 1391 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
1093 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1392 | + } else { |
|
1393 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1394 | + } |
|
1094 | 1395 | if ($globalphpvms == 'phpvms') { |
1095 | 1396 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
1096 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1397 | + } else { |
|
1398 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1399 | + } |
|
1097 | 1400 | if ($globalvam == 'vam') { |
1098 | 1401 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
1099 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1402 | + } else { |
|
1403 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1404 | + } |
|
1100 | 1405 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
1101 | 1406 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
1102 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1407 | + } else { |
|
1408 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1409 | + } |
|
1103 | 1410 | |
1104 | 1411 | |
1105 | 1412 | |
@@ -1241,7 +1548,9 @@ discard block |
||
1241 | 1548 | $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
1242 | 1549 | } |
1243 | 1550 | |
1244 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1551 | + if (!isset($globalTransaction)) { |
|
1552 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1553 | + } |
|
1245 | 1554 | |
1246 | 1555 | // Set some defaults values... |
1247 | 1556 | if (!isset($globalAircraftImageSources)) { |
@@ -1256,15 +1565,23 @@ discard block |
||
1256 | 1565 | |
1257 | 1566 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1258 | 1567 | |
1259 | - if ($error == '') settings::modify_settings($settings); |
|
1260 | - if ($error == '') settings::comment_settings($settings_comment); |
|
1568 | + if ($error == '') { |
|
1569 | + settings::modify_settings($settings); |
|
1570 | + } |
|
1571 | + if ($error == '') { |
|
1572 | + settings::comment_settings($settings_comment); |
|
1573 | + } |
|
1261 | 1574 | if ($error != '') { |
1262 | 1575 | print '<div class="info column">'.$error.'</div>'; |
1263 | 1576 | require('../footer.php'); |
1264 | 1577 | exit; |
1265 | 1578 | } else { |
1266 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
1267 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
1579 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
1580 | + $_SESSION['waypoints'] = 1; |
|
1581 | + } |
|
1582 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
1583 | + $_SESSION['owner'] = 1; |
|
1584 | + } |
|
1268 | 1585 | if (isset($_POST['createdb'])) { |
1269 | 1586 | $_SESSION['install'] = 'database_create'; |
1270 | 1587 | } else { |
@@ -1305,10 +1622,18 @@ discard block |
||
1305 | 1622 | $popw = false; |
1306 | 1623 | foreach ($_SESSION['done'] as $done) { |
1307 | 1624 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
1308 | - if ($done == 'Create database') $pop = true; |
|
1309 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1310 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1311 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1625 | + if ($done == 'Create database') { |
|
1626 | + $pop = true; |
|
1627 | + } |
|
1628 | + if ($_SESSION['install'] == 'database_create') { |
|
1629 | + $pop = true; |
|
1630 | + } |
|
1631 | + if ($_SESSION['install'] == 'database_import') { |
|
1632 | + $popi = true; |
|
1633 | + } |
|
1634 | + if ($_SESSION['install'] == 'waypoints') { |
|
1635 | + $popw = true; |
|
1636 | + } |
|
1312 | 1637 | } |
1313 | 1638 | if ($pop) { |
1314 | 1639 | sleep(5); |
@@ -1319,7 +1644,9 @@ discard block |
||
1319 | 1644 | } else if ($popw) { |
1320 | 1645 | sleep(5); |
1321 | 1646 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
1322 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1647 | + } else { |
|
1648 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1649 | + } |
|
1323 | 1650 | print '</div></ul>'; |
1324 | 1651 | print '<div id="error"></div>'; |
1325 | 1652 | /* foreach ($_SESSION['done'] as $done) { |