Update: There are newer versions available; please use the newest version unless you have a particular reason not to.
Third plugin: calendar
This builds a calendar display of the current month. Days with articles are links to that day’s archive page; days without articles aren’t links.
- download it, and rename it “calendar”
- Stick it in your blosxoms plugin directory
- Look at the configuration variables; there’s probably not anything you’ll want to fiddle with, though.
- Add “$calendar::calendar” to your head.$flavour or tail.$flavour file
- Maybe add some things to your stylesheet
This uses Time::Local which I think has only been standard since perl 5.6.1. If you don’t have it, first let me know so I can judge how big an issue this is; then either install it, or edit the plugin: remove the use Time::Local; line, then find
# XXX this isn't quite right in the face of daylight savings time # $monthstart = $now - ($now[3]-1)*86400; $monthstart = timelocal(0,0,0,1,$month-1,$year-1900);
around line 100; uncomment the 2nd line and and comment the third.
Things that I’m considering for this
- add a year/month calendar for the current year
- add a list of years with articles
- add next/previous arrows to the month — also to the day? the UI for that isn’t clear
- when displaying old articles, display the calendar for that month, not the current one. I’m not sure that info is currently available to the plugins
- more output formats?
- anything else wanted/needed?
The stylesheet bits I’m using:
.calendar {}
.calendar_month_head {
font-size: 9pt;
font-weight: normal;
}
.calendar_day_head {
font-size: 7pt;
font-weight: normal;
}
.calendar_day_noday {}
.calendar_day_link {
text-align: right;
}
.calendar_day_nolink {
text-align: right;
}
Hey, maybe I’m just being dense, but how do you have the cool previous/next month thingy under your calendar. Is it something I can enable in the config files? Thanks
I found a bug in version 0+1i. In report_day_link(), if $month is < 10, the leading 0 is not prepended. As blosxom 2.0RC2 (it’s the only version I have tried) comes out of the box, it uses month numbers such as 01, 02, 03, etc.
I added this line right after the variable declaration in that subroutine:
$month = “0” . $month if length($month) < 2;
to fix the problem.
Thanks for making this plug-in available.
— Tommy
2 Responses