loadForecast(); $tempunits = "C"; $degreesymbol = "°"; if (!empty($_COOKIE['TemperatureUnitsPref']) && preg_match("/[FCK]/", $_COOKIE['TemperatureUnitsPref'])) { $tempunits = $_COOKIE['TemperatureUnitsPref']; // No degree symbol for Kelvins if ($tempunits == "K") { $degreesymbol = ""; } } News::load($SETTINGS["sources"]["news"]); $newsitems = News::getItems(); // Sort by category $itemsbycategory = []; foreach ($newsitems as $item) { $itemsbycategory[$item->getCategory()->toString()][] = $item; } ?>
build("Low: {tempLow}{units} High: {tempHigh}{units}", [ "tempLow" => round(Weather::convertDegCToUnits($forecast[0]->tempLow, $tempunits), 1), "tempHigh" => round(Weather::convertDegCToUnits($forecast[0]->tempHigh, $tempunits), 1), "units" => " $degreesymbol$tempunits" ]); ?>
summary; ?>
build("{tempLow} to {tempHigh}{units}", [ "tempLow" => round(Weather::convertDegCToUnits($day->tempLow, $tempunits), 1), "tempHigh" => round(Weather::convertDegCToUnits($day->tempHigh, $tempunits), 1), "units" => " $degreesymbol$tempunits" ]); ?>
summary; ?>
get("Headlines"); ?>