This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtemperature.php
154 lines (129 loc) · 13.7 KB
/
temperature.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
<?php include('livedata.php');include('common.php');?>
<div class="updatedtime"><span><?php if(file_exists($livedata)&&time()- filemtime($livedata)>300)echo $offline. '<offline> Offline </offline>';else echo $online." ".$weather["time"];?></div>
<div class="tempcontainer">
<div class="maxdata"><?php
if ($weather["temp_today_high"]<10){echo " ".$weather["temp_today_high"]."°\n";?> | <?php echo $weather["temp_today_low"]."°";}
else if ($weather["temp_today_high"]>=10){echo $weather["temp_today_high"]."°\n";?> | <?php echo $weather["temp_today_low"]."°";}?>
</div>
<?php //weather34 sez lets make the temperature look nice
if($weather["temp_units"]=='C' && $weather['temp']<=-10){echo '<div class=outsideminus5>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<=-5){echo '<div class=outsideminus>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<=0){echo '<div class=outsidezero>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<=5){echo '<div class=outside0-5>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<10){echo '<div class=outside6-10>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<15){echo '<div class=outside11-15>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<20){echo '<div class=outside16-20>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<25){echo '<div class=outside21-25>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<30){echo '<div class=outside26-30>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<35){echo '<div class=outside31-35>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<40){echo '<div class=outside36-40>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<45){echo '<div class=outside41-45>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='C' && $weather['temp']<100){echo '<div class=outside50>'.number_format($weather['temp'],1).'°';}
//non metric
if($weather["temp_units"]=='F' && $weather['temp']<=14){echo '<div class=outsideminus5>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<=23){echo '<div class=outsideminus>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<=32){echo '<div class=outsidezero>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<=41){echo '<div class=outside0-5>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<50){echo '<div class=outside6-10>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<59){echo '<div class=outside11-15>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<68){echo '<div class=outside16-20>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<77){echo '<div class=outside21-25>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<86){echo '<div class=outside26-30>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<95){echo '<div class=outside31-35>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<104){echo '<div class=outside36-40>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<113){echo '<div class=outside41-45>'.number_format($weather['temp'],1).'°';}
else if($weather["temp_units"]=='F' && $weather['temp']<212){echo '<div class=outside50>'.number_format($weather['temp'],1).'°';}
?>
</div>
<div class="temptrendx">
<?php echo $weather["temp_trend"]." </span>\n";
//falling
if($weather["temp_trend"]<0){echo '<trendmovementfallingx><span> '.$lang['Trend'].'</span> '.$tempfallingsymbol.' '.number_format($weather["temp_trend"],1).'°</trendmovementfallingx>';}
//rising
elseif($weather["temp_trend"]>0){echo '<trendmovementrisingx><span> '.$lang['Trend'].'</span> '.$temprisingsymbol.' '.number_format($weather["temp_trend"],1).'°</trendmovementrisingx>';}
//steady
else echo '<trendmovementsteadyx>'.$lang['Trend'].' '.$steadysymbol.$lang['Steady'].'</trendmovementsteadyx>';?>
</span></div></div></div>
<div class="heatcircle">
<div class="heatcircle-content">
<?php //heat-index/real feel
if(anyToC($weather["heat_index"])>=28||($showFeelsLike&&anyToC($weather["temp"])>28)){echo $lang['Heatindex']." <br><div class=tempconverter1><div class=tempconvertercirclered1>".$weather["heat_index"]."°".$weather["temp_units"];;}
//windchill offline with real feel
else if ($weather["temp_units"]=='C' && $weather["windchill"]<0){ echo $lang['Windchill']."<br><div class=tempconverter1><div class=tempconvertercircleblue1>".$weather["windchill"]."°".$weather["temp_units"];}
else if ($weather["temp_units"]=='C' && $weather["temp_feel"]>=28){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercirclered1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if($weather["temp_units"]=='C' && $weather["temp_feel"]>=15){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercircleorange1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if($weather["temp_units"]=='C' && $weather["temp_feel"]>=10){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercircleyellow1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if($weather["temp_units"]=='C' && $weather["temp_feel"]<5 ){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercircleblue1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if($weather["temp_units"]=='C' && $weather["temp_feel"]<10 ){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercircleblue1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if ($weather["temp_units"]=='F' && $weather["windchill"]<35){ echo $lang['Windchill']."<br><div class=tempconverter1><div class=tempconvertercircleblue1>".$weather["windchill"]."°".$weather["temp_units"];}
else if ($weather["temp_units"]=='F' && $weather["temp_feel"]>=90){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercirclered1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if($weather["temp_units"]=='F' && $weather["temp_feel"]>=64){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercircleorange1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if($weather["temp_units"]=='F' && $weather["temp_feel"]>=50){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercircleyellow1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if($weather["temp_units"]=='F' && $weather["temp_feel"]<50 ){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercircleblue1>".$weather["temp_feel"]."°".$weather["temp_units"];}
else if($weather["temp_units"]=='F' && $weather["temp_feel"]<40 ){ echo $lang['Feelslike']."<br><div class=tempconverter1><div class=tempconvertercircleblue1>".$weather['temp_feel']."°".$weather["temp_units"];}
?></div></div></div>
<div class="heatcircle2">
<div class="heatcircle-content"><?php echo $lang['Wetbulb'];?><br />
<?php //wetbulb
if ($weather["temp_units"]=='C' && $wetbulbx>=18){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>". $wetbulbx."°".$weather["temp_units"];}
else if ($weather["temp_units"]=='C' && $wetbulbx<10){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>". $wetbulbx."°".$weather["temp_units"];}
else if ($weather["temp_units"]=='C' && $wetbulbx<18){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>". $wetbulbx."°".$weather["temp_units"];}
//non metric wetbulb
if ($weather["temp_units"]=='F' && $wetbulbx >=64){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>". $wetbulbx ."°".$weather["temp_units"];}
else if ($weather["temp_units"]=='F' && $wetbulbx <50){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>". $wetbulbx ."°".$weather["temp_units"];}
else if ($weather["temp_units"]=='F' && $wetbulbx <64){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>". $wetbulbx ."°".$weather["temp_units"];}?>
</div></div></div></div>
<div class="heatcircle3">
<div class="heatcircle-content"><?php echo $lang['Humidity'];?>
<?php //humidity
if ($weather["humidity"]>90){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>".$weather["humidity"];}
else if ($weather["humidity"]>85){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>".$weather["humidity"];}
else if ($weather["humidity"]>60){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>".$weather["humidity"];}
else if ($weather["humidity"]>40){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>".$weather["humidity"];}
else if ($weather["humidity"]>=0){echo "<div class=tempconverter1><div class=tempconvertercircleorange1>".$weather["humidity"];}
?>%
<?php //humidity trend
if(array_key_exists("humidity_trend",$weather)){if($weather["humidity_trend"]>0){
echo '<rise> '.$risingsymbol.'</rise>';}
else if($weather["humidity_trend"]<0){
echo ' <fall> '.$fallingsymbol.'</fall>';}
else{ echo ''.$steadysymbol.'';}}?></span></div>
</div></div></div>
<div class="heatcircle4">
<div class="heatcircle-content"><?php echo $lang['Dewpoint'];?>
<?php //dewpoint
if ($weather["temp_units"]=='C' && ($weather["dewpoint"]>20)){ echo "<div class=tempconverter1><div class=tempconvertercirclered1>".$weather['dewpoint'].'°'.$weather["temp_units"];}
else if ($weather["temp_units"]=='C' && ($weather["dewpoint"]>15)){ echo "<div class=tempconverter1><div class=tempconvertercircleorange1>".$weather['dewpoint'].'°'.$weather["temp_units"];}
else if ($weather["temp_units"]=='C' && ($weather["dewpoint"]>=10)){ echo "<div class=tempconverter1><div class=tempconvertercirclegreen1>".$weather['dewpoint'].'°'.$weather["temp_units"];}
else if($weather["temp_units"]=='C' && ($weather["dewpoint"]<5)){ echo "<div class=tempconverter1><div class=tempconvertercircleblue1>".$weather['dewpoint'].'°'.$weather["temp_units"];}
else if($weather["temp_units"]=='C' && ($weather["dewpoint"]<10)){ echo "<div class=tempconverter1><div class=tempconvertercircleblue1>".$weather['dewpoint'].'°'.$weather["temp_units"];}
//non metric
if ($weather["temp_units"]=='F' && ($weather["dewpoint"]>68)){ echo "<div class=tempconverter1><div class=tempconvertercirclered1>".$weather['dewpoint'].'°'.$weather["temp_units"];}
else if ($weather["temp_units"]=='F' && ($weather["dewpoint"]>59)){ echo "<div class=tempconverter1><div class=tempconvertercircleorange1>".$weather['dewpoint'].'°'.$weather["temp_units"];}
else if ($weather["temp_units"]=='F' && ($weather["dewpoint"]>=50)){ echo "<div class=tempconverter1><div class=tempconvertercirclegreen1>".$weather['dewpoint'].'°'.$weather["temp_units"];}
else if ($weather["temp_units"]=='F' && ($weather["dewpoint"]<40)){ echo "<div class=tempconverter1><div class=tempconvertercircleblue1>". $weather['dewpoint'].'°'.$weather["temp_units"];}
else if ($weather["temp_units"]=='F' && ($weather["dewpoint"]<50)){ echo "<div class=tempconverter1><div class=tempconvertercircleblue1>". $weather['dewpoint'].'°'.$weather["temp_units"];}
?>
<?php //dewpoint trend
if(array_key_exists("dewpoint_trend",$weather)){
if($weather["dewpoint_trend"]>0){
echo '<rise> ' .$risingsymbol.'</rise>';}
else if($weather["dewpoint_trend"]<0){
echo '<fall> ' .$fallingsymbol.'</fall>';}
else{ echo ''.$steadysymbol.' ';}}?></span></div>
</div></div></div></div>
<div class="tempconverter2">
<?php
//metric to f + humidex if greter than 25c
if($weather["temp_units"]=='F' && anyToC($weather["temp"])>30){echo "<div class=tempconvertercirclered>".anyToC($weather["temp"])."°C" ;}
else if($weather["temp_units"]=='F' && anyToC($weather["temp"])>25){echo "<div class=tempconvertercircleorange>".anyToC($weather["temp"])."°C" ;}
else if($weather["temp_units"]=='F' && anyToC($weather["temp"])>18){echo "<div class=tempconvertercircleyellow>".anyToC($weather["temp"])."°C" ;}
else if($weather["temp_units"]=='F' && anyToC($weather["temp"])>10){echo "<div class=tempconvertercirclegreen>".anyToC($weather["temp"])."°C" ;}
else if($weather["temp_units"]=='F' && anyToC($weather["temp"])<10){echo "<div class=tempconvertercircleblue>".anyToC($weather["temp"])."°C" ;}
else if( $weather["temp_units"]=='C' && anyToC($weather["temp"])>30){echo "<div class=tempconvertercirclered>".anyToF($weather["temp"])."°F" ;}
else if( $weather["temp_units"]=='C' && anyToC($weather["temp"])>25){echo "<div class=tempconvertercircleorange>".anyToF($weather["temp"])."°F" ;}
else if( $weather["temp_units"]=='C' && anyToC($weather["temp"])>18){echo "<div class=tempconvertercircleyellow>".anyToF($weather["temp"])."°F" ;}
else if( $weather["temp_units"]=='C' && anyToC($weather["temp"])>10){echo "<div class=tempconvertercirclegreen>".anyToF($weather["temp"])."°F" ;}
else if( $weather["temp_units"]=='C' && anyToC($weather["temp"])<10){echo "<div class=tempconvertercircleblue>".anyToF($weather["temp"])."°F" ;}
?></div>
</div></div></div>