--- entriescache 2003-11-19 17:27:21.000000000 -0800
+++ entriescache_purple 2003-11-20 10:11:23.000000000 -0800
@@ -1,8 +1,13 @@
# Blosxom Plugin: entries_cache
# Author(s): Fletcher T. Penney
-# Version: 0.61
+# Version: 0.61p
# Based on entries_index by Rael Dornfest
-package entriescache;
+
+# Revised by Eugene Eric Kim to support
+# PurpleWiki-style metadata. See:
+# http://www.eekim.com/blog/tech/blosxom/purple/metadata.html
+
+package entriescache_purple;
# --- Configurable variables -----
@@ -24,21 +29,20 @@
$use_UK_dates = 0; # Default is mm/dd/yy (US)
# Set to 1 to use dd/mm/yy (UK)
+# --------------------------------
+
$update_meta_date = 0; # Add a meta_date tag if it doesn't exist
# This will require that perl has write access to your story files...
+ # NOTE: Moved out of configuration section; don't use this feature!
# The default meta-keywords are compatible with Eric Sherman's
# entries_index_tagged defaults
-# timestamp_tag is the non-human readable date stamp format
-# used by entries_index, entries_cache, entries_index_tagged, and blosxom
-$meta_timestamp = "meta-creation_timestamp:" unless defined $meta_timestamp;
-
# date_tag is a human readable version
+# NOTE: I moved this variable out of the configuration section. It's
+# important that it's defined, but its actual value doesn't matter.
$meta_date = "meta-creation_date:" unless defined $meta_date;
-# --------------------------------
-
use File::stat;
use File::Find;
use CGI qw/:standard/;
@@ -190,13 +194,7 @@
open (FILE, $file);
while ($line = ) {
- if ($line =~ /^$meta_timestamp\s*(\d+)/) {
- # If present, this format is used
- close File;
- return $1;
- }
-
- if ($line =~ /^$meta_date\s*(.*)/) {
+ if ($line =~ /^\{date\s*(.*)\}$/) {
close File;
return parsedate($1);
}
@@ -317,10 +315,12 @@
=head1 NAME
-Blosxom Plug-in: entries_cache
+Blosxom Plug-in: entriescache_purple
=head1 SYNOPSIS
+entriescache_purple is a very slightly modified version of entriescache. It's functionally the same, except instead of meta tags, it uses PurpleWiki-style metadata.
+
The entries_cache plugin is a "souped-up" version of the entries_index plugin. It maintains file modification times in the same manner as the original plugin, but goes one step further. It uses the modification time of the index file to determine whether to rescan the datadir. If $delay minutes have not passed, it relies on the cached information.
The original blosxom and, if I read the code properly, the entries_index plugin rescan the datadir each time a page is viewed. This plugin allows you to cache the information to speed up processing times on most page views. According to several posts on the blosxom mailing list, this is one of the big processor hogs. With a $delay setting of 60 minutes, there will only be one page view each hour that has to wait for the full directory scan.
@@ -332,10 +332,12 @@
=head1 VERSION
-0.61
+0.61p
=head1 VERSION HISTORY
+0.61p Replaced meta-tags with PurpleWiki-style metadata.
+
0.61 Fixed bug reading old styled cache files
0.6 Added feature to automatically create meta-tags from indexed