60 string $location =
'Anywhere',
61 string $startdate =
'2025-01-01',
62 string $starttime =
'10:30:00',
63 string $enddate =
'2025-01-01',
64 string $endtime =
'12:00:00',
65 string $description =
'Description',
66 string $reminder =
'60',
67 string $reminder_text =
'Reminder',
68 string $filename = LEPTON_PATH.MEDIA_DIRECTORY.
'/event.ics'
73 $startdate = str_replace(
'-',
'',$startdate);
74 $enddate = str_replace(
'-',
'',$enddate);
75 $starttime = str_replace(
':',
'',$starttime).
'00';
76 $endtime = str_replace(
':',
'',$endtime).
'00';
82 'BEGIN:VCALENDAR'.$eol.
83 'CHARSET:'.strtoupper(DEFAULT_CHARSET).$eol.
86 'TZID:'.DEFAULT_TIMEZONE_STRING.$eol.
87 'X-LIC-LOCATION:'.DEFAULT_TIMEZONE_STRING.$eol.
88 'PRODID:LEPTON-CMS,https://lepton-cms.org, '.LANGUAGE.$eol.
89 'CALSCALE:GREGORIAN'.$eol.
92 'UID:'.LEPTON_URL.
'_'.time().$eol.
93 'DTSTART:'.$startdate.
'T'.$starttime.$eol.
94 'DTEND:'.$enddate.
'T'.$endtime.$eol.
95 'LOCATION:'.$location.$eol.
96 'DTSTAMP:'.date(
'Ymd',time()).
'T'.date(
'his',time()).$eol.
97 'SUMMARY:'.$title.$eol.
98 'URL;VALUE=URI:'.LEPTON_URL.$eol.
99 'DESCRIPTION:'.$description.$eol.
101 'ACTION:DISPLAY'.$eol.
102 'TRIGGER:-PT'.$reminder.
'M'.$eol.
103 'DESCRIPTION:'.$reminder_text.$eol.
107 $result = file_put_contents($filename,$sICalContent);
109 if($result ===
false)
create_iCal_file(string $title, string $location='Anywhere', string $startdate='2025-01-01', string $starttime='10:30:00', string $enddate='2025-01-01', string $endtime='12:00:00', string $description='Description', string $reminder='60', string $reminder_text='Reminder', string $filename=LEPTON_PATH.MEDIA_DIRECTORY.'/event.ics')