function myWind($array = '')
{
    global $SITE, $windIcons, $windlimit;
    if (!is_array($array)) {
        return '<td>' . langtransstr('Wind') . '</td>';
    }
    $windspeed = $array['windSpeed'];
    $windDir = trim($array['windDir']);
    $windBftNr = wsBeaufortNumber($windspeed, $SITE['uomWind']);
    $windBftText = wsBeaufortText($windBftNr);
    $windBftColor = wsBeaufortColor($windBftNr);
    if (is_numeric($windDir)) {
        $windDir = wsConvertWinddir($windDir);
    }
    $windTekst = '<span style="margin: 0 0 5px 0; width: 100%; font-size: 90%; background-color: ' . $windBftColor . ';">' . round($windspeed) . $SITE['uomWind'];
    if ($windBftNr >= $windlimit) {
        $windTekst = '<span style="border: solid 1px; color: black; background-color: ' . $windBftColor . ';">&nbsp;' . langtransstr($windBftText) . '&nbsp;</span><br />' . $windTekst;
    }
    $windTekst .= '</span></td>';
    $return = '<td style="min-width: 60px;"><img style="height: 32px;    width: 32px;" src="' . $windIcons . $windDir . '.png" alt=""/><br />' . $windTekst;
    #	$tip 	= '<td style="text-align: right;">'.langtransstr('Wind').':&nbsp;</td><td>'.langtransstr($windDir).' '.round($windspeed).$SITE['uomWind'].'</td>';
    $tip = '<td style="text-align: right;">' . langtransstr('Wind') . ':&nbsp;</td><td>' . langtransstr($windDir) . '<br />' . langtransstr($windBftText) . '-' . round($windspeed) . $SITE['uomWind'] . '</td>';
    return array($return, $tip);
}
    	        $colorTemp = $temp + 32;
    	} 
    	else {  $colorTemp =  round( 5*($temp-32)/9 ) + 32;  # $temp;
    	}
    	if (!$tempSimple) {
    		$color		= $tempArray2[$colorTemp];
    		$tempString	= '<span class="myTemp" style="text-shadow:1px 1px black; font-weight: bolder; font-size: 200%; color: '.$color.';" >'.$temp.'&deg;</span>';	
    	} else {
    		if ($colorTemp <  32) { $color = 'blue'; } else {$color = 'red';}
    		$tempString	= '<span class="myTemp" style="text-shadow:1px 1px black; font-weight: bolder; font-size: 150%; color: '.$color.';" >'.$temp.'&deg;</span>';	
    	}
    */
    $tempString = hwa_commontemp($arr['tempNU']);
    $windSpeed = $arr['windSpeedNU'];
    $color = wsBeaufortColor($windSpeed);
    $tekst = langtransstr(wsBeaufortText($windSpeed));
    $windText = '<span style="background-color: ' . $color . ';">' . $arr['windSpeed'] . ' - ' . $tekst . '</span>';
    $wind = $windText . '<br />' . langtransstr('from the') . ' ' . langtransstr($arr['windDir']);
    $hwaListTable .= '<td>' . $period . '</td><td>' . langtransstr($arr['weatherDesc']) . '</td>
	<td><img src="' . $icon . '" style="width: 40px;" alt=" "/></td><td>' . $tempString . '</td>
	<td>' . $rain . '</td><td>' . $wind . '</td><td>' . $arr['baro'] . '</td></tr>' . PHP_EOL;
    if (!isset($arr['iconL'])) {
        continue;
    }
    // skip non hwa table lines
    # now we process only lines for 12 hour tables
    $forecasts++;
    $arrTime[] = $arr['timestamp'];
    $dayText = langtransstr(date('l', $arr['timestamp']));
    if ($foundFirst === '') {
        // do first time things
Beispiel #3
0
$string1 .= "\r\najaxVars['ajaxconditionicon']   = '" . $conditionicon . "';\r\najaxVars['ajaxconditioniconMobi'] = '" . $conditioniconM . "';\r\najaxVars['ajaxcurrentcond']     = '" . $condDesc . "';\r\najaxVars['ajaxcurrentcondalt']  = '" . $condDescAlt . "';";
#  ---------------------------  Rain items
$unit = ' ' . langtransstr(trim($uomRain));
$decPrecip = $SITE['decPrecip'];
$string1 .= "\r\najaxVars['ajaxrain']            = '" . wsNumber($ws['rainToday'], $decPrecip) . $unit . "';\r\najaxVars['ajaxrainNoU']         = '" . wsNumber($ws['rainToday'], $decPrecip) . "';\r\najaxVars['ajaxrainrateNoU']     = '" . wsNumber($ws['rainRateAct'], $decPrecip) . "';";
if (isset($ws['rainHour'])) {
    $string1 .= "\r\najaxVars['ajaxrainratehrNoU']   = '" . wsNumber($ws['rainHour'], $decPrecip) . "';\t\r\najaxVars['ajaxrainratehr']      = '" . wsNumber($ws['rainHour'], $decPrecip) . $unit . "';";
} else {
    $string1 .= "\r\najaxVars['ajaxrainratehrNoU']   = '" . wsNumber($ws['rainRateAct'], $decPrecip) . "';\t\r\najaxVars['ajaxrainratehr']      = '" . wsNumber($ws['rainRateAct'], $decPrecip) . $unit . "';";
}
$string1 .= "\r\najaxVars['ajaxrainmo']          = '" . wsNumber($ws['rainMonth'], $decPrecip) . $unit . "';\r\najaxVars['ajaxrainyr']          = '" . wsNumber($ws['rainYear'], $decPrecip) . $unit . "';";
#  ---------------------------  wind items
if ($ws['windBeafort'] == '') {
    $ws['windBeafort'] = wsBeaufortNumber($ws['windAct'], $SITE['uomWind']);
}
$beaufortText = langtransstr(wsBeaufortText($ws['windBeafort']));
$convertText = $beaufortText;
if ($ws['windAct'] + $ws['gustAct'] < 0.1 || $ws['windActDsc'] == '---') {
    $wrDsc = 'calm';
    // use calm
    $wrtext = $convertText;
} else {
    $wrDsc = $ws['windActDsc'];
    $wrtext = langtransstr('Wind from') . " " . langtransstr($ws['windActDsc']);
}
$wr1 = $SITE['imgAjaxDir'] . 'wr-' . $SITE['lang'] . '-' . $wrDsc . '.png';
$wr2 = $SITE['imgAjaxDir'] . 'wind-' . $wrDsc . '.gif';
$text1 = '<img class="colImgWind" src="' . $wr1 . '" title="' . $wrtext . '" alt="' . $wrtext . '"/>';
$text2 = '<img src="' . $wr2 . '" style="height: 14px; width: 14px;" title="' . $wrtext . '" alt="' . $wrtext . '"/>';
$unit = ' ' . langtransstr(trim($uomWind));
$string1 .= "\r\najaxVars['ajaxwindiconwr']      = '" . $text1 . "';\r\najaxVars['gizmowindicon']       = '" . $text2 . "';\r\najaxVars['ajaxwinddir']         = '" . $wrtext . "';\r\najaxVars['ajaxwinddeg']         = '" . $ws['windActDir'] . "';\r\najaxVars['ajaxwinddirNoU']      = '" . langtransstr($ws['windActDsc']) . "';\r\najaxVars['ajaxwind']            = '" . wsNumber($ws['windAct'], $decWind) . $unit . "';\r\najaxVars['ajaxwindNoU']         = '" . wsNumber($ws['windAct'], $decWind) . "';\r\najaxVars['ajaxgust']            = '" . wsNumber($ws['gustAct'], $decWind) . $unit . "';\r\najaxVars['ajaxgustNoU']         = '" . wsNumber($ws['gustAct'], $decWind) . "';\r\najaxVars['ajaxbeaufortnum']     = '" . $ws['windBeafort'] . "';\r\najaxVars['ajaxbeaufort']        = '" . $convertText . "';\r\najaxVars['ajaxwindmaxgust']     = '" . wsNumber($ws['gustMaxToday'], $decWind) . $unit . "';\r\najaxVars['ajaxwindmaxgusttime'] = '" . langtransstr('at') . ' ' . string_date($ws['gustMaxTodayTime'], $SITE['timeOnlyFormat']) . "';";