CGI Programming by Collin Forbes
  Calendar's Configuration file   Updated: Thur, 20 Apr 2000  

Everything you need is in one configuration file
The first part of the file contains configuration directives, most of which are optional. The rest of the file contains your date and event information.

Most importantly, you need to specify the location of your template using the template directive. This is what will make the calendar look like the rest of your web pages. Be sure to include enough of the path for the program to be able to find the file. On some systems, you may be able to use paths relative to the calendar program, but you may need to use a full path starting with the root directory elsewhere.

template=../calendar/template.tmpl

Your template is a normal HTML file with some special marker tokens which tell the program where to put the calendar table or URLs you can use to make links to navigate a month at a time.

%%TOKEN(calendar)%%

The calendar as a fairly large table. Use the configuration directives to control its size and appearance.

%%TOKEN(next)%%

A navigation URL to show the next month.

%%TOKEN(prev)%%

A navigation URL to show the previous month.

The rest of the configuration directives are optional and are either suggested defaults or change the look of the calendar without changing the function.

table_width=475

The target width of the HTML table in pixels. Don't make it too wide, or else people with small screens will have to scroll horizontally and suffer. Use percentages at your own risk.

cell_height=50

The minimum height of a table cell. Use this to "fill out" the empty spaces in your calendar. While not formal HTML (3.2 or 4.0), browsers will frequently honor the height attribute.

cellpadding=1
cellspacing=1

These can be used to change the look of your calendar by adjusting the internal spacing and padding of the table cells.

head_bgcolor=#cccccc
cell_bgcolor=#ffffff
event_bgcolor=#cccccc

Use the bgcolor directives above to change the background color of particular table cells without using a stylesheet. Note that this can cause your table to be unreadable under some circumstances. This can also cause your table to be unprintable on many printers.

It might be better to use a stylesheet instead. See http://www.w3.org/Style/CSS/ for more information.

Adding dates and events to the Calendar
Date lines begin with a four digit year, then a <tab>, the month, another <tab>, the day, yet another <tab> followed by the text of the event (including html tags, if desired). Use "Any" to specify an event which is valid for any year, month, or day of the month. Use ranges (ie 1998-2000 or 6-8) to specify a range of dates.

To specify an age for a person's birthday or an anniversary, add {%date=YYYY} to the event text. A person born in 1970 would need to use {%date=1970}.

The default configuration file comes filled with a lot of example dates. You can use these as a guide, but feel free to remove any or all of them if they don't serve your purposes.