Publishing calendars

From PHPicalWiki

Jump to: navigation, search

phpicalendar will display any valid calendar file in a valid calendar directory specified by $calendar_path/$cpath. It doesn't really care how the file got there. However, most users will generate their calendar with an iCalendar-compatible desktop calendar application, and publish the calendar to the appropriate calendar directory on the server.

There are several ways to set up your system to allow users to publish calendars

Contents

Publishing calendars on the computer where the calendar files reside

In MacOS X

In Mac OSX, individual Macs can publish websites by turning Personal Web Sharing on from the Sharing Preferences. This will allow you to run phpicalendar from the Sites folder of a user, or from /Library/Webserver/Documents for the machine.

WebDAV

WebDAV is an extension of the HTTP protocol designed to allow collaborative work on documents. In principle this could be used to allow multiple users to modify the same calendar, but most widely used calendar applications, e.g. iCal, do not support this at this time. This means that as far as phpicalendar is concerned, WebDAV is mostly a reasonably secure way to upload calendar files to the server, and to keep track of which users own which calendars.

Publishing to a WebDAV Server

Setting up WebDAV on OSX Server

OS X Server comes with WebDAV preinstalled, but it is off by default. To use it for a particular server, you need to go to the settings for the server and turn WebDAV on. Then you need to define your calendar directory as a realm for WebDAV and give users and groups permission to browse and author. Image:Server admin realms.jpg

Setting up WebDAV on other servers

Using the provided publish.php script

The hard part seems to be setup. See: Using publish.php. The instructions below should work if you are using a server where someone else already has publising via publish.php working:

Apple iCal

In Apple's iCal client, you can publish your calendar (write) or you can watch it (read only). It doesn't do both -- you can't edit your calendar on two different systems.

Publish

Ctrl-Click on your calendar and choose '*Publish*'. For the location, enter http://yourserver/path/to/publish.php

Subscribe

Ctrl-Click on your calendar list and choose '*Subscribe to Remote Calendar*'. For the location, enter http://yourserver/path/to/publish.php/calendarname.ics

Mozilla Sunbird / Lightning

Mozilla's Sunbird/Lightning clients use a read/write approach to calendars that allows you to subscribe to them and edit them from any location.

That's all there is to it!

Via FTP

In your iCalendar compatible programm (such as Korganizer), create a new calendar. Choose the option "Calendar saved on server" and enter the following directory : ftp://PATH_TO_CALENDAR/calendar.ics ; then enter your FTP account name and password to synchronize the calendar.

Publishing Google Calendar(s)

Minimal changes are needed to publish Google Calendars (Warning: These instructions will not work if your server does not support allow_fopen_url- see the forum for more information if you must use CURL).

1) In your Google Calendar account, go to the Calendar settings and click on the iCal link and Copy the address (e.g http://www.google.com/calendar/ical/...blic/basic.ics)
2) Open config.inc.php and find $list_webcals[] = ; and paste in the calendar link- e.g.

$list_webcals[] = 'http://www.google.com/calendar/ical/jtod4o6ihqg5nml8qrleq30@group.calendar.google.com/public/basic.ics';

Also in config.inc.php turn the caching off

$save_parsed_cals = 'no';

3) Test to see that the Calendar works- however, repeating events only show the beginning time. To fix this go to ical_parser.php in the functions folder and replace the "case 'DURATION': block with code you can copy and paste from http://www.sfu.ca/biology/facilities/computer/calendar/phpical-google-calendar.html (originally from http://phpicalendar.net/forums/ ).