@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | print '<div class="details">'; |
| 79 | 79 | print '<div><span>'._("Altitude").'</span>'; |
| 80 | 80 | if (isset($globalGroundAltitude) && $globalGroundAltitude) { |
| 81 | - try { |
|
| 81 | + try { |
|
| 82 | 82 | $groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']); |
| 83 | - } catch(Exception $e) { |
|
| 84 | - } |
|
| 83 | + } catch(Exception $e) { |
|
| 84 | + } |
|
| 85 | 85 | } |
| 86 | 86 | print '<span class="altitude">'; |
| 87 | 87 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
@@ -91,17 +91,17 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | print '</span>'; |
| 93 | 93 | if (isset($groundAltitude) && $groundAltitude < $spotter_item['altitude']*0.3048) { |
| 94 | - print '<br>'; |
|
| 95 | - print '<span>'._("Ground Altitude").'</span>'; |
|
| 96 | - print '<i>'; |
|
| 97 | - print '<span class="groundaltitude">'; |
|
| 98 | - if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
| 94 | + print '<br>'; |
|
| 95 | + print '<span>'._("Ground Altitude").'</span>'; |
|
| 96 | + print '<i>'; |
|
| 97 | + print '<span class="groundaltitude">'; |
|
| 98 | + if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
| 99 | 99 | print round($groundAltitude*3.28084).' feet'; |
| 100 | - } else { |
|
| 100 | + } else { |
|
| 101 | 101 | print round($groundAltitude).' m'; |
| 102 | - } |
|
| 103 | - print '</span>'; |
|
| 104 | - print '</i>'; |
|
| 102 | + } |
|
| 103 | + print '</span>'; |
|
| 104 | + print '</i>'; |
|
| 105 | 105 | } |
| 106 | 106 | print '</div>'; |
| 107 | 107 | print '<div><span>'._("Speed").'</span>'; |
@@ -58,7 +58,9 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 60 | 60 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 61 | - } else $image = $spotter_item['image_thumbnail']; |
|
| 61 | + } else { |
|
| 62 | + $image = $spotter_item['image_thumbnail']; |
|
| 63 | + } |
|
| 62 | 64 | } |
| 63 | 65 | /* else { |
| 64 | 66 | $image = "images/placeholder_thumb.png"; |
@@ -75,10 +77,14 @@ discard block |
||
| 75 | 77 | print '<div class="callsign-details">'; |
| 76 | 78 | if ($spotter_item['ident'] != 'Not Available') { |
| 77 | 79 | print '<div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a>'; |
| 78 | - if (isset($spotter_item['blocked']) && $spotter_item['blocked'] === true) print '<img src="'.$globalURL.'/images/forbidden.png" title="'._("Callsign is in blocked FAA list").'" class="blocked" />'; |
|
| 80 | + if (isset($spotter_item['blocked']) && $spotter_item['blocked'] === true) { |
|
| 81 | + print '<img src="'.$globalURL.'/images/forbidden.png" title="'._("Callsign is in blocked FAA list").'" class="blocked" />'; |
|
| 82 | + } |
|
| 79 | 83 | print '</div>'; |
| 80 | 84 | } |
| 81 | - if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
| 85 | + if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') { |
|
| 86 | + print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
| 87 | + } |
|
| 82 | 88 | print '</div>'; |
| 83 | 89 | if ($spotter_item['departure_airport'] != 'NA' && $spotter_item['arrival_airport'] != 'NA') { |
| 84 | 90 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
@@ -110,13 +116,21 @@ discard block |
||
| 110 | 116 | print '</div>'; |
| 111 | 117 | print '<div id="aircraft">'; |
| 112 | 118 | print '<span>'._("Aircraft").'</span>'; |
| 113 | - if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
| 119 | + if (isset($spotter_item['aircraft_wiki'])) { |
|
| 120 | + print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
| 121 | + } |
|
| 114 | 122 | if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') { |
| 115 | 123 | $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
| 116 | - if (count($aircraft_names) == 1) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 117 | - else print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 118 | - } elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
|
| 119 | - else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
| 124 | + if (count($aircraft_names) == 1) { |
|
| 125 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 126 | + } else { |
|
| 127 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 128 | + } |
|
| 129 | + } elseif (isset($spotter_item['aircraft_type'])) { |
|
| 130 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
|
| 131 | + } else { |
|
| 132 | + print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
| 133 | + } |
|
| 120 | 134 | |
| 121 | 135 | print '</div>'; |
| 122 | 136 | print '<div id="altitude"><span>'._("Altitude").'</span>'; |
@@ -130,11 +144,17 @@ discard block |
||
| 130 | 144 | |
| 131 | 145 | print '<span class="altitude">'; |
| 132 | 146 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
| 133 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
|
| 134 | - else print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')'; |
|
| 147 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
| 148 | + print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
|
| 149 | + } else { |
|
| 150 | + print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')'; |
|
| 151 | + } |
|
| 135 | 152 | } else { |
| 136 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')'; |
|
| 137 | - else print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
|
| 153 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
| 154 | + print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')'; |
|
| 155 | + } else { |
|
| 156 | + print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
|
| 157 | + } |
|
| 138 | 158 | } |
| 139 | 159 | print '</span>'; |
| 140 | 160 | |
@@ -152,7 +172,9 @@ discard block |
||
| 152 | 172 | print '</i>'; |
| 153 | 173 | } |
| 154 | 174 | print '</div>'; |
| 155 | - if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
| 175 | + if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') { |
|
| 176 | + print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
| 177 | + } |
|
| 156 | 178 | print '<div id="speed"><span>'._("Speed").'</span>'; |
| 157 | 179 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
| 158 | 180 | print round($spotter_item['ground_speed']*1.15078).' mph'; |
@@ -194,8 +216,11 @@ discard block |
||
| 194 | 216 | } |
| 195 | 217 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') { |
| 196 | 218 | print '<div id="pilot"><span>'._("Pilot").'</span>'; |
| 197 | - if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 198 | - else print $spotter_item['pilot_name']; |
|
| 219 | + if (isset($spotter_item['pilot_id'])) { |
|
| 220 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 221 | + } else { |
|
| 222 | + print $spotter_item['pilot_name']; |
|
| 223 | + } |
|
| 199 | 224 | print '</div>'; |
| 200 | 225 | } |
| 201 | 226 | if (isset($spotter_item['aircraft_owner']) && $spotter_item['aircraft_owner'] != '') { |
@@ -221,10 +246,18 @@ discard block |
||
| 221 | 246 | } |
| 222 | 247 | print '</div>'; |
| 223 | 248 | print '</div>'; |
| 224 | - if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
| 225 | - if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
| 226 | - if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 227 | - if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
| 249 | + if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') { |
|
| 250 | + print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
| 251 | + } |
|
| 252 | + if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') { |
|
| 253 | + print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
| 254 | + } |
|
| 255 | + if (isset($spotter_item['acars']['message'])) { |
|
| 256 | + print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 257 | + } |
|
| 258 | + if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) { |
|
| 259 | + print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
| 260 | + } |
|
| 228 | 261 | print '</div>'; |
| 229 | 262 | } |
| 230 | 263 | ?> |