The “monthlyThumb()” method works the same as the “monthly()” method, with three differences:
- It does not automatically display. You’ll need to echo its response.
- It watches for some form submissions so that it can switch from day to day or month to month.
- It does not display any events; it provides links on days that have events so that you can display them.
$month = $calendar->monthlyThumb(); echo $month;
If you’re going to put this on a heavily-visited page (such as your home page), you should cache the response and only recreate it every hour or so.
Responding to visitors
The thumbnail can switch to future months (and then go backwards from those future months). It also provides links on any date that has events.
The form variables it creates in its URLs are “calDate” and “month”. It also creates each of these within its links. It will watch for “month” on its own; that’s the number of months in the future to shift the calendar.
It is up to you to watch for "calDate” and display what you need it to display based on the date. The date is in the format “YYYY-M-D”, for example, 2009-5-24 for May 24, 2009.
Currently, it defaults to linking to the same folder that the calendar is on. There is no way to change this default. This shall most likely change.
Style sheets
The thumbnail has two extra classes, both applied to the table cell of a date.
- The class “busy” is applied to cells for which there are events on that day.
- The class “selected” is applied to the cell that is currently reflected in calDate.
