-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
212 lines (188 loc) · 18.9 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
<?php header('Content-type: text/html; charset=utf-8');error_reporting(0);
####################################################################################################
# CREATED FOR HOMEWEATHERSTATION MB SMART TEMPLATE #
# https://weather34.com/homeweatherstation/index.html #
# #
# Release: July 2019 #
# #
# https://www.weather34.com #
####################################################################################################
//original weather34 script original css/svg/php by weather34 2015-2019 clearly marked as original by weather34//
include_once('livedata.php');include_once('common.php');include_once('settings1.php'); date_default_timezone_set($TZ);?>
<!DOCTYPE html><html><head>
<!-- Primary Meta Tags -->
<title><?php echo $stationlocation;?> Home Weather Station</title>
<meta name="title" content="<?php echo $stationlocation;?> Home Weather Station">
<meta name="description" content="Home weather station providing current weather conditions for <?php echo $stationlocation;?>">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="">
<meta property="twitter:title" content="<?php echo $stationlocation;?> Home Weather Station">
<meta property="twitter:description" content="Home weather station providing current weather conditions for <?php echo $stationlocation;?>">
<meta property="twitter:image" content="img/weather34_template-min.png">
<meta content=website property=og:type>
<meta content="7 days" name=revisit-after>
<meta content=web name=distribution><meta content="<?php echo $stationlocation;?>" name=author>
<meta content=INDEX,FOLLOW name=robots>
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=yes">
<meta name="mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" sizes="180x180" href="img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png">
<link rel="manifest" href="img/site.webmanifest">
<link rel="mask-icon" href="img/safari-pinned-tab.svg" color="#01a4b4">
<meta name="apple-mobile-web-app-title" content="Weather34 MB-SMART">
<meta name="application-name" content="Weather34 MB-SMART">
<meta name="msapplication-TileColor" content="#f8f8f8">
<meta name="msapplication-TileImage" content="img/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="preload" href="css/fonts/clock3-webfont.woff" as="font" type="font/woff" crossorigin>
<link rel="preload" href="css/fonts/verbatim-regular.woff" as="font" type="font/woff" crossorigin>
<link href="css/weather34dashboard.<?php echo $theme?>.css?version=<?php echo filemtime('css/weather34dashboard.'.$theme.'.css')?>" rel="stylesheet prefetch">
</head>
<!-- Weather34 top moudles begin -->
<div class="maincontainer">
<main class="grid">
<weather34topmodule> <!-- Weather34 Module 1 -->
<div class="weather34box">
<div class="weather34title2"><?php echo $info?> <?php echo $position1title ;?></div>
<div id="position1"></div></div></weather34topmodule>
<weather34topmodule> <!-- Weather34 Module 2 -->
<div class="weather34box">
<div class="weather34title2"><?php echo $info?> <?php echo $position2title ;?></div>
<div id="position2"></div></div></weather34topmodule>
<weather34topmodule> <!-- Weather34 Module 3 -->
<div class="weather34box">
<div class="weather34title2"><?php echo $info?> <?php echo $position3title ;?></div>
<div id="position3"></div></div>
</weather34topmodule>
<weather34topmodule> <!-- Weather34 Module 3 -->
<div class="weather34box">
<div class="weather34title2"><?php echo $info?> <?php echo $position4title ;?></div>
<div id="position4"></div></div>
</weather34topmodule>
</main>
<!-- Weather34 tmain moudles begin -->
<main class="grid1">
<weather34module> <!-- Weather34 Main Module 1 Temperature-->
<div class=actualt><?php echo $lang['Temperature']; ?> (<valuetitleunit>°<?php echo $weather["temp_units"] ;?></valuetitleunit>) </div>
<div class=weather34chartlinks>
<a class="weather34tiplink" data-weather34tiplink="Temperature Almanac" href=tempalmanac.php data-lity><chartinfocolor><?php echo $chartinfo?></chartinfocolor> <?php echo $lang['Almanac']; ?></a>
<a class="weather34tiplink" data-weather34tiplink="Temperature <?php echo date('Y');?>" href=temperaturechart.php data-lity><chartinfocolor><?php echo $menucharticonpage?></chartinfocolor> Temperature</a>
<a class="weather34tiplink" data-weather34tiplink="Dewpoint <?php echo date('Y');?>" href=dewpointchart.php data-lity><chartinfocolor><?php echo $menucharticonpage?></chartinfocolor> Dewpoint</a>
<a class="weather34tiplink" data-weather34tiplink="Today Charts" href=todaytemperaturechart.php data-lity><chartinfocolor><?php echo $menucharticonpage?></chartinfocolor> <?php echo $lang['Today']; ?> </a></div>
<div id=temperature></div></weather34module>
<weather34module> <!-- Main Module 2 Forecast-->
<div class=actualt><?php echo $position6title ;?> (<valuetitleunit>°<?php echo $weather["temp_units"] ;?></valuetitleunit>) </div>
<div class=weather34chartlinks>
<?php if ($position6=='forecast3wu.php' || $position6=='forecast3wularge.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="10 Day Forecast" href="outlookwu.php" data-lity>'. $chartinfo. " Daily Forecast </a> ";}?>
<?php if ($position6=='forecast3wu.php' || $position6=='forecast3wularge.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Forecast Summary" href="outlookwutext.php" data-lity>'. $chartinfo. " Forecast Summary</a> ";}?>
</span></div>
<div id=currentfore></div></weather34module>
<weather34module> <!-- Weather34 Main Module 3 Current-->
<div class=actualt><?php echo $lang['Currentsky'];?></div>
<div class=weather34chartlinks>
<a class="weather34tiplink" data-weather34tiplink="Metar Conditions" href="metarnearby.php" data-lity><?php echo $chartinfo?> <?php echo 'Nearby Metar';?> <?php if(filesize('jsondata/metar34.txt')<160){echo "(<ored>Offline</ored>)";}else echo "" ?></a>
<a href="windyradar.php" class="weather34tiplink" data-weather34tiplink="Windy.com Radar" data-lity><?php echo $chartinfo?> Radar</a>
<a href="windywind.php" class="weather34tiplink" data-weather34tiplink="Windy.com Wind Map" data-lity><?php echo $chartinfo?> Wind Map</a>
</div>
<div id=currentsky></div></weather34module>
<weather34module> <!-- Main Module 4 Wind-->
<div class=actualt><?php echo $lang['Direction'];?> | <?php echo $lang['Windspeed'] ," (<valuetitleunit>",$weather["wind_units"];?></valuetitleunit>)</div>
<div class=weather34chartlinks>
<a class="weather34tiplink" data-weather34tiplink="Wind Speed Almanac" href=windalmanac.php data-lity><chartinfocolor><?php echo $chartinfo?></chartinfocolor> <?php echo $lang['Almanac']; ?></a>
<a class="weather34tiplink" data-weather34tiplink="Wind Speed <?php echo date('Y');?>" href=windchart.php data-lity><chartinfocolor><?php echo $menucharticonpage?></chartinfocolor> Wind-Speed</a>
<a class="weather34tiplink" data-weather34tiplink="Wind Speed Today" href=todaywindcharts.php data-lity><chartinfocolor><?php echo $menucharticonpage?></chartinfocolor> <?php echo $lang['Today']; ?></a></div>
<div id=windspeed></div></weather34module>
<weather34module> <!-- Weather34 Main Module 5 Barometer-->
<div class=actualt><?php echo $lang['Barometer']," (<valuetitleunit>",$weather["barometer_units"]; ?></valuetitleunit>)</div>
<div class=weather34chartlinks>
<a class="weather34tiplink" data-weather34tiplink="Barometer Almanac" href=barometeralmanac.php data-lity><chartinfocolor><?php echo $chartinfo?></chartinfocolor> <?php echo $lang['Almanac']; ?></a>
<a class="weather34tiplink" data-weather34tiplink="Barometer Charts" href=barometerchart.php data-lity><chartinfocolor><?php echo $menucharticonpage?></chartinfocolor> Barometer</a></div>
<div id=barometer></div></weather34module>
<weather34module> <!-- Weather34 Main Module 6 Sky-->
<div class=actualt><?php echo $lang['SunPosition']; ?></div>
<div class=weather34chartlinks>
<a class="weather34tiplink" data-weather34tiplink="Moon Phase Data" href=mooninfo.php data-lity><chartinfocolor><?php echo $chartinfo?></chartinfocolor> Moon Information</a>
<a class="weather34tiplink" data-weather34tiplink="Meteor Shower Data" href=meteorshowers.php data-lity><chartinfocolor><?php echo $chartinfo?></chartinfocolor> Meteor Showers</a></div>
<div id=moonphase></div></weather34module>
<weather34module> <!-- Weather34 Main Module 7 Rainfall-->
<div class=actualt><?php echo $lang['Rainfalltoday']," (<valuetitleunit>".$weather["rain_units"]?></valuetitleunit>)</div>
<div class=weather34chartlinks>
<a class="weather34tiplink" data-weather34tiplink="Rainfall Almanac" href=rainfallalmanac.php data-lity><chartinfocolor><?php echo $chartinfo?></chartinfocolor> <?php echo $lang['Almanac']; ?></a>
<a class="weather34tiplink" data-weather34tiplink="Rainfall <?php echo date('Y');?>" href=rainfallchart.php data-lity><chartinfocolor><?php echo $menucharticonpage?></chartinfocolor> Rainfall</a>
<a class="weather34tiplink" data-weather34tiplink="Rainfall Today Charts" href=todayrainchart.php data-lity><chartinfocolor><?php echo $menucharticonpage?></chartinfocolor> <?php echo $lang['Today']; ?></a></div>
<div id=rainfall></div></weather34module>
<weather34module> <!-- Weather34 Main Module 8 Optional-->
<div class=actualt><?php echo $position12title?></div>
<div class=weather34chartlinks>
<?php if ($position12=='webcamsmall.php' OR $position12=='indoortemperature.php' OR $position12=='moonphase.php'){echo' <a class="weather34tiplink" data-weather34tiplink="Webcam" href="cam.php" data-lity>'. $webcamicon. ' Live Webcam </a></span>
<a class="weather34tiplink" data-weather34tiplink="Indoor Data" href="homeindoor.php" data-lity>'. $chartinfo. ' Indoor Guide </a></span>
<a class="weather34tiplink" data-weather34tiplink="Moon Phase Data" href="mooninfo.php" data-lity>'. $chartinfo. ' Moon Info </a></span>';}
if ($position12=='airqualitymodule.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Air Quality Data" href="purpleair.php" data-lity>'. $chartinfo. " Air Quality | Cloudbase </a></span>";}
if ($position12=='airqualityluftdaten.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Air Quality Data" href="luftdaten.php" data-lity>'. $chartinfo. " Luftdaten Air Quality | Cloudbase </a></span>";}
if ($position12=='weather34uvsolar.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="UV Almanac" href="uvalmanac.php" data-lity> '. $chartinfo. " UV ".$lang['Almanac']." </a></span>";}
if ($position12=='weather34uvsolar.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Solar Almanac" href="solaralmanac.php" data-lity>'. $chartinfo. " Solar ".$lang['Almanac']." </a></span>";}
if ($position12=='solaruvwu.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="UV Index Guide" href="uvindexwu.php" data-lity>'. $chartinfo. " UV Guide </a></span>";}
if ($position12=='solaruvwu.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Solar Almanac" href="solaralmanac.php" data-lity>'. $chartinfo. " Solar ".$lang['Almanac']." </a></span>";}
if ($position12=='solaruvwu.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Solar Chart" href="mbcharts/todaysolar.php" data-lity> '. $menucharticonpage. " Solar chart </a></span>";}
if ($position12=='eq.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Recent World Wide Earthquakes" href="eqlist.php" data-lity>'. $chartinfo. " Worldwide Earthquakes </a></span>";}?>
</div>
<div id=solar></div></weather34module>
<weather34module> <!-- Weather34 Main Module 9 Optional-->
<div class=actualt><?php echo $positionlastmoduletitle?></div>
<div class=weather34chartlinks>
<?php if ($positionlastmodule=='webcamsmall.php' OR $positionlastmodule=='indoortemperature.php' OR $positionlastmodule=='moonphase.php'){echo' <a class="weather34tiplink" data-weather34tiplink="Webcam" href="cam.php" data-lity>'. $webcamicon. ' Live Webcam </a></span>
<a class="weather34tiplink" data-weather34tiplink="Indoor Data" href="homeindoor.php" data-lity>'. $chartinfo. ' Indoor Guide </a></span>
<a class="weather34tiplink" data-weather34tiplink="Moon Phase Data" href="mooninfo.php" data-lity>'. $chartinfo. ' Moon Info </a></span>';}
if ($positionlastmodule=='airqualitymodule.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Air Quality Data" href="purpleair.php" data-lity>'. $chartinfo. " Air Quality | Cloudbase </a></span>";}
if ($positionlastmodule=='airqualityluftdaten.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Air Quality Data" href="luftdaten.php" data-lity>'. $chartinfo. " Luftdaten Air Quality | Cloudbase </a></span>";}
if ($positionlastmodule=='weather34uvsolar.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="UV Index Guide" href="uvindex.php" data-lity>'. $chartinfo. " UV Guide </a></span>";}
if ($positionlastmodule=='weather34uvsolar.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="UV Almanac" href="uvalmanac.php" data-lity> '. $chartinfo. " UV ".$lang['Almanac']." </a></span>";}
if ($positionlastmodule=='weather34uvsolar.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Solar Almanac" data-lity>'. $chartinfo. " Solar Almanac </a></span>";}
if ($positionlastmodule=='solaruvwu.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="UV Guide" href="uvindexwu.php" data-lity>'. $chartinfo. " UV Guide </a></span>";}
if ($positionlastmodule=='solaruvwu.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Solar Almanac" href="solaralmanac.php" data-lity>'. $chartinfo. " Solar ".$lang['Almanac']." </a></span>";}
if ($positionlastmodule=='solaruvwu.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Solar Chart" href="mbcharts/todaysolar.php" data-lity> ' .$menucharticonpage. " Solar chart </a></span>";}
if ($positionlastmodule=='eq.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Recent World Wide Earthquakes" href="eqlist.php" data-lity>'. $chartinfo. " Worldwide Earthquakes </a></span>";}
if ($positionlastmodule=='airqualitymodule.php') {echo ' <a class="weather34tiplink" data-weather34tiplink="Recent World Wide Earthquakes" href="eqlist.php" data-lity>'. $chartinfo. " Worldwide Earthquakes </a></span>";}?>
</div>
<div id=dldata></div></weather34module>
<!-- Weather34 main moudles end -->
<!-- Weather34 Footer -->
<main class="gridhardware">
<weather34infoboxes>
<div class=hardwareimg1>
<a href="https://www.meteobridge.com/wiki/index.php/Home" alt="https://www.meteobridge.com/wiki/index.php/Home" title="https://www.meteobridge.com/wiki/index.php/Home">
<?php
if ($mbplatform== "Meteobridge Pro"){echo '<img src="img/MeteobridgePRO.svg" alt="Davis Instruments-Meteobridge" title="Davis Instruments-Meteobridge" width=60px height=50px >';}
else if ($mbplatform== "Meteobridge Nano"){echo '<img src="img/nano.svg" alt="Meteobridge TP-LINK" title="Meteobridge Nano" width=60px height=50px >';}
else if ($mbplatform== "Meteobridge NanoSD"){echo '<img src="img/nano.svg" alt="Meteobridge D-LINK" title="Meteobridge NanoSD" width=60px height=50px" >';}
?></a> </div>
<div class=mbtype> <?php echo $info?> <?php echo $mbplatform?>: <?php echo $weather["mbplatform"]?></div>
<div class=mbfirmware> <?php echo $info?> Firmware Rev:<oblue><?php echo $weather["swversion"];echo "-",$weather["build"]?><oblue></div>
<?php //meteobridge device uptime
$nanosduptime = $meteobridgeapi[81];function convert($nanosduptime){$weather34nanotimeago = "";$days1 = intval(intval($nanosduptime) / (3600*24));$hours1 = (intval($nanosduptime) / 3600) % 24;$minutes1 = (intval($nanosduptime) / 60) % 60;$seconds1 = (intval($nanosduptime)) % 60;if($days1> 1){$weather34nanotimeago .= "$days1 Days ";}else {if($days1>0){$weather34nanotimeago .= "$days1 Day ";}if($hours1 > 1){$weather34nanotimeago .= "$hours1 hrs ";}else if($hours1 >=0){$weather34nanotimeago .= "$hours1 hr ";}if($minutes1 > 1){$weather34nanotimeago .= "$minutes1 mins ";}else if($minutes1 >=0){$weather34nanotimeago .= "$minutes1 min ";}}return $weather34nanotimeago;}?>
<div class=nanouptime> <?php echo $info?> Interface Uptime:<oblue> <?php echo convert($nanosduptime)?></oblue></div>
</weather34infoboxes>
<weather34infoboxes>
<div class=hardwareimg2>
<?php
if ($weatherhardware== "Davis Vantage Vue"){echo '<img src="img/davisvue.svg" alt="Davis Instruments-Meteobridge" title="Davis Instruments-Meteobridge" width="90px" height="55px" >';}
else if ($weatherhardware== "Davis Envoy8x"){echo '<img src="img/designedfordavisenvoy8x.svg" alt="Davis Instruments-Meteobridge" title="Davis Instruments-Meteobridge" width="90px" height="55px" >';}
else if ($davis=="Yes"){echo '<img src="img/logoDAVISCONSOLEVECTOR.svg" alt="Davis Instruments-Meteobridge" title="Davis Instruments-Meteobridge" width="90px" height="55px" >';}?></div>
<div class=hardware><?php echo $info?> <?php echo $weatherhardware;?></div>
<div class=hardwareinfo><?php echo $info?> Installed: <?php echo $hardwareinstalled;?></div>
<div class=hardwareuptime><?php echo $info?> Power Console:<?php echo $weather['indoorbattery']?> <?php echo $info?>ISS:<?php echo $weather['outdoorbattery']?></div>
</weather34infoboxes>
<weather34infoboxes>
<div class=locinfo><?php echo $info?> Operational Since:<?php echo $since;?></div>
<div class=locinfo2><?php echo $info?> <?php echo $stationlocation?> <img src="img/flags/<?php echo $flag ;?>.svg" width="15px" ></div>
<div class=locinfo3><?php echo $info?> <?php echo $designedby;?> ©2015-<?php echo date('Y');?></div>
</weather34infoboxes></div></div>
<div class="footercontainer">
<main class="gridfooter">
<weather34footer>
<div class=footertext>
<div class="weather34-mbsmartlogo"><a class="weather34tipfooter" href="https://weather34.com/homeweatherstation/" data-weather34tipfooter="WEATHER34 MB-SMART" target="_blank"><img src="img/weather34-logo.svg" width=47em > <span>weather<ored>34</ored> designed</span></a></div>
<?php echo $info?> Weather Data Provided By: <?php echo $stationlocation?> Home Weather Station </main></div>
</body><?php include_once('updater.php');include_once('menu.php');?><div id=lightningalert></div>