From ea628ef91b4eb24ee6db41e1bfd75ba0b058982c Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Wed, 26 Jan 2022 09:05:03 +0000 Subject: Only show title summary for current time onwards, split up with timestamps --- index.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index fc92d21..f3280ba 100644 --- a/index.php +++ b/index.php @@ -9,7 +9,8 @@ Max $maxtemp[0], Min $mintemp[0], Cur $curtemp, UV $uv[0], Wind $wind[0], $morning[0] $afternoon[0] $night[0] $frost[0]\n\n"; +if ($timenow >= strtotime($sunset[0])) { + $summary[0] = "$sunset[0]: $night[0]"; +} else if ($timenow >= strtotime("12:00:00")) { + $summary[0] = "12:00: $afternoon[0] $sunset[0]: $night[0]"; +} else { + $summary[0] = "00:00: $morning[0] 12:00: $afternoon[0] $sunset[0]: $night[0]"; +} + +echo "Max $maxtemp[0], Min $mintemp[0], Cur $curtemp, UV $uv[0], Wind $wind[0], $summary[0] $frost[0]\n\n"; echo "\n\n"; echo "\n\n"; -- cgit v1.2.3