Here's the complete text for the download you were just reading about. For those that hate to read documentation, here's a link to DOWNLOAD num_dayz 0.6.
To return to the Downloads page, click the button at left.
num_dayz 0.6
Blosxom normally displays the most recent $num_entries
posts (5 entries, 10 entries, 100 entries); num_dayz displays posts from the most recent $num_days
days (3 days, 7 days, 30 days). The maximum number of posts that will be displayed is still set by $num_entries
. The plugin can detect whether you're sorting by ascending or descending date.
num_dayz has two settings: $num_days
sets the number of days' entries to display; the $now_mode
flag sets whether $num_days
is counted from the most recent entry ($now_mode=0
), or is counted from right now ($now_mode=1
). No matter what settings are used, num_dayz always displays at least one entry.
Installing num_dayz
To install num_dayz, just drop the file into your Blosxom plugins folder. That's it. Depending on what other plugins you're using, you may need to force num_dayz to load before other plugins; prepend its file name with "00" and you'll be O.K.
Locate the num_dayz plugin you downloaded; open the file and enter the two Configuration values; save the file with unix line ends. Upload or drop the num_dayz file into your blosxom plugins folder. Blog on.
Configuring num_dayz
There are two configuration variables to set in num_dayz:
$num_days
sets the number of days' entries to display; enter any integer larger than zero (e.g.5
,30
, etc.)$now_mode
sets the starting point for counting days -- when set to0
, num_dayz starts counting days from the most recent entry; when set to1
, num_dayz starts counting days from the current date (i.e. from right now).
Even if no entries meet the requirements of the $num_days
and/or $now_mode
settings, num_dayz will alway display at least one entry.
Using num_dayz
With $now_mode
set to 0
(normal), num_dayz counts days from the newest post. For example, if today is the 20th, and you set $num_days
to count 5 days, and the most-recent entries in the blog are from the 18th and 14th, num_dayz will display entries for the 5 days from the 18th to the 13th. (That is, both posts mentioned above will display.)
When $now_mode
is set to 1
, num_dayz counts days from right now. That is, if today is the 20th, and you set $num_days
to count 5 days, and the most-recent entries in the blog are from the 18th and 14th, num_dayz will display entries for the 5 days from now (the 20th) to the 15th. (That is, only one of the posts mentioned above will display.)
If no posts meet the requirements of the $num_days
and $now_mode
settings, the plugin will display at least one entry.
num_dayz Compatibility
num_dayz takes a real slash-and-burn approach when limiting entries to the specified time range: blosxom still composes $num_entries
stories for the page; num_dayz just doesn't allow the "later" ones to display. This behavior won't win any efficiency contests, but it lets num_dayz work without changing blosxom's list of %files
, and that (should) mean that other plugins won't break. To save processor time, load num_dayz fairly early among plugins that use the story()
routine; I can name it 00num_dayz
and everything works fine.