This is the source code for the website of Serenum. https://serenum.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

224 lines
5.3 KiB

<?php
require_once 'site-header.php';
$apikey_null = false;
$apikey_invalid = false;
if($config_apikey == null) {
$apikey_null = true;
} elseif(!preg_match('/^[a-f0-9]{32}$/', $config_apikey)) {
$apikey_invalid = true;
}
echo '<section id="weather">';
if($apikey_null == true OR $apikey_invalid == true) {
echo '<div class="'.($apikey_null == true ? 'info' : 'error').' color-'.($apikey_null == true ? 'blue' : 'red').'" style="display: block;"><div>';
echo svgicon(($apikey_null == true ? 'info' : 'error'));
echo '<div class="message" style="display: block;">';
if($apikey_null == true) {
echo $lang->page_weather->error_350;
} elseif($apikey_invalid == true) {
echo $lang->page_weather->error_351;
}
echo '</div>';
echo '<div class="code">';
echo ($apikey_null == true ? '350' : ($apikey_invalid == true ? '351' : ''));
echo '</div>';
echo '</div></div>';
} else {
echo '<div id="coordinates" data-latitude="'.$latitude_shorten.'" data-longitude="'.$longitude_shorten.'"></div>';
echo '<div id="settings" data-unit="'.$settings_unit.'" data-language="'.$settings_language.'" data-decimal="'.$settings_decimal.'" data-time="'.$settings_time.'" data-updategps="'.$settings_updategps.'" data-apikey="'.$settings_apikey.'"></div>';
echo '<div class="loading color-blue">';
echo svgicon('loading');
echo $lang->page_weather->loading;
echo '</div>';
echo '<div class="error color-red"><div>';
echo svgicon('error');
echo '<div class="message">';
echo ($apikey_null == false ? $lang->page_weather->error_350 : ($apikey_invalid == true ? $lang->page_weather->error_351 : ''));
echo '</div>';
echo '<div class="code">';
echo ($apikey_null == true ? '350' : ($apikey_invalid == true ? '351' : ''));
echo '</div>';
echo '</div></div>';
echo '<div class="weather">';
echo '<div id="map-overlay">';
echo $lang->various->map->loading;
echo '</div>';
echo '<div id="map"></div>';
echo '<div class="place"></div>';
echo '<div class="report">';
echo '<div class="short">';
echo '<div class="datetime"></div>';
echo '<div class="current">';
echo '<div class="temperature"></div>';
echo '<div class="weather">';
echo '<div class="icon"></div>';
echo '</div>';
echo '</div>';
echo '<div class="weather-text"></div>';
echo '</div>';
echo '<div class="details">';
echo '<div class="item windy">';
echo '<div class="label">';
echo $lang->page_weather->details_wind;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item feels-like">';
echo '<div class="label">';
echo $lang->page_weather->details_feelslike;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item dewpoint">';
echo '<div class="label">';
echo $lang->page_weather->details_dewpoint;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item clouds">';
echo '<div class="label">';
echo $lang->page_weather->details_clouds;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item humidity">';
echo '<div class="label">';
echo $lang->page_weather->details_humidity;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item pressure">';
echo '<div class="label">';
echo $lang->page_weather->details_pressure;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item uvindex">';
echo '<div class="label">';
echo $lang->page_weather->details_uvindex;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item visibility">';
echo '<div class="label">';
echo $lang->page_weather->details_visibility;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item precipitation">';
echo '<div class="label">';
echo $lang->page_weather->details_precipitation;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '<div class="item air-quality">';
echo '<div class="label">';
echo $lang->page_weather->details_airquality;
echo '</div>';
echo '<div class="value"></div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="forecast">';
echo '<h4>'.$lang->page_weather->subtitle_forecast_48h.'</h4>';
echo '<div class="hourly"></div>';
echo '<div class="toggle-hourly">';
echo $lang->page_weather->toggle->show;
echo '</div>';
echo '<h4>'.$lang->page_weather->subtitle_forecast_7d.'</h4>';
echo '<div class="daily"></div>';
echo '<div class="toggle-daily">';
echo $lang->page_weather->toggle->show;
echo '</div>';
echo '</div>';
echo '<div class="message no-select">';
echo $lang->page_weather->message_moredatalateron;
echo '</div>';
echo '</div>';
}
echo '</section>';
require_once 'site-footer.php';
?>