Movable Type: Calendar using PHP to autodetect date
published 12/31/02, which highlights
that date rather than todays actual date.
Modification on the default-templates and Dawn's php calendar tutorial.
This calendar is something that has been requested repeatedly on the forums, with a date that changes colors based on date rather than rebuild date (while in the same month). You are welcome to use it on your site (a linkback to blogstyles.com would be welcomed but not required).
Instructions and requirements for use:
- The calendar uses PHP for the rotating colors and the highlight of today's cell, and so the page it is on should be saved with a .php extension.
- This will work for highlighting a cell within the current month. So you'll want to rebuild at least once a month for this to work well.
- It is highly recommended that this calendar be created in a new Index Template (with an output filename of something like calendar.php) and then included with PHP into your pages. This will cut down the rebuild time substantially.
A sample of php include code follows -
<? include('/home/USERNAME/public_html/blogdirectory/calendar.php'); ?>
The code used to create this calendar is shown below (the links point to entries on my journal, kadyellebee.com. The CSS has comments for what the different classes do. You can view the source of this page to see how the calendar looks in its full format instead of just the MT tags.
If you have questions, you can post your questions on the MT forums. Good luck!