forked from ktrue/CU-HWS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
255 lines (248 loc) · 16.3 KB
/
index.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
<?php header('Content-type: text/html; charset=utf-8');
####################################################################################################
# HOME WEATHER STATION TEMPLATE by BRIAN UNDERDOWN 2015-2016-2017-2018
# CREATED FOR HOMEWEATHERSTATION TEMPLATE at
# https://weather34.com/homeweatherstation/index.html
# WEATHER STATION TEMPLATE 2015-2016-2017-2018
# Cumulus Version
# https://www.weather34.com
# reworked to use module variables from common.php - K. True - 29-Mar-2019
####################################################################################################
if(!file_exists('settings1.php')) {copy('initial-settings1.php','settings1.php'); }
include('livedata.php');
include('settings1.php');
include('common.php');
date_default_timezone_set($TZ);
?>
<!DOCTYPE html>
<html lang="<?php echo $language;?>">
<head>
<title><?php echo $stationlocation; ?> Smart Home Weather Station</title>
<meta content="Smart Home weather station providing current weather conditions for <?php echo $stationlocation;?>" name="description">
<meta content="website" property="og:type">
<meta content="7 days" name="revisit-after">
<meta content="web" name="distribution">
<meta content="<?php echo "${stationlocation} \n";?> smart home weather station" property="og:title">
<meta content="<?php echo "${stationlocation} \n";?> smart home weather station" property="og:site_name">
<meta content="" property="og:url">
<meta content="Smart Home weather station providing current weather conditions for <?php echo $stationlocation;?>" property="og:description">
<meta content="img/weather34.png" property="og:image">
<meta content="" property="fb:app_id">
<meta content="place" property="og:type">
<meta content="brian underdown" name="author">
<meta content="INDEX,FOLLOW" name="robots">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name=apple-mobile-web-app-title content="SMART HOME WEATHER STATION">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, viewport-fit=cover">
<link rel="apple-touch-icon" sizes="180x180" href="img/apple-touch-icon.png">
<link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="img/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="img/manifest.json">
<meta name="theme-color" content="#ffffff">
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="favicon.ico" rel="icon" type="image/x-icon">
<link href="css/main.<?php echo $theme;?>.css?version=<?php echo filemtime('css/main.'.$theme.'.css');?>" rel="stylesheet prefetch">
</head>
<body>
<!-- begin top layout for homeweatherstation template -->
<div class="weather2-container">
<div class="container weather34box-toparea">
<!-- position1 -->
<div class="weather34box clock"> <!-- module <?php echo $position1; ?> -->
<div class="title"><?php echo $info?> <?php echo $position1title ;?> </div>
<div class="value">
<div id="position1"></div>
</div>
</div>
<!-- position2 -->
<div class="weather34box indoor"><!-- module <?php echo $position2; ?> -->
<div class="title"><?php echo $info?> <?php echo $position2title ;?> </div>
<div class="value">
<div id="position2"></div>
</div>
</div>
<!-- position3 -->
<div class="weather34box earthquake"><!-- module <?php echo $position3; ?> -->
<div class="title"><?php echo $info?> <?php echo $position3title ;?> </div>
<div class="value">
<div id="position3"></div>
</div>
</div>
<!-- position4 -->
<div class="weather34box alert"><!-- module <?php echo $position4; ?> -->
<div class="title"><?php echo $info;?> <?php echo $position4title ;?> </div>
<div class="value">
<div id="position4"></div>
</div>
</div>
</div>
</div> <!-- extra div closures? </div></div> -->
<!-- end top section (1-4) for homeweatherstation template -->
<!-- begin outside/station data section for homeweatherstation template -->
<div class="weather-container">
<div class="weather-item"><!-- module <?php echo $temperaturemodule; ?> -->
<div class="chartforecast">
<span class="yearpopup"> <a href="chartswu/yearlytemperature.php" data-featherlight="iframe" > <?php echo $menucharticonpage?> <?php echo date('Y');?> </a></span>
<span class="monthpopup"> <a href="chartswu/monthlytemperature.php" data-featherlight="iframe" > <?php echo $menucharticonpage?> <?php echo strftime(" %b") ;?> </a></span>
<span class="todaypopup"> <a href="chartswu/todaytemperature.php" data-featherlight="iframe" > <?php echo $menucharticonpage?> <?php echo $lang['Today']; ?> </a></span>
</div>
<span class='moduletitle'> <?php echo $lang['Temperature']; ?> <span class="fgcontrast"><?php echo "°" . $weather["temp_units"] . " \n";?></span><br /></span>
<div id="temperature"></div>
<br>
</div>
<!-- forecast for homeweatherstation template -->
<div class="weather-item"><!-- module <?php echo $position6; ?> -->
<div class="chartforecast">
<span class="yearpopup">
<?php if ($position6=='forecast3ds.php'){
echo'<a title="Dark Sky Forecast" href="outlookds.php" data-featherlight="iframe">'. $chartinfo. ' '.$lang['Forecastsummary']."</a></span>";
echo ' <span class="monthpopup"><a title="Hourly Forecast" href="forecastdshour.php" data-featherlight="iframe"> '. $chartinfo. ' '.$lang['Hourlyforecast']."</a>";
$position6title = "DarkSky ".$lang['Forecast'];
}
if ($position6=='forecast3wu.php') {echo ' <a title="Weather Wnderground forecast" href="outlookwu.php" data-featherlight="iframe">'. $chartinfo. ' '.$lang['Forecastsummary']."</a>";
$position6title = "WU ".$lang['Forecast'];
}?>
</span>
</div>
<span class='moduletitle'>
<?php echo $position6title ;?> (<valuetitleunit>°<?php echo $weather["temp_units"] ;?></valuetitleunit>)
</span><br />
<div id="currentfore"></div>
</div>
<!-- currentsky for homeweatherstation template -->
<div class="weather-item"><!-- module <?php echo $currentconditions; ?> -->
<div class="chartforecast">
<!-- HOURLY & Outlook for homeweather station -->
<span class="yearpopup"> <a title="nearby metar station" href="metarnearby.php" data-featherlight="iframe"><?php echo $chartinfo?> <?php echo 'Nearby Metar';?> <?php if(filesize('jsondata/metar34.txt')<160){echo "(<ored>Offline</ored>)";}else echo "" ?></a>
</span>
<span class="monthpopup"> <a href="windy-radar.php" data-featherlight="iframe" ><?php echo $chartinfo?> <?php echo 'Radar'; ?></a>
</span>
</div>
<span class='moduletitle'><?php echo $lang['Currentsky'];?></span><br />
<div id="currentsky"></div>
</div>
</div>
<!-- end of module 5-7 -->
<!-- begin module 8-10 -->
<div class="weather-container">
<div class="weather-item"><!-- module <?php echo 'windspeeddirection.php'; ?> -->
<div class="chartforecast">
<span class="yearpopup"> <a href="chartswu/yearlywindspeedgust.php" data-featherlight="iframe" ><?php echo $menucharticonpage?> <?php echo date('Y');?></a></span>
<span class="monthpopup"> <a href="chartswu/monthlywindspeedgust.php" data-featherlight="iframe"><?php echo $menucharticonpage?> <?php echo strftime(" %b") ;?> </a></span>
<span class="todaypopup"> <a href="chartswu/todaywindspeedgust.php" data-featherlight="iframe" ><?php echo $menucharticonpage?> <?php echo $lang['Today']; ?> </a></span>
</div>
<span class='moduletitle'><?php echo $lang['Windspeed'] ;?> | <?php echo $lang['Gust'] ;?></span><br />
<div id="windspeed"></div>
</div>
<!-- barometer for homeweatherstation template -->
<div class="weather-item"><!-- module <?php echo 'barometer.php'; ?> -->
<div class="chartforecast" style="z-index:20">
<span class="yearpopup"> <a href="chartswu/yearlybarometer.php" data-featherlight="iframe" ><?php echo $menucharticonpage?> <?php echo date('Y');?> </a></span>
<span class="monthpopup"> <a href="chartswu/monthlybarometer.php" data-featherlight="iframe" ><?php echo $menucharticonpage?> <?php echo strftime(" %b") ;?> </a></span>
<span class="todaypopup"> <a href="chartswu/todaybarometer.php" data-featherlight="iframe" ><?php echo $menucharticonpage?> <?php echo $lang['Today']; ?></a></span>
</div>
<span class='moduletitle'><?php echo $lang['Barometer']; ?> </span><br />
<div id="barometer"></div>
</div>
<!-- moonphase for homeweatherstation template includes reverse for southern hemisohere -->
<div class=weather-item><!-- module <?php echo $sunoption; ?> -->
<div class=chartforecast>
<?php if ($purpleairhardware=='yes'){echo''?>
<span class="yearpopup" style="-webkit-transform:rotate(<?php echo $hemisphere;?>deg);-moz-transform:rotate(<?php echo $hemisphere;?>deg);-ms-transform:rotate(<?php echo $hemisphere;?>deg);-o-transform:rotate(<?php echo $hemisphere;?>deg);transform:rotate(<?php echo $hemisphere;?>deg);"><?php echo $moon=moon_posit($months, $days, $years);?>
<a title="current moonphase" href="mooninfo.php" data-featherlight="iframe"><?php $moon = new MoonPhase();$moonage =$moon->age();
{if ($moonage<1.84566) {echo $lang['Newmoon'];} elseif ($moonage<5.53699) {echo $lang['Waxingcrescent'];} elseif ($moonage<9.22831) {echo $lang['Firstquarter'];} elseif ($moonage<12.91963) {echo $lang['Waxinggibbous'];
} elseif ($moonage<16.61096) {echo $lang['Fullmoon'];} elseif ($moonage<20.302228) {echo $lang['Waninggibbous'];} elseif ($moonage<23.99361) {echo $lang['Lastquarter'];} elseif ($moonage<27.68493) { echo $lang['Waningcrescent'];
} else { echo $lang['Newmoon'];}}}
?></a></span>
<span class="monthpopup"><a title="meteor showers" href="meteorshowers.php" data-featherlight="iframe"><?php echo $meteorinfo;?> <?php if ($meteor_default=='No Meteor') {echo $lang['Meteor'];} else { echo $lang['Nometeor'];}?></a></span>
<span class="todaypopup"><a title="aurora information" href=aurora.php data-featherlight=iframe><?php echo $info;?> Aurora <?php if ($kp>=5) {echo '<oorange>Active</oorange>';}else {echo "";}?></a></span>
</div>
<span class='moduletitle'><?php echo $lang['SunPosition'];?></span><br />
<div id="moonphase"></div>
</div>
</div>
<!-- end module 8-10 -->
<!-- begin module 11-13 -->
<!-- rainfall for homeweatherstation template -->
<div class="weather-container">
<div class="weather-item"><!-- module <?php echo "rainfall.php"; ?> -->
<div class="chartforecast" >
<span class="yearpopup"> <a href="chartswu/yearlyrainfall.php" data-featherlight="iframe" ><?php echo $menucharticonpage?> <?php echo date('Y');?> </a></span>
<span class="monthpopup"> <a href="chartswu/monthlyrainfall.php" data-featherlight="iframe" ><?php echo $menucharticonpage?> <?php echo strftime(" %b") ;?> </a></span>
<span class="todaypopup"> <a href="chartswu/todayrainfall.php" data-featherlight="iframe" ><?php echo $menucharticonpage?> <?php echo $lang['Today']; ?> </a></span>
</div>
<span class='moduletitle'><?php echo $lang['Rainfalltoday']; ?></span><br />
<div id="rainfall"></div>
</div>
<!-- position 12th module (second to last) for homeweatherstation template -->
<div class="weather-item"><!-- module <?php echo $position12; ?> -->
<div class="chartforecast" >
<span class="yearpopup">
<?php if ($position12=='webcamsmall.php'){echo'<a title="Webcam " href="webcam.php" data-featherlight="iframe">'. $webcamicon. " Live Webcam </a>";}?>
<?php if ($position12=='airqualitymodule.php') {echo ' <a title="air quality information" href="purpleair.php" data-featherlight="iframe">'. $chartinfo. " Air Quality | Cloudbase </a>";}?>
<?php if ($position12=='indoortemperature.php') {echo ' <a title="Indoor Guide" href="homeindoor.php" data-featherlight="iframe">'. $chartinfo. " Indoor Guide </a>";}?>
<?php if ($position12=='moonphase.php') {echo ' <a title="Moon Info" href="mooninfo.php" data-featherlight="iframe">'. $chartinfo. " Moon Info </a>";}?>
<?php if ($position12=='solaruvds.php') {echo ' <a title="UV Guide" href="uvindexds.php" data-featherlight="iframe">'. $chartinfo. " UV Guide </a>";}?>
<?php if ($position12=='eq.php') {echo ' <a title="Earthquakes Worldwide" href="eqlist.php" data-featherlight="iframe">'. $chartinfo. " Worldwide Earthquakes </a>";}?>
</span>
</div>
<span class='moduletitle'><?php echo $position12title?></span>
<div id="solar"></div>
</div>
<!-- position last module for homeweatherstation template -->
<div class="weather-item"><!-- module <?php echo $positionlastmodule; ?> -->
<div class="chartforecast" >
<span class="yearpopup">
<?php if ($positionlastmodule=='webcamsmall.php'){echo'<a title="Webcam " href="webcam.php" data-featherlight="iframe">'. $webcamicon. " Live Webcam </a>";}?>
<?php if ($positionlastmodule=='airqualitymodule.php') {echo ' <a title="air quality" href="purpleair.php" data-featherlight="iframe">'. $chartinfo. " Air Quality | Cloudbase </a>";}?>
<?php if ($positionlastmodule=='indoortemperature.php') {echo ' <a title="Indoor Guide" href="homeindoor.php" data-featherlight="iframe">'. $chartinfo. " Indoor Guide </a>";} ?>
<?php if ($positionlastmodule=='moonphase.php') {echo ' <a title="Moon Info" href="mooninfo.php" data-featherlight="iframe">'. $chartinfo. " Moon Info </a>";}?>
<?php if ($positionlastmodule=='solaruvds.php') {echo ' <a title="UV Guide" href="uvindexds.php" data-featherlight="iframe">'. $chartinfo. " UV Guide </a>";}?>
<?php if ($positionlastmodule=='eq.php') {echo ' <a title="Earthquakes Worldwide" href="eqlist.php" data-featherlight="iframe">'. $chartinfo. " Worldwide Earthquakes </a>";}?>
</span>
</div>
<span class='moduletitle'><?php echo $positionlastmoduletitle?></span>
<div id="dldata"></div>
</div>
</div>
<!-- end module 11-13 -->
<!-- end outdoor data for homeweatherstation template -->
<!-- footer area for homeweatherstation template warning dont mess with this below this line unless you really know what you are doing -->
<div class="weatherfooter-container">
<div class="weatherfooter-item">
<div class="hardwarelogo1"><?php
if ($livedataFormat == 'weewx') {
echo '<a href="http://www.weewx.com/" title="WeeWX Software" target="_blank">
<img src="img/icon-weewx.svg" width="150" height="55" alt="http://www.weewx.com/"
style="margin-left: 20px"></a>';
}
elseif ($livedataFormat=='weathercat'){
echo '<a href="https://trixology.com/" title="WeatherCat Software" target="_blank">
<img src="img/WeatherCat100.png" width="50" height="50" alt="https://trixology.com/"
style="margin-left: 20px"></a>';
}
else {
echo '<a href="https://cumuluswiki.wxforum.net/a/Software" target="_blank" title="Cumulus Software">
<img src="img/cumulus.svg" width="125" height="25" alt="Cumulus"
style="margin-top: 15px;"></a>';
} ?>
</div>
<div class="hardwarelogo2"><?php
if ($davis=="Yes"){echo '<a href="https://www.davisinstruments.com/solution/vantage-pro2/" title="https://www.davisinstruments.com/solution/vantage-pro2/" target="_blank"><img src="img/designedfor.svg" width="125" height="125" alt="Davis Instruments®" style="margin-top: -40px" ></a>';}
else if ($weatherhardware=='Weatherflow Air-Sky'){echo '<a href="http://weatherflow.com/" title="http://weatherflow.com/" target="_blank"><img src="img/wflogo.svg" width="100" alt="http://weatherflow.com/" ></a>';
} else {
echo '<a href="https://weather34.com/homeweatherstation/" title="https://weather34.com/homeweatherstation/" target="_blank"><img src="img/weather34logo.svg" width="40" alt="https://weather34.com/homeweatherstation/" class="homeweatherstationlogo" ></a>';}?>
</div>
<div class="footertext">
<?php echo $info?>Source: (<?php echo $weather["swversion"];echo "-",$weather["version"]." Template:<oblue>".$templateversion?></oblue>)
<?php echo $info;?>Hardware:<?php echo $weatherhardware;?><br><?php echo $info;?><?php echo $stationlocation ;?> Weather Station <img alt="current language flag" src="img/flags/<?php echo $flag ;?>.svg" width="20" ><?php
if (isset($personalmessage) and trim($personalmessage) <> '') {echo '<br />'.$personalmessage;}
?>
</div>
</div>
</div>
<div id="lightningalert"></div>
</body>
<?php include('updater.php');include('menu.php')?>
</html>