From 1477607c65d211431a46cc44580d3ed07b9d2f84 Mon Sep 17 00:00:00 2001 From: David Guest Date: Fri, 6 Jun 2025 10:22:11 +1000 Subject: [PATCH] Experimenting with other fields and handling exceptions if not set. --- cal_testing.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cal_testing.php b/cal_testing.php index 54b5c1e..e37af40 100755 --- a/cal_testing.php +++ b/cal_testing.php @@ -13,7 +13,7 @@ $events = json_decode($json, true); // Start of the iCalendar content echo "BEGIN:VCALENDAR\r\n"; echo "VERSION:2.0\r\n"; -echo "PRODID:-//HLB//Brisbane Calendar//EN\r\n"; +echo "PRODID:-//Homelab Brisbane//Event Calendar//EN\r\n"; echo "CALSCALE:GREGORIAN\r\n"; echo "METHOD:PUBLISH\r\n"; echo "X-WR-TIMEZONE:Australia/Brisbane\r\n"; @@ -31,12 +31,14 @@ echo "END:VTIMEZONE\r\n"; // Generate VEVENTS foreach ($events as $event) { - $uid = uniqid() . "@yourdomain.com"; + $uid = uniqid() . "@homelabbrisbane.com.au"; $dtstart = date("Ymd\THis", strtotime($event["start"])); $dtend = date("Ymd\THis", strtotime($event["end"])); $summary = htmlspecialchars($event["title"]); $location = htmlspecialchars($event["location"]); + $description = isset($event["description"]) ? htmlspecialchars($event["description"]) : ''; + echo "BEGIN:VEVENT\r\n"; echo "UID:$uid\r\n"; @@ -45,6 +47,7 @@ foreach ($events as $event) { echo "DTEND;TZID=Australia/Brisbane:$dtend\r\n"; echo "SUMMARY:$summary\r\n"; echo "LOCATION:$location\r\n"; + echo "DESCRIPTION:$description\r\n"; echo "END:VEVENT\r\n"; }