The iCalendar plugin allows you parsed iCalendar .ics and present it in DokuWiki
This extension is marked as obsoleted. Therefore it is hidden in the Extension Manager and the extension listing. Furthermore, it is candidate for removal.
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to calendoku, davcal, ical, icalevents
This plugin is no longer in active development and obsolete. Its functionality has been integrated back in the iCalEvents Plugin.
Just installing the iCalEvents Plugin should make your calendars work, it's nevertheless recommended to read the plugin page first.
This plugin allows you to display events from iCalendar in your website. It was initially based on the iCalEvents Plugin by Robert Rackl.
The plugin reads the *.ics
file from a URL and parses it into DokuWiki using pre-defined Templates from the configuration.
Version 1.4:
Version 1.3:
Version 1.2:
Version 1.1:
Version 1.0:
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
{{iCalendar>http://host/myCalendar.ics}}
1){{iCalendar>http://host/myCalendar.ics#from=today&previewDays=30}}
2){{iCalendar>http://host/myCalendar.ics#from=01/01/2011&previewDays=30}}
3){{iCalendar>http://host/myCalendar.ics#from=today}}
4){{iCalendar>http://host/myCalendar.ics#to=today}}
5){{iCalendar>http://host/myCalendar.ics#from=today&numberOfEntries=5}}
6){{iCalendar>http://host/myCalendar.ics#sort=DESC}}
7){{iCalendar>http://host/myCalendar.ics#showAs=list}}
8){{iCalendar>icsUrl#key=value&..&key=value}}
icsUrl | the location of the ics file | required |
---|---|---|
key | the parameter key to set | optional |
value | the parameter value to set | optional |
Multiple key=value
parameters can be set using the &
as a seperator.
Available parameters:
Key | Type | Comments | Requirement | Version |
---|---|---|---|---|
from | date | Date from which the events should be displayed. Format is DD/MM/YYYY. The value 'today' is also valid. | optional | all |
to | date | Date until which the events should be displayed. Format is DD/MM/YYYY. The value 'today' is also valid. | optional | all |
previewDays | number | Number of days starting at the from date to display. | optional | all |
numberOfEntries | number | Number of entries to display | optional | all |
showEndDates | onoff | Determines if the end date/time should be shown. If an event covers more than one day, the end date is shown by default. Values: 0 for off, 1 for on. Default: 0. | optional | all |
| | | | Deprecated since version 1.4 |
| | | | Deprecated since version 1.4 |
sort | string | Default: ASC. If you set this parameter to DESC, the entries will be sorted in reverse order, from highest date downto the lowest. Parameter exists since Version 1.3. | optional | Version 1.3 |
showAs | string | Default: default. Allows the user to display the events using a template defined in the configuration parameters. Currently available: default, list, table. The user can add more templates by editing the default.php and metadata.php files in the conf/ directory. | optional | Version 1.4 |
Key | Type | Comments | Requirement | Version |
---|---|---|---|---|
dformat | date | Formatting of the event date (See Format) | required | all |
tformat | date | Formatting of the event time (See Format) | required | Version 1.1 |
| | | | Deprecated since Version 1.3 |
| | | | Deprecated since Version 1.3 |
default | string | Default template for displaying events. Previously viewHTML. | required | Version 1.4 |
list | string | Template for displaying events as a listview. Previously listHTML. | optional | Version 1.4 |
table | string | Template for displaying events as a table. | optional | Version 1.4 |
The user may add their own configuration parameters for their entry templates. The appropriate configuration parameter for the template can be set via the syntax parameter showAs.
In order to make a new template, for example one that displays all entries as an unsorted list, the configuration files must be changed as follows:
conf/metadata.php
If you wish to alter your self-created template in the administration panel, you must setup the metadata for this parameter.
Example:
$meta['unsortedlist'] = array('');
conf/default.php
If you wish to set a default setting for the newly created parameter, you can set it up in default.php. This is optional, you can also use the administration panel to setup the configuration parameter.
$conf['unsortedlist'] = ' * {date}: {summary} ';
showAs
Once the configuration parameter has been added, you can use it in the plugin syntax:
{{iCalendar>http://host/myCalendar.ics#showAs=unsortedlist}}
Using the configuration parameters listHTML and viewHTML alternate HTML templates may be configured to display the events. The templates used for these parameters are plain HTML containing specific tags that will be interpreted by the plugin.
The templates, which can be configured in conf/default.php
, or via the administraton panel, is parsed using the following tags:
Tag | Comments |
---|---|
{summary} | Will display the event's title |
{summary_link} | Will display the event's title, including a link to the according VEVENT, which can be opened to include in your own iCalendar. (Since Version 1.4) |
{date} | Will display the event date. The date format can be configured in the conf/default.php file |
{location} | Will display the event location |
{location_link} | Will display the event location with a link to GoogleMaps |
{description} | Will display the event description. If the [InternalPage] tag is included in the event description, the contents of the provided InternalPage will be inserted over the tag. |
default
===== {date}: {summary} ===== **Location**: {location_link}\\\\ {description}
list
====== {date}: {summary} ====== **<sup>Location: {location}</sup>**\\ {description}
viewHTML:
<h2>{summary}</h2><p><small><strong>{date}</strong></small><br /><br /><b>Location</b>: {location}<br /><br />{description}
listHTML:
<p><small><b>{date}</b></small><br/><b>{summary}</b><br/>{description}</p>
Here is a list of the files currently used in the plugin.
Source Code | |
---|---|
syntax.php | Contains the main plugin code |
vevent.php | Code to download an event as .ics file |
functions.php | Support functionality |
Support | |
plugin.info.txt | Plugin information |
ics.png | Icon for events with links to their VEVENT .ics file |
Configuration | |
conf/metadata.php | Metadata settings |
conf/default.php | Default settings |
Language | |
lang/en/lang.php | English language file |
$html = p_render($mode, p_get_instructions( $ret ), $info );
or download v1.4 again, since I added a hotfix. JDT
DESCRIPTION:^ 2:00 pm | Meeting: introduction and group assignments. |\n^ 3:00 pm | Work on research proposal: Find a good scientific question. |\ n^ 6:00 pm | Dinner. |\n^ 7:00 pm | Seminar. |\n
The problem seems to be that “\n” isn't interpreted as a linebreak. I was able to get it working by changing lines 119-123 in functions.php to
if (preg_match($regex_description, $vevent, $description)) { $entry['description'] = $description[1]; $entry['description'] = preg_replace("/[\r\n] ?/", "", $entry['description']); $entry['description'] = str_replace('\,', ',', $entry['description']); $entry['description'] = str_replace('\\n', "\n", $entry['description']); // added! Replace newlines in description with actual linebreaks [Rik, 2011-12-27] }
I forked these changes from v1.4 to GitHub. Download it here. — Rik Blok 2014/01/09 01:01
{{iCalendar>https://my.host.com/myCalendar.ics}}
setlocale(LC_ALL, 'nl_NL');
— Mark 2012/12/09 22:05
I write : {{iCalendar>https://MyHordeSite/rpc.php/kronolith/gbreiner/tV0_HIukgmK0sftwQ6bIJA3.ics}} I get : Error in Plugin iCalendar: Could not get 'ttps:/ /MyHordeSite/rpc.php/kronolith/gbreiner/tV0_HIukgmK0sftwQ6bIJA3.ics': 401
Any help would be welcome.
Actually if you are getting a 401 error the authorization fails, this has nothing to do with https… the plugin does not support authorization — Mark 2013/04/26 15:09
Thanks in advance.
Gér@rd
I thought it was an issue with my certificate ssl, but you're right, it is not. It seems rather that an authentication webdav is required.
Many thanks for your answer.
Gér@rd
If you write {{iCalendar>https://example.com/blabla.ics}}, you get an error message like Error in Plugin iCalendar: Could not get 'ttps://example.com/blabla.ics': 401
To solve it, I just added a space before the url, like this: {{iCalendar> https://example.com/blabla.ics}} and it solved the issue.
When one has to authenticate (like in owncloud for example), the user/pass can be specified in the url (be careful, ensure that you use the https protocol) like this : {{iCalendar> https://user:password@example.com/blabla.ics}}
Hope this helps,
Giloux
Thank you for your contributions!
Hi :)
After updating to the last version (as of Jan 2016) I get the following error message:
Error in Plugin iCalendar: Could not get 'https://user:pwd@google.com/calendar/ical/user%40gmail.com/private-7610e04df(…)2fbcba975d46ecaa/basic.ics': 404
User and pwd were obviously replaced by my credentials. (I removed some of the numbers in the string displayed here for confidentiality reasons…)
Any help would be greatly appreciated
Hey there! A 404 error code would indicate that the .ics URL could not be found. Try opening up the link in a browser and see if it works. Maybe the calendar is private? Cheers JDT.
* Thanks for the swift answer :) Yes the calendar is private. This is why I use the user:pwd parameters (https://user:pwd@google.com). It used to work fine until recently (a few days ago as of Jan 2016)
We've found that some of our calendar entries don't show a date. It turns out that our ical entries contain “DTSTART:…” lines without a “;VALUE=DATE” part. I don't know if these Ical entries are invalid or not, but our patch seems to do no harm:
diff iCalendar/functions.php.orig iCalendar/functions.php -u --- iCalendar/functions.php.orig 2013-07-01 16:14:43.000000000 +0100 +++ iCalendar/functions.php 2013-07-01 16:30:41.000000000 +0100 @@ -49,8 +49,8 @@ $regex_dtend_timezone = '/DTEND;TZID=(.*?):([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})/'; // all day event - $regex_alldaystart = '/DTSTART;VALUE=DATE:([0-9]{4})([0-9]{2})([0-9]{2})/'; - $regex_alldayend = '/DTEND;VALUE=DATE:([0-9]{4})([0-9]{2})([0-9]{2})/'; + $regex_alldaystart = '/DTSTART(?:;VALUE=DATE)?:([0-9]{4})([0-9]{2})([0-9]{2})/'; + $regex_alldayend = '/DTEND(?:;VALUE=DATE)?:([0-9]{4})([0-9]{2})([0-9]{2})/'; // Make the entry $entry = array();