} $link_forecast = false; if (isset($SITE['pages'][$forecast_page])) { $link_forecast = $SITE['pages'][$forecast_page]; } # generate the td's to output later. $max_cities = 1; foreach ($my_metars as $key => $arr) { $line1 .= '<th class="blockHead" style="width:' . $width . '; "><small>' . $my_metars[$key]['name'] . '</small> '; if ($link_forecast != false) { $line1 .= ' <a href="' . $link_forecast . '&lang=' . $lang . '&city=' . $my_metars[$key]['key'] . $skiptopText . '"> <span style="float: right;"><img src="./img/submit.png" style="margin:1px; vertical-align: middle;" alt="more information" title="more information"> </span></a> '; } $line1 .= '</th>' . PHP_EOL; $line2 .= '<td style="text-align: center;">' . ws_commontemp_color($my_metars[$key]['temp']) . ' <img src="./' . $my_metars[$key]['iconurl'] . '" alt=" " style="width: 28px; vertical-align: bottom;"/></td>' . PHP_EOL; $line3 .= '<td style="text-align: center;">' . $my_metars[$key]['desc'] . '</td>' . PHP_EOL; $max_cities++; if ($max_cities > $number_cities) { break; } } # echo all data now echo '<!-- dash_metar.php --> <div class="blockDiv"> <h3 class="blockHead">', langtransstr('The weather in interesting cities nearby') . '</h3>' . PHP_EOL; ws_message('<!-- module dash_metar.php (' . __LINE__ . '): loaded ' . $number_cities . ' ccn using METAR in ' . $seconds_metar . ' seconds -->', true); echo '<table class="" style="width: 100%;"> <tr>' . PHP_EOL . $line2 . '</tr> <tr style="">' . PHP_EOL . $line3 . '</tr> <tr style="height: 16px;">' . PHP_EOL . $line1 . '</tr>
#------------------------------------------------------------------------------- if (isset($ws['rtTime'])) { if (substr($ws['actTime'], 0, 12) > substr($ws['rtTime'], 0, 12)) { $color_strt = '<b ><a style="color: red;" href="./' . $SITE['pages']['statusWeatherSystems'] . '">'; $color_end = ' ?</a></b><!-- ' . $ws['actTime'] . '-' . $ws['rtTime'] . '-->'; } else { $color_strt = $color_end = ''; } $extra_time = ' => ' . $color_strt . string_date($ws['rtTime'], $SITE['timeOnlyFormat']) . $color_end; } else { $extra_time = ''; } $string1 = "ajaxVars['ajaxindicator'] = '" . langtransstr("Last updated:") . " ';\r\najaxVars['langPauseMsg'] = '" . langtransstr('Updates paused - reload page to start') . " ';\r\najaxVars['ajaxdate'] = '" . string_date($ws['actTime'], $SITE['dateOnlyFormat']) . "';\r\najaxVars['ajaxtime'] = '" . string_date($ws['actTime'], $SITE['timeOnlyFormat']) . $extra_time . "';\r\najaxVars['ajaxcounter'] = '0';"; # --------------------------- temp related ajax values $decTemp = $SITE['decTemp']; $string1 .= "\r\najaxVars['ajaxtemp'] = '" . wsNumber($ws['tempAct'], $decTemp) . $uomTemp . "';\r\najaxVars['ajaxtempDash'] = '" . ws_commontemp_color(wsNumber($ws['tempAct'], $decTemp)) . "';\r\najaxVars['ajaxtempNoU'] = '" . wsNumber($ws['tempAct'], $decTemp) . "';\r\najaxVars['ajaxbigtemp'] = '" . wsNumber($ws['tempAct'], 0) . $uomTemp . "';"; $textUP = langtransstr("Warmer") . ': %s ' . $uomTemp . ' ' . langtransstr("than last hour") . "."; $textDN = langtransstr("Cooler") . ': %s ' . $uomTemp . ' ' . langtransstr("than last hour") . "."; $text = wsGenArrow($ws['tempAct'], $ws['tempDelta'], $textUP, $textDN, $decTemp); $string1 .= "\r\najaxVars['ajaxtemparrow'] = '" . $text . "';"; $txt = langtransstr('Currently') . ': ' . $ws['tempAct'] . ', ' . langtransstr('Min') . ': ' . $ws['tempMinToday'] . ', ' . langtransstr('Max') . ': ' . $ws['tempMaxToday']; if ($ws['tempMaxToday'] >= $ws['tempMaxYday']) { $highTemp = $ws['tempMaxToday']; } else { $highTemp = $ws['tempMaxYday']; } if ($ws['tempMinToday'] <= $ws['tempMinYday']) { $lowTemp = $ws['tempMinToday']; } else { $lowTemp = $ws['tempMinYday']; }