Configuration

From PHPicalWiki

Jump to: navigation, search

PHP iCalendar is configured via a single file. In your phpicalendar folder you will see a file called config.inc.php. Open this file in your favorite text editor. The comments behind each variable definition will tell you what each setting does. Change the values between the quotation marks to change the setting of that variable. If there are restrictions as to what that variable can be set to, the comment behind will specify them. If you have difficulty with your configuration, you can ask the developers and other PHP iCalendar users at the PHP iCalendar forums.

[edit] Overview of the config.inc.php file

$template = 'default';

The template that we offer is called 'default'. If you install another template or wish to make your own, change this setting to the name of the folder inside the /templates/ folder.

$default_view = 'day';

What page do you first want to display when a visitor comes to your calendar site? Options are 'day', 'week', 'month', and 'year'.

$minical_view = 'current';

The day, week, and month views show little calendars of the previous and upcoming month. Clicking on the days in that mini calendar will take you to the view of your choice. Options are 'day', 'week', 'month', and 'current'.

$default_cal = $ALL_CALENDARS_COMBINED;

Sets what calendar is diplayed when a visitor first comes. Needs to be set to the exact filename of calendar without '.ics'. Or set to $ALL_CALENDARS_COMBINED to open all calenders combined into one.

$calendar_path = ;	

Sets where you will upload the calendars. If left blank, this defaults to the calendars subdirectory inside the phpicalendar directory. However, you can put the calendars anywhere that is accessible to the webserver. This can make upgrades easier, since you can point more than one version of phpicalendar at the $calendar_path directory while testing.

$support_ical = 'no';

Newer versions of Apple's iCal application use a database structure within its calendar directory, while still maintaining an iCalendar compliant file. If you wish to set $calendar_path to your iCal directory, set this to 'yes' so calendars can be correctly identified by name. You will also want to set $recursive_path equal to 'yes'.

$recursive_path = 'no';

By default PHP iCalendar will not search subdirectories of the $calendar_path for calendars. Setting $recursive_path equal to 'yes' changes this behavior so all calendars located in or within subdirectories of $calendar_path are considered for display.

$allow_login = 'no';

Set to 'yes' if you wish to allow visitors to login via a web form. This can be used to display specific calendars to logged in users. See the $locked_cals and $locked_map configuration variables for details.

$blacklisted_cals[] = ;

A list of calendars that will never be displayed by PHP iCalendar, regardless of any other configuration settings. These values should be the calendar filename without the .ics suffix, or the calendar name when using a newer Apple iCal calendar directory.

$locked_cals[] = ;

A list of calendars that will not be displayed by PHP iCalendar unless a visitor logs in via the PHP iCalendar login form or via HTTP authentication. If logged in, the calendars listed in $locked_map or $apache_map will be displayed. These values should be the calendar filename without the .ics suffix, or the calendar name when using a newer Apple iCal calendar directory.

$locked_map['user:pass'] = array();

A list of calendars locked by $locked_cals that will be displayed to a visitor who has logged in via the PHP iCalendar login form. These values should be the calendar filename without the .ics suffix, or the calendar name when using a newer Apple iCal calendar directory.

$apache_map['user'] = array();

A list of calendars locked by $locked_cals that will be displayed to a visitor who has logged in via HTTP authentication provided by the web server. These values should be the calendar filename without the .ics suffix, or the calendar name when using a newer Apple iCal calendar directory.

[edit] Organizing calendars within the $calendar_path directory

It is often useful to be able to run different sets of calendars from the same installation of the phpicalendar software. For example, you might want to use one installation to generate web calendars for multiple users. You can do this by creating subdirectories within the directory specified by $calendar_path. For example, your calendars directory structure might look like this:

calendars
calendars/cal0.ics
calendars/user1/cal1.ics
calendars/user1/cal2.ics
calendars/user2/cal3.ics
calendars/user2/cal4.ics

In this example, user1 owns cal1 and cal2, while user2 owns cal3 and cal4. The cal0 calendar is inside the calendars directory, while user1 and user2 are subdirectories holding the appropriate calendars. To view cal0, you would just give the URL

http://example.com/phpicalendar

To view the calendars in the subdirectories, use the GET variable cpath. For example,

http://example.com/phpicalendar/?cpath=user1

will display cal1 and cal2.