-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to get a iCalendar format feed from any calendar #349
base: main
Are you sure you want to change the base?
Conversation
…calendar events too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@randohinn let me start by apologising for the delay in checking. Thanks so much for submitting this PR.
if(strpos($ics, $event->uid) == false) { | ||
$ics .= "BEGIN:VEVENT\r\n"; | ||
$ics .="UID:" . $event->uid . "\r\n"; | ||
$ics .="DTSTAMP:" . $event->start_dt->format('Ymd\THis') . "\r\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ics .= "DTSTART:" . $event->start_dt->format('Ymd\THis') . "\r\n"; | ||
$ics .= "DTEND:" . $event->end_dt->format('Ymd\THis') . "\r\n"; | ||
$ics.= "SUMMARY:" . format_ical_string($event->title) . "\r\n"; | ||
$ics .= "DESCRIPTION:" . format_ical_string($event->description) . "\r\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would nice to check if the description is present, if not we can skip adding the description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for LOCATION and GEO.
@@ -287,11 +342,11 @@ function simcal_default_event_template() { | |||
|
|||
$content = '<strong>' . '[title]' . '</strong>'; | |||
$content .= "\n\n"; | |||
$content .= '[when]' . "\n"; | |||
$content .= '[when]' . "\r\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these changes for?
@@ -180,6 +180,13 @@ public function load_admin() { | |||
} | |||
} | |||
|
|||
public function simcal_ics_action() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the formatting, a tab is missing.
This PR adds the ability to add
?ics=true
to the end of any calendar URL and get an iCalendar formatted feed generated and returned back. This is useful as the plugin can provide this link to both single and grouped calendars, making mass-sharing of grouped calendars much easier.Welcome to feedback and/or changes needed to better structure this. So far, I have tested this on the site of JCI Estonia with a grouped calendar of 11 individual calendars and over 100 events successfully.