-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweather34-dayforecast.php
executable file
·292 lines (268 loc) · 22 KB
/
weather34-dayforecast.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<?php
####################################################################################################
# HOME WEATHER STATION TEMPLATE by BRIAN UNDERDOWN 2015-2020 #
# CREATED FOR HOMEWEATHERSTATION TEMPLATE at #
# https://weather34.com/homeweatherstation/index.html #
# WEATHER STATION TEMPLATE 2015-2020 #
# MB SMART Console Version Revised FEB 2020 #
# https://www.weather34.com #
####################################################################################################
//original weather34 script original css/svg/php by weather34 2015-2019 clearly marked as original by weather34//
include('livedata.php');header('Content-type: text/html; charset=utf-8');error_reporting(0); date_default_timezone_set($TZ); ?>
<?php
//start the wu output
$json='jsondata/wuforecast.txt';
$weather34wuurl=file_get_contents($json);
$parsed_weather34wujson = json_decode($weather34wuurl,false);
{ if ($parsed_weather34wujson->{'daypart'}[0]->{'iconCode'}[0]==null){
$wuskydayIcon=$parsed_weather34wujson->{'daypart'}[0]->{'iconCode'}[1];$wuskydayTime = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[1];
$wuskydayTempHigh = $parsed_weather34wujson->{'daypart'}[0]->{'temperature'}[1];
$wuskydayTempLow = $parsed_weather34wujson->{'temperatureMin'}[1];
$wuskydayWindGust = $parsed_weather34wujson->{'daypart'}[0]->{'windSpeed'}[1];$wuskydayWinddir = $parsed_weather34wujson->{'daypart'}[0]->{'windDirection'}[1];
$wuskydayWinddircardinal = $parsed_weather34wujson->{'daypart'}[0]->{'windDirectionCardinal'}[1];$wuskydayacumm = $parsed_weather34wujson->{'daypart'}[0]->{'snowRange'}[1];
$wuskydayPrecipType = $parsed_weather34wujson->{'daypart'}[0]->{'precipType'}[1];$wuskydayprecipIntensity = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[1];
$wuskydayPrecipProb = $parsed_weather34wujson->{'daypart'}[0]->{'precipChance'}[1];$wuskydayUV = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[1];
$wuskydayUVdesc = $parsed_weather34wujson->{'daypart'}[0]->{'uvDescription'}[1];$wuskydaysnow = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[1];
$wuskydaysummary = $parsed_weather34wujson->{'daypart'}[0]->{'narrative'}[1];
$wuskydaynight = $parsed_weather34wujson->{'daypart'}[0]->{'dayOrNight'}[1];
$wuskydesc = $parsed_weather34wujson->{'daypart'}[0]->{'wxPhraseLong'}[1];
$wuskythunder = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[1];
$wuskyhumidity = $parsed_weather34wujson->{'daypart'}[0]->{'relativeHumidity'}[1];
}
else {
$wuskydayIcon=$parsed_weather34wujson->{'daypart'}[0]->{'iconCode'}[0];$wuskydayTime = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[0];
$wuskydayTempHigh = $parsed_weather34wujson->{'daypart'}[0]->{'temperature'}[0];
$wuskydayTempLow = $parsed_weather34wujson->{'temperatureMin'}[0];
$wuskydayWindGust = $parsed_weather34wujson->{'daypart'}[0]->{'windSpeed'}[0];$wuskydayWinddir = $parsed_weather34wujson->{'daypart'}[0]->{'windDirection'}[0];
$wuskydayWinddircardinal = $parsed_weather34wujson->{'daypart'}[0]->{'windDirectionCardinal'}[0];$wuskydayacumm = $parsed_weather34wujson->{'daypart'}[0]->{'snowRange'}[0];
$wuskydayPrecipType = $parsed_weather34wujson->{'daypart'}[0]->{'precipType'}[0];$wuskydayprecipIntensity = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[0];
$wuskydayPrecipProb = $parsed_weather34wujson->{'daypart'}[0]->{'precipChance'}[0];$wuskydayUV = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[0];
$wuskydayUVdesc = $parsed_weather34wujson->{'daypart'}[0]->{'uvDescription'}[0];$wuskydaysnow = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[0];
$wuskydaysummary = $parsed_weather34wujson->{'daypart'}[0]->{'narrative'}[0];
$wuskydaynight = $parsed_weather34wujson->{'daypart'}[0]->{'dayOrNight'}[0];
$wuskydesc = $parsed_weather34wujson->{'daypart'}[0]->{'wxPhraseLong'}[0];
$wuskythunder = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[0];
$wuskyhumidity = $parsed_weather34wujson->{'daypart'}[0]->{'relativeHumidity'}[0];
$wuskyheatindex = $parsed_weather34wujson->{'daypart'}[0]->{'temperatureHeatIndex'}[0];
}
$wuskydaynight1 = $parsed_weather34wujson->{'daypart'}[0]->{'dayOrNight'}[1];
$wuskydaynight2 = $parsed_weather34wujson->{'daypart'}[0]->{'dayOrNight'}[2];
//thunder
$wuskythunder1 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[1];
$wuskythunder2 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[2];
$wuskythunder3 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[3];
$wuskythunder4 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[4];
$wuskythunder5 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[5];
$wuskythunder6 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[6];
$wuskythunder7 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[7];
$wuskythunder8 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[8];
$wuskythunder9 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[9];
$wuskythunder10 = $parsed_weather34wujson->{'daypart'}[0]->{'thunderIndex'}[10];
//period
$wuskydayTime1 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[1];
$wuskydayTime2 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[2];
$wuskydayTime3 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[3];
$wuskydayTime4 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[4];
$wuskydayTime5 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[5];
$wuskydayTime6 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[6];
$wuskydayTime7 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[7];
$wuskydayTime8 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[8];
$wuskydayTime9 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[9];
$wuskydayTime10 = $parsed_weather34wujson->{'daypart'}[0]->{'daypartName'}[10];
//rain
$wuskyrain1 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[1];
$wuskyrain2 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[2];
$wuskyrain3 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[3];
$wuskyrain4 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[4];
$wuskyrain5 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[5];
$wuskyrain6 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[6];
$wuskyrain7 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[7];
$wuskyrain8 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[8];
$wuskyrain9 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[9];
$wuskyrain10 = $parsed_weather34wujson->{'daypart'}[0]->{'qpf'}[10];
//snow
$wuskysnow1 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[1];
$wuskysnow2 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[2];
$wuskysnow3 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[3];
$wuskysnow4 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[4];
$wuskysnow5 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[5];
$wuskysnow6 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[6];
$wuskysnow7 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[7];
$wuskysnow8 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[8];
$wuskysnow9 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[9];
$wuskysnow10 = $parsed_weather34wujson->{'daypart'}[0]->{'qpfSnow'}[10];
//heatindex
$wuskyheatindex1 = $parsed_weather34wujson->{'daypart'}[0]->{'temperatureHeatIndex'}[1];
$wuskyheatindex2 = $parsed_weather34wujson->{'daypart'}[0]->{'temperatureHeatIndex'}[2];
$wuskyheatindex3 = $parsed_weather34wujson->{'daypart'}[0]->{'temperatureHeatIndex'}[3];
$wuskyheatindex4 = $parsed_weather34wujson->{'daypart'}[0]->{'temperatureHeatIndex'}[4];
$wuskyheatindex5 = $parsed_weather34wujson->{'daypart'}[0]->{'temperatureHeatIndex'}[5];
$wuskyheatindex6 = $parsed_weather34wujson->{'daypart'}[0]->{'temperatureHeatIndex'}[6];
$wuskyheatindex7 = $parsed_weather34wujson->{'daypart'}[0]->{'temperatureHeatIndex'}[7];
//uv index
$wuskydayUV1 = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[1];
$wuskydayUV2 = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[2];
$wuskydayUV3 = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[3];
$wuskydayUV4 = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[4];
$wuskydayUV5 = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[5];
$wuskydayUV6 = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[6];
$wuskydayUV7 = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[7];
$wuskydayUV8 = $parsed_weather34wujson->{'daypart'}[0]->{'uvIndex'}[8];
$wuskydayTempHigh2=$parsed_weather34wujson->{'daypart'}[0]->{'temperature'}[2];
}?>
<?php //begin wu stuff
//convert lightning index
if ( $wuskythunder==0 ){$wuskythunder=$lightningalert8.' No Thunder Storm';}else if ( $wuskythunder==1 ){$wuskythunder=$lightningalert8.' Thunder Storm Risk';}
else if ( $wuskythunder==2 ){$wuskythunder=$lightningalert8.' Thunder Storm';}else if ( $wuskythunder>=3 ){$wuskythunder=$lightningalert8.' Severe Thunderstorm';}
//wu convert temps-rain-wind
//metric to F
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskydayTempHigh=($wuskydayTempHigh*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskydayTempLow=($wuskydayTempLow*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskyheatindex=($wuskyheatindex*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskywindchill=($wuskywindchill*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskydayTempHigh1=($wuskydayTempHigh1*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskyheatindex1=($wuskyheatindex1*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskywindchill1=($wuskywindchill1*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskydayTempHigh2=($wuskydayTempHigh2*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskyheatindex2=($wuskyheatindex2*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='m' ){$wuskywindchill2=($wuskywindchill2*9/5)+32;}
// metric to F UK
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskydayTempHigh=($wuskydayTempHigh*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskydayTempLow=($wuskydayTempLow*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskyheatindex=($wuskyheatindex*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskywindchill=($wuskywindchill*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskydayTempHigh1=($wuskydayTempHigh1*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskyheatindex1=($wuskyheatindex1*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskywindchill1=($wuskywindchill1*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskydayTempHigh2=($wuskydayTempHigh2*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskyheatindex2=($wuskyheatindex2*9/5)+32;}
if ($weather["temp_units"]=='F' && $wuapiunit=='h' ){$wuskywindchill2=($wuskywindchill2*9/5)+32;}
// ms non metric to c Scandinavia
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskydayTempHigh=($wuskydayTempHigh*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskydayTempLow=($wuskydayTempLow*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskyheatindex=($wuskyheatindex*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskywindchill=($wuskywindchill*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskydayTempHigh1=($wuskydayTempHigh1*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskyheatindex1=($wuskyheatindex1*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskywindchill1=($wuskywindchill1*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskydayTempHigh2=($wuskydayTempHigh2*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskyheatindex2=($wuskyheatindex2*30);}
if ($weather["temp_units"]=='F' && $wuapiunit=='s'){$wuskywindchill2=($wuskywindchill2*30);}
// non metric to c US
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskydayTempHigh=($wuskydayTempHigh-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskydayTempLow=($wuskydayTempLow-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskyheatindex=($wuskyheatindex-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskywindchill=($wuskywindchill-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskydayTempHigh1=($wuskydayTempHigh1-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskyheatindex1=($wuskyheatindex1-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskywindchill1=($wuskywindchill1-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskydayTempHigh2=($wuskydayTempHigh2-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskyheatindex2=($wuskyheatindex2-32)/1.8;}
if ($weather["temp_units"]=='C' && $wuapiunit=='e' ){$wuskywindchill2=($wuskywindchill2-32)/1.8;}
//wind
// mph to kmh US
if ($windunit=='km/h' && $wuapiunit=='e' ){$wuskydayWindGust=(number_format($wuskydayWindGust,1)*1.60934);}
// mph to kmh UK
if ($windunit=='km/h' && $wuapiunit=='h' ){$wuskydayWindGust=(number_format($wuskydayWindGust,1)*1.60934);}
//mph to ms US
if ($windunit=='m/s' && $wuapiunit=='e' ){$wuskydayWindGust=(number_format($wuskydayWindGust,1)*0.44704);}
//mph to ms uk
if ($windunit=='m/s' && $wuapiunit=='h' ){$wuskydayWindGust=(number_format($wuskydayWindGust,1)*0.44704);}
//kmh to ms
if ($windunit=='m/s' && $wuapiunit=='m' ){$wuskydayWindGust=(number_format($wuskydayWindGust,1)*0.277778);}
//kmh to mph
if ($windunit=='mph' && $wuapiunit=='m' ){$wuskydayWindGust=(number_format($wuskydayWindGust,1)*0.621371);}
//kmh to kts
if ($windunit=='kts' && $wuapiunit=='m' ){$wuskydayWindGust=(number_format($wuskydayWindGust,1)*0.539957);}
//kmh to kts
if ($windunit=='kts' && $wuapiunit=='e' ){$wuskydayWindGust=(number_format($wuskydayWindGust,1)*0.539957);}
//rain inches to mm
if ($rainunit=='mm' && $wuapiunit=='e' ){$wuskydayprecipIntensity=$wuskydayprecipIntensity*25.4;}
//rain mm to inches scandinavia
if ($rainunit=='in' && $wuapiunit=='s' ){$wuskydayprecipIntensity=$wuskydayprecipIntensity*0.0393701;}
//rain mm to inches uk
if ($rainunit=='in' && $wuapiunit=='h' ){$wuskydayprecipIntensity2=$wuskydayprecipIntensity2*0.0393701;}
//rain mm to inches metric
if ($rainunit=='in' && $wuapiunit=='m' ){$wuskydayprecipIntensity=$wuskydayprecipIntensity*0.0393701;}
//icon + day wu
echo '<div class="sunblock">';
echo '<div class="wudesc">'.$lang['Forecast'].' '.$wuskydayTime.'</div>
<div class="wuicon">';
if ($wuskydaynight=='D'){echo '<img src="wuicons/'.$wuskydayIcon.'.svg" width="60" height="50" alt="'.$wuskydesc.'" title="'.$wuskydesc.'"></img>';}
if ($wuskydaynight=='N'){echo '<img src="wuicons/nt_'.$wuskydayIcon.'.svg" width="60" height="50" alt="'.$wuskydesc.'" title="'.$wuskydesc.'"></img>';}
// icon description
$wuskydesc =str_replace('Wind', $lang["Windy"]." ". $lang["Conditions"], $wuskydesc);
$wuskydesc =str_replace('/', ' ', $wuskydesc);
echo '</div>
<div class="wuicondesc">'.$wuskydesc.'</div><br>
<div class="wutemp">';
//temp non metric wu
if ($weather["temp_units"]=='F'){
if($wuskydayTempHigh<44.6){echo '<blue>'.number_format($wuskydayTempHigh,0).'°</red>';}
else if($wuskydayTempHigh>104){echo '<purple>'.number_format($wuskydayTempHigh,0).'°</purple>';}
else if($wuskydayTempHigh>80.6){echo '<red>'.number_format($wuskydayTempHigh,0).'°</red>';}
else if($wuskydayTempHigh>66.2){echo '<orange>'.number_format($wuskydayTempHigh,0).'°</orange>';}
else if($wuskydayTempHigh>55){echo '<yellow>'.number_format($wuskydayTempHigh,0).'°</yellow>';}
else if($wuskydayTempHigh>=44.6){echo '<green>'.number_format($wuskydayTempHigh,0).'°</green>';}}
//temp metric wu
if ($weather["temp_units"]=='C'){
if($wuskydayTempHigh<7 && $weather["temp_units"]=='C'){echo '<blue>'.number_format($wuskydayTempHigh,0).'°</blue>';}
else if($wuskydayTempHigh>40){echo '<purple>'.number_format($wuskydayTempHigh,0).'°</purple>';}
else if($wuskydayTempHigh>27){echo '<red>'.number_format($wuskydayTempHigh,0).'°</red>';}
else if($wuskydayTempHigh>19){echo '<orange>'.number_format($wuskydayTempHigh,0).'°</orange>';}
else if($wuskydayTempHigh>12.7){echo '<yellow>'.number_format($wuskydayTempHigh,0).'°</yellow>';}
else if( $wuskydayTempHigh>=7){echo '<green>'.number_format($wuskydayTempHigh,0).'°</green>';}}
echo '<br>';
//lightning wu
echo '<div class=wuahead>';
if ($wuskythunder>0 ) {echo 'Thunderstorms expected '.$wuskydayTime.'';}
else if ($wuskythunder1>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime1. ' '.$lightningalert8.'';}
else if ($wuskythunder2>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime2. ' '.$lightningalert8.'';}
else if ($wuskythunder3>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime3. ' '.$lightningalert8.'';}
else if ($wuskythunder4>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime4. ' '.$lightningalert8.'';}
else if ($wuskythunder5>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime5. ' '.$lightningalert8.'';}
else if ($wuskythunder6>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime6. ' '.$lightningalert8.'';}
else if ($wuskythunder7>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime7. ' '.$lightningalert8.'';}
else if ($wuskythunder8>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime8. ' '.$lightningalert8.'';}
else if ($wuskythunder9>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime9. ' '.$lightningalert8.'';}
else if ($wuskythunder10>0 ) {echo ' <orange>'.$lang['Thunderstorm-Metar'].'</orange> '.$wuskydayTime10. ' '.$lightningalert8.'';}
//snowfall wu
else if ($wuskysnow>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime. ' '.$freezing.'';}
else if ($wuskysnow1>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime1. ' '.$freezing.'';}
else if ($wuskysnow2>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime2. ' '.$freezing.'';}
else if ($wuskysnow3>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime3. ' '.$freezing.'';}
else if ($wuskysnow4>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime4. ' '.$freezing.'';}
else if ($wuskysnow5>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime5. ' '.$freezing.'';}
else if ($wuskysnow6>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime6. ' '.$freezing.'';}
else if ($wuskysnow7>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime7. ' '.$freezing.'';}
else if ($wuskysnow8>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime8. ' '.$freezing.'';}
else if ($wuskysnow9>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime9. ' '.$freezing.'';}
else if ($wuskysnow10>0 ) {echo ' <blue>'.$lang['Snow-Metar'].'</blue> '.$wuskydayTime10. ' '.$freezing.'';}
//rainfall wu
else if ($wuskyrain>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime. ' '.$rainfallalert8.'';}
else if ($wuskyrain1>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime1.' '.$rainfallalert8.'';}
else if ($wuskyrain2>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime2.' '.$rainfallalert8.'';}
else if ($wuskyrain3>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime3. ' '.$rainfallalert8.'';}
else if ($wuskyrain4>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime4. ' '.$rainfallalert8.'';}
else if ($wuskyrain5>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime5. ' '.$rainfallalert8.'';}
else if ($wuskyrain6>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime6. ' '.$rainfallalert8.'';}
else if ($wuskyrain7>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime7. ' '.$rainfallalert8.'';}
else if ($wuskyrain8>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime8. ' '.$rainfallalert8.'';}
else if ($wuskyrain9>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime9. ' '.$rainfallalert8.'';}
else if ($wuskyrain10>0 ) {echo ' <blue>'.$lang['Rain'].'</blue> '.$wuskydayTime10. ' '.$rainfallalert8.'';}
//tomorrow temperature
//imperial
else if ($weather["temp_units"]=='F'){
if ($wuskydayTempHigh2>80.6 ){ echo "<red>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</red> ", $wuskydayTime2."";}
else if ($wuskydayTempHigh2>66.2 ){ echo "<orange>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</orange> ", $wuskydayTime2."";}
else if ($wuskydayTempHigh2>=55 ){ echo "<yellow>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</yellow> ", $wuskydayTime2."";}
else if ($wuskydayTempHigh2>=44.6 ){ echo "<green>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</green> ", $wuskydayTime2."";}
else if ($wuskydayTempHigh2>-50 ){ echo "<blue>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</blue> ", $wuskydayTime2."";}}
//metric
else if ($weather["temp_units"]=='C'){
if ($wuskydayTempHigh2>27 ){ echo "<red>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</red> ", $wuskydayTime2."";}
else if ($wuskydayTempHigh2>=19 ){ echo "<orange>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</orange> ", $wuskydayTime2."";}
else if ($wuskydayTempHigh2>=12.7 ){ echo "<yellow>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</yellow> ", $wuskydayTime2."";}
else if ($wuskydayTempHigh2>=7 ){ echo "<green>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</green> ", $wuskydayTime2."";}
else if ($wuskydayTempHigh2>-50 ){ echo "<blue>".number_format($wuskydayTempHigh2,0). "°".$weather['temp_units']."</blue> ", $wuskydayTime2."";}}
?></div></div></div></div>