I'm getting closer to getting the Boston Diaries public (for now, I'm using Apache's [1] mod_rewrite [2] to hide the fact that this still isn't an Apache module. One day … ) so I started work on getting the archive section to work.
Hypertext, weblogs and journals [3] Reorg [4] And then a long digression about hypertext [5] Under Consruction [6] Tumblers tumbling [7] Tumbling through Code [8] Substance, Structure and Style [9] Still blogging along [10] Over fifteen million pages right here … [11] But it could be more … [12] The Electric Talmud anyone? [13] XML Pointers [14] Collapsing tumblers [15] the days … [16]
It's tougher than I expected. I somewhat knew this the first time [17] I started talking about it (and ever since, see the Obligatory Sidebar Links). It's not really about the code, but about the design—how should I do it?
The problem I have is one of extreme flexibility here—the code allows me to display an entire year, [18] an entire month, [19] as well as a day [20] and even arbitrary range of days. (Florida Ghost Hunters) [21] If a person selects the archive of a month, she should then get a list of days, plus maybe the titles of each entry—yet if she picks a large enough range of months (say, six months) then that might get too large.
So then I'm thinking that if the number of days exceeds some threshhold (like, 60 days) then just list the months and days, and if it exceeds some larger threshhold (like 180 days) then just list the months.
But then, if someone selects something like seven months, two full days and a half day, then what? Perhaps I should just give what was asked for. Perhaps.
I identified thirteen specific cases to examine:
Specification What I should return nothing specified years only? y list months y/m list days and entries y/m/d list entries y- list months y-y list months y-y/m list months y-y/m/d ? y/m- list months y/m-y/m list months y/m-y/m/d ? y/m/d- ? y/m/d-y/m/d ?
[I should note that as I was doing the table, I originally had sixteen cases, but found out that three cases could not happen (which goes to show I don't even fully understand my own code) so I no longer have to worry about them.]
Entries are automatically archived, and displaying an arbitrary range works fine now; I want the archive list to work automatically too. I should be able to add new entries and have the computer do everything else for me. After all, isn't that what a computer is for?
[2] http://httpd.apache.org/docs/mod/mod_rewrite.html