Linking Calendar Dates: Advanced Example
This example is based around a WebCam Archive I created some time ago . The reason I originally wrote the PHP Calendar class was because I wanted a way of easily navigating through the WebCam Archive. The problem here is that not all days have images stored against them. I wanted it to be obvious from the calendar which days had images and which days didn't.
The WebCam images are stored in a set of directories. Each directory
has a name of the form yyyymmdd
. For example, images for
the 3rd February 2001
would be stored in a directory called 20010203.
A simple
way to determine whether any images exist for a give day is to check whether
a directory of the appropriate name exists - if it does, then we have
some images.
The link returned by the getDateLink
function also will
vary depending on the date chosen. In this case, it simply tags some parameters
onto the end of the current url.