]> git.deb.at Git - pkg/blosxom.git/blob - blosxom.cgi
Reverted the 1.24 change.
[pkg/blosxom.git] / blosxom.cgi
1 #!/usr/bin/perl
2
3 # Blosxom
4 # Author: Rael Dornfest <rael@oreilly.com>
5 # Version: 2.0.2
6 # Home/Docs/Licensing: http://blosxom.sourceforge.net/
7 # Development/Downloads: http://sourceforge.net/projects/blosxom
8
9 package blosxom;
10
11 # --- Configurable variables -----
12
13 # What's this blog's title?
14 $blog_title = "My Weblog";
15
16 # What's this blog's description (for outgoing RSS feed)?
17 $blog_description = "Yet another Blosxom weblog.";
18
19 # What's this blog's primary language (for outgoing RSS feed)?
20 $blog_language = "en";
21
22 # What's this blog's text encoding ?
23 $blog_encoding = "UTF-8";
24
25 # Where are this blog's entries kept?
26 $datadir = "/Library/WebServer/Documents/blosxom";
27
28 # What's my preferred base URL for this blog (leave blank for automatic)?
29 $url = "";
30
31 # Should I stick only to the datadir for items or travel down the
32 # directory hierarchy looking for items?  If so, to what depth?
33 # 0 = infinite depth (aka grab everything), 1 = datadir only, n = n levels down
34 $depth = 0;
35
36 # How many entries should I show on the home page?
37 $num_entries = 40;
38
39 # What file extension signifies a blosxom entry?
40 $file_extension = "txt";
41
42 # What is the default flavour?
43 $default_flavour = "html";
44
45 # Should I show entries from the future (i.e. dated after now)?
46 $show_future_entries = 0;
47
48 # --- Plugins (Optional) -----
49
50 # File listing plugins blosxom should load (if empty blosxom will walk $plugin_dir)
51 $plugin_list = "";
52
53 # Where are my plugins kept?
54 $plugin_dir = "";
55
56 # Where should my modules keep their state information?
57 $plugin_state_dir = "$plugin_dir/state";
58
59 # --- Static Rendering -----
60
61 # Where are this blog's static files to be created?
62 $static_dir = "/Library/WebServer/Documents/blog";
63
64 # What's my administrative password (you must set this for static rendering)?
65 $static_password = "";
66
67 # What flavours should I generate statically?
68 @static_flavours = qw/html rss/;
69
70 # Should I statically generate individual entries?
71 # 0 = no, 1 = yes
72 $static_entries = 0;
73
74 # --------------------------------
75
76 use vars qw! $version $blog_title $blog_description $blog_language $blog_encoding $datadir $url %template $template $depth $num_entries $file_extension $default_flavour $static_or_dynamic $config_dir $plugin_list $plugin_dir $plugin_state_dir @plugins %plugins $static_dir $static_password @static_flavours $static_entries $path_info $path_info_yr $path_info_mo $path_info_da $path_info_mo_num $flavour $static_or_dynamic %month2num @num2month $interpolate $entries $output $header $show_future_entries %files %indexes %others !;
77
78 use strict;
79 use FileHandle;
80 use File::Find;
81 use File::stat;
82 use Time::localtime;
83 use Time::Local;
84 use CGI qw/:standard :netscape/;
85
86 $version = "2.0.2";
87
88 # Load configuration from $ENV{BLOSXOM_CONFIG_DIR}/blosxom.conf, if it exists
89 my $blosxom_config;
90 if ($ENV{BLOSXOM_CONFIG_FILE} && -r $ENV{BLOSXOM_CONFIG_FILE}) {
91   $blosxom_config = $ENV{BLOSXOM_CONFIG_FILE};
92   ($config_dir = $blosxom_config) =~ s! / [^/]* $ !!x;                          
93 }
94 else {
95   for my $blosxom_config_dir ($ENV{BLOSXOM_CONFIG_DIR}, '/etc/blosxom', '/etc') {
96     if (-r "$blosxom_config_dir/blosxom.conf") {
97       $config_dir = $blosxom_config_dir;
98       $blosxom_config = "$blosxom_config_dir/blosxom.conf";
99       last;
100     }
101   }
102 }
103 # Load $blosxom_config
104 if ($blosxom_config) { 
105   if (-r $blosxom_config) {
106     eval { require $blosxom_config } or
107       warn "Error reading blosxom config file '$blosxom_config'" . ($@ ? ": $@" : '');
108   }
109   else {
110     warn "Cannot find or read blosxom config file '$blosxom_config'";
111   }
112 }
113
114 my $fh = new FileHandle;
115
116 %month2num = (nil=>'00', Jan=>'01', Feb=>'02', Mar=>'03', Apr=>'04', May=>'05', Jun=>'06', Jul=>'07', Aug=>'08', Sep=>'09', Oct=>'10', Nov=>'11', Dec=>'12');
117 @num2month = sort { $month2num{$a} <=> $month2num{$b} } keys %month2num;
118
119 # Use the stated preferred URL or figure it out automatically
120 $url ||= url(-path_info => 1);
121 $url =~ s/^included:/http:/ if $ENV{SERVER_PROTOCOL} eq 'INCLUDED';
122
123 # NOTE: Since v3.12, it looks as if CGI.pm misbehaves for SSIs and
124 # always appends path_info to the url. To fix this, we always
125 # request an url with path_info, and always remove it from the end of the
126 # string.
127 my $pi_len = length $ENV{PATH_INFO};
128 my $might_be_pi = substr($url, -$pi_len);
129 substr($url, -length $ENV{PATH_INFO}) = '' if $might_be_pi eq $ENV{PATH_INFO};
130
131 $url =~ s!/$!!;
132
133 # Drop ending any / from dir settings
134 $datadir =~ s!/$!!; $plugin_dir =~ s!/$!!; $static_dir =~ s!/$!!;
135   
136 # Fix depth to take into account datadir's path
137 $depth and $depth += ($datadir =~ tr[/][]) - 1;
138
139 # Global variable to be used in head/foot.{flavour} templates
140 $path_info = '';
141
142 $static_or_dynamic = (!$ENV{GATEWAY_INTERFACE} and param('-password') and $static_password and param('-password') eq $static_password) ? 'static' : 'dynamic';
143 $static_or_dynamic eq 'dynamic' and param(-name=>'-quiet', -value=>1);
144
145 # Path Info Magic
146 # Take a gander at HTTP's PATH_INFO for optional blog name, archive yr/mo/day
147 my @path_info = split m{/}, path_info() || param('path'); 
148 shift @path_info;
149
150 while ($path_info[0] and $path_info[0] =~ /^[a-zA-Z].*$/ and $path_info[0] !~ /(.*)\.(.*)/) { $path_info .= '/' . shift @path_info; }
151
152 # Flavour specified by ?flav={flav} or index.{flav}
153 $flavour = '';
154
155 if ( $path_info[$#path_info] =~ /(.+)\.(.+)$/ ) {
156   $flavour = $2;
157   $1 ne 'index' and $path_info .= "/$1.$2";
158   pop @path_info;
159 } else {
160   $flavour = param('flav') || $default_flavour;
161 }
162
163 # Strip spurious slashes
164 $path_info =~ s!(^/*)|(/*$)!!g;
165
166 # Date fiddling
167 ($path_info_yr,$path_info_mo,$path_info_da) = @path_info;
168 $path_info_mo_num = $path_info_mo ? ( $path_info_mo =~ /\d{2}/ ? $path_info_mo : ($month2num{ucfirst(lc $path_info_mo)} || undef) ) : undef;
169
170 # Define standard template subroutine, plugin-overridable at Plugins: Template
171 $template = 
172   sub {
173     my ($path, $chunk, $flavour) = @_;
174
175     do {
176       return join '', <$fh> if $fh->open("< $datadir/$path/$chunk.$flavour");
177     } while ($path =~ s/(\/*[^\/]*)$// and $1);
178
179     # Check for definedness, since flavour can be the empty string
180     if (defined $template{$flavour}{$chunk}) {
181         return $template{$flavour}{$chunk};
182     } elsif (defined $template{error}{$chunk}) {
183         return $template{error}{$chunk} 
184     } else {
185         return '';
186     }
187   };
188 # Bring in the templates
189 %template = ();
190 while (<DATA>) {
191   last if /^(__END__)$/;
192   my($ct, $comp, $txt) = /^(\S+)\s(\S+)(?:\s(.*))?$/ or next;
193   $txt =~ s/\\n/\n/mg;
194   $template{$ct}{$comp} .= $txt . "\n";
195 }
196
197 # Plugins: Start
198 my @plugin_list = ();
199
200 # If $plugin_list is set, read plugins to use from that file
201 $plugin_list = "$config_dir/$plugin_list"
202   if $plugin_list && $plugin_list !~ m!^\s*/!;
203 if ( $plugin_list and -r $plugin_list and $fh->open("< $plugin_list") ) {
204   @plugin_list = map { chomp $_; $_ } grep { /\S/ && ! /^#/ } <$fh>; 
205   $fh->close;
206 }
207 # Otherwise walk $plugin_dir to get list of plugins to use
208 elsif ( $plugin_dir and opendir PLUGINS, $plugin_dir ) {
209   @plugin_list = grep { /^[\w:]+$/ && ! /~$/ && -f "$plugin_dir/$_" } sort readdir(PLUGINS);
210   closedir PLUGINS;
211 }
212
213 unshift @INC, $plugin_dir;
214 foreach my $plugin ( @plugin_list ) {
215   my($plugin_name, $off) = $plugin =~ /^\d*([\w:]+?)(_?)$/;
216   my $on_off = $off eq '_' ? -1 : 1;
217   # Allow perl module plugins
218   if ($plugin =~ m/::/ && -z "$plugin_dir/$plugin") {
219     # For Blosxom::Plugin::Foo style plugins, we need to use a string require
220     eval "require $plugin_name";
221   }
222   else {
223     eval { require $plugin };
224   }
225   $@ and warn "error finding or loading blosxom plugin $plugin_name - skipping\n" and next;
226   $plugin_name->start() and ( $plugins{$plugin_name} = $on_off ) and push @plugins, $plugin_name;
227 }
228 shift @INC;
229
230 # Plugins: Template
231 # Allow for the first encountered plugin::template subroutine to override the
232 # default built-in template subroutine
233 my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('template') and defined($tmp = $plugin->template()) and $template = $tmp and last; }
234
235 # Provide backward compatibility for Blosxom < 2.0rc1 plug-ins
236 sub load_template {
237   return &$template(@_);
238 }
239
240 # Define default entries subroutine
241 $entries =
242   sub {
243     my(%files, %indexes, %others);
244     find(
245       sub {
246         my $d; 
247         my $curr_depth = $File::Find::dir =~ tr[/][]; 
248         return if $depth and $curr_depth > $depth; 
249      
250         if ( 
251           # a match
252           $File::Find::name =~ m!^$datadir/(?:(.*)/)?(.+)\.$file_extension$!
253           # not an index, .file, and is readable
254           and $2 ne 'index' and $2 !~ /^\./ and (-r $File::Find::name)
255         ) {
256
257             # to show or not to show future entries
258             ( 
259               $show_future_entries
260               or stat($File::Find::name)->mtime < time 
261             )
262
263               # add the file and its associated mtime to the list of files
264               and $files{$File::Find::name} = stat($File::Find::name)->mtime
265
266                 # static rendering bits
267                 and (
268                   param('-all') 
269                   or !-f "$static_dir/$1/index." . $static_flavours[0]
270                   or stat("$static_dir/$1/index." . $static_flavours[0])->mtime < stat($File::Find::name)->mtime
271                 )
272                   and $indexes{$1} = 1
273                     and $d = join('/', (nice_date($files{$File::Find::name}))[5,2,3])
274   
275                       and $indexes{$d} = $d
276                         and $static_entries and $indexes{ ($1 ? "$1/" : '') . "$2.$file_extension" } = 1
277
278             } 
279             else {
280               !-d $File::Find::name and -r $File::Find::name and $others{$File::Find::name} = stat($File::Find::name)->mtime
281             }
282       }, $datadir
283     );
284
285     return (\%files, \%indexes, \%others);
286   };
287
288 # Plugins: Entries
289 # Allow for the first encountered plugin::entries subroutine to override the
290 # default built-in entries subroutine
291 my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('entries') and defined($tmp = $plugin->entries()) and $entries = $tmp and last; }
292
293 my ($files, $indexes, $others) = &$entries();
294 %indexes = %$indexes;
295
296 # Static
297 if (!$ENV{GATEWAY_INTERFACE} and param('-password') and $static_password and param('-password') eq $static_password) {
298
299   param('-quiet') or print "Blosxom is generating static index pages...\n";
300
301   # Home Page and Directory Indexes
302   my %done;
303   foreach my $path ( sort keys %indexes) {
304     my $p = '';
305     foreach ( ('', split /\//, $path) ) {
306       $p .= "/$_";
307       $p =~ s!^/!!;
308       $done{$p}++ and next;
309       (-d "$static_dir/$p" or $p =~ /\.$file_extension$/) or mkdir "$static_dir/$p", 0755;
310       foreach $flavour ( @static_flavours ) {
311         my $content_type = (&$template($p,'content_type',$flavour));
312         $content_type =~ s!\n.*!!s;
313         my $fn = $p =~ m!^(.+)\.$file_extension$! ? $1 : "$p/index";
314         param('-quiet') or print "$fn.$flavour\n";
315         my $fh_w = new FileHandle "> $static_dir/$fn.$flavour" or die "Couldn't open $static_dir/$p for writing: $!";  
316         $output = '';
317         if ($indexes{$path} == 1) {
318           # category
319           $path_info = $p;
320           # individual story
321           $path_info =~ s!\.$file_extension$!\.$flavour!;
322           print $fh_w &generate('static', $path_info, '', $flavour, $content_type);
323         } else {
324           # date
325           local ($path_info_yr,$path_info_mo,$path_info_da, $path_info) = 
326               split /\//, $p, 4;
327           unless (defined $path_info) {$path_info = ""};
328           print $fh_w &generate('static', '', $p, $flavour, $content_type);
329         }
330         $fh_w->close;
331       }
332     }
333   }
334 }
335
336 # Dynamic
337 else {
338   my $content_type = (&$template($path_info,'content_type',$flavour));
339   $content_type =~ s!\n.*!!s;
340
341   $header = {-type=>$content_type};
342
343   print generate('dynamic', $path_info, "$path_info_yr/$path_info_mo_num/$path_info_da", $flavour, $content_type);
344 }
345
346 # Plugins: End
347 foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('end') and $entries = $plugin->end() }
348
349 # Generate 
350 sub generate {
351   my($static_or_dynamic, $currentdir, $date, $flavour, $content_type) = @_;
352
353   %files = %$files; %others = ref $others ? %$others : ();
354
355   # Plugins: Filter
356   foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('filter') and $entries = $plugin->filter(\%files, \%others) }
357
358   my %f = %files;
359
360   # Plugins: Skip
361   # Allow plugins to decide if we can cut short story generation
362   my $skip; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('skip') and defined($tmp = $plugin->skip()) and $skip = $tmp and last; }
363   
364   # Define default interpolation subroutine
365   $interpolate = 
366     sub {
367       package blosxom;
368       my $template = shift;
369       $template =~ 
370         s/(\$\w+(?:::)?\w*)/"defined $1 ? $1 : ''"/gee;
371       return $template;
372     };  
373
374   unless (defined($skip) and $skip) {
375
376     # Plugins: Interpolate
377     # Allow for the first encountered plugin::interpolate subroutine to 
378     # override the default built-in interpolate subroutine
379     my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('interpolate') and defined($tmp = $plugin->interpolate()) and $interpolate = $tmp and last; }
380         
381     # Head
382     my $head = (&$template($currentdir,'head',$flavour));
383   
384     # Plugins: Head
385     foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('head') and $entries = $plugin->head($currentdir, \$head) }
386   
387     $head = &$interpolate($head);
388   
389     $output .= $head;
390     
391     # Stories
392     my $curdate = '';
393     my $ne = $num_entries;
394
395     if ( $currentdir =~ /(.*?)([^\/]+)\.(.+)$/ and $2 ne 'index' ) {
396       $currentdir = "$1$2.$file_extension";
397       $files{"$datadir/$1$2.$file_extension"} and %f = ( "$datadir/$1$2.$file_extension" => $files{"$datadir/$1$2.$file_extension"} );
398     } 
399     else { 
400       $currentdir =~ s!/index\..+$!!;
401     }
402
403     # Define a default sort subroutine
404     my $sort = sub {
405       my($files_ref) = @_;
406       return sort { $files_ref->{$b} <=> $files_ref->{$a} } keys %$files_ref;
407     };
408   
409     # Plugins: Sort
410     # Allow for the first encountered plugin::sort subroutine to override the
411     # default built-in sort subroutine
412     my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('sort') and defined($tmp = $plugin->sort()) and $sort = $tmp and last; }
413   
414     foreach my $path_file ( &$sort(\%f, \%others) ) {
415       last if $ne <= 0 && $date !~ /\d/;
416       use vars qw/ $path $fn /;
417       ($path,$fn) = $path_file =~ m!^$datadir/(?:(.*)/)?(.*)\.$file_extension!;
418   
419       # Only stories in the right hierarchy
420       $path =~ /^$currentdir/ or $path_file eq "$datadir/$currentdir" or next;
421   
422       # Prepend a slash for use in templates only if a path exists
423       $path &&= "/$path";
424
425       # Date fiddling for by-{year,month,day} archive views
426       use vars qw/ $dw $mo $mo_num $da $ti $yr $hr $min $hr12 $ampm $utc_offset/;
427       ($dw,$mo,$mo_num,$da,$ti,$yr,$utc_offset) = nice_date($files{"$path_file"});
428       ($hr,$min) = split /:/, $ti;
429       ($hr12, $ampm) = $hr >= 12 ? ($hr - 12,'pm') : ($hr, 'am'); 
430       $hr12 =~ s/^0//; $hr12 == 0 and $hr12 = 12;
431   
432       # Only stories from the right date
433       my($path_info_yr,$path_info_mo_num, $path_info_da) = split /\//, $date;
434       next if $path_info_yr && $yr != $path_info_yr; last if $path_info_yr && $yr < $path_info_yr; 
435       next if $path_info_mo_num && $mo ne $num2month[$path_info_mo_num];
436       next if $path_info_da && $da != $path_info_da; last if $path_info_da && $da < $path_info_da; 
437   
438       # Date 
439       my $date = (&$template($path,'date',$flavour));
440       
441       # Plugins: Date
442       foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('date') and $entries = $plugin->date($currentdir, \$date, $files{$path_file}, $dw,$mo,$mo_num,$da,$ti,$yr) }
443   
444       $date = &$interpolate($date);
445   
446       $curdate ne $date and $curdate = $date and $output .= $date;
447       
448       use vars qw/ $title $body $raw /;
449       if (-f "$path_file" && $fh->open("< $path_file")) {
450         chomp($title = <$fh>);
451         chomp($body = join '', <$fh>);
452         $fh->close;
453         $raw = "$title\n$body";
454       }
455       my $story = (&$template($path,'story',$flavour));
456   
457       # Plugins: Story
458       foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('story') and $entries = $plugin->story($path, $fn, \$story, \$title, \$body) }
459       
460       if ($content_type =~ m{\bxml\b}) {
461         # Escape <, >, and &, and to produce valid RSS
462         my %escape = ('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;');  
463         my $escape_re  = join '|' => keys %escape;
464         $title =~ s/($escape_re)/$escape{$1}/g;
465         $body =~ s/($escape_re)/$escape{$1}/g;
466       }
467   
468       $story = &$interpolate($story);
469     
470       $output .= $story;
471       $fh->close;
472   
473       $ne--;
474     }
475   
476     # Foot
477     my $foot = (&$template($currentdir,'foot',$flavour));
478   
479     # Plugins: Foot
480     foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('foot') and $entries = $plugin->foot($currentdir, \$foot) }
481   
482     $foot = &$interpolate($foot);
483     $output .= $foot;
484
485     # Plugins: Last
486     foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('last') and $entries = $plugin->last() }
487
488   } # End skip
489
490   # Finally, add the header, if any and running dynamically
491   $static_or_dynamic eq 'dynamic' and $header and $output = header($header) . $output;
492   
493   $output;
494 }
495
496
497 sub nice_date {
498   my($unixtime) = @_;
499   
500   my $c_time = ctime($unixtime);
501   my($dw,$mo,$da,$hr,$min,$yr) = ( $c_time =~ /(\w{3}) +(\w{3}) +(\d{1,2}) +(\d{2}):(\d{2}):\d{2} +(\d{4})$/ );
502   $ti="$hr:$min";
503   $da = sprintf("%02d", $da);
504   my $mo_num = $month2num{$mo};
505
506   my $offset = timegm(00, $min, $hr, $da, $mo_num-1, $yr-1900)-$unixtime;  
507   my $utc_offset = sprintf("%+03d", int($offset / 3600)).sprintf("%02d", ($offset % 3600)/60) ;
508
509   return ($dw,$mo,$mo_num,$da,$ti,$yr,$utc_offset);
510 }
511
512
513 # Default HTML and RSS template bits
514 __DATA__
515 html content_type text/html
516
517 html head <html>
518 html head     <head>
519 html head         <meta http-equiv="content-type" content="text/html;charset=$blog_encoding" />
520 html head         <link rel="alternate" type="type="application/rss+xml" title="RSS" href="$url/index.rss" />
521 html head         <title>$blog_title $path_info_da $path_info_mo $path_info_yr
522 html head         </title>
523 html head     </head>
524 html head     <body>
525 html head         <center>
526 html head             <font size="+3">$blog_title</font><br />
527 html head             $path_info_da $path_info_mo $path_info_yr
528 html head         </center>
529 html head         <p />
530
531 html story        <p>
532 html story            <a name="$fn"><b>$title</b></a><br />
533 html story            $body<br />
534 html story            <br />
535 html story            posted at: $ti | path: <a href="$url$path">$path </a> | <a href="$url/$yr/$mo_num/$da#$fn">permanent link to this entry</a>
536 html story        </p>
537
538 html date         <h3>$dw, $da $mo $yr</h3>
539
540 html foot
541 html foot         <p />
542 html foot         <center>
543 html foot             <a href="http://blosxom.sourceforge.net/"><img src="http://blosxom.sourceforge.net/images/pb_blosxom.gif" border="0" /></a>
544 html foot         </center>
545 html foot     </body>
546 html foot </html>
547
548 rss content_type text/xml
549
550 rss head <?xml version="1.0" encoding="$blog_encoding"?>
551 rss head <rss version="2.0">
552 rss head   <channel>
553 rss head     <title>$blog_title</title>
554 rss head     <link>$url/$path_info</link>
555 rss head     <description>$blog_description</description>
556 rss head     <language>$blog_language</language>
557 rss head     <docs>http://blogs.law.harvard.edu/tech/rss</docs>
558 rss head     <generator>blosxom/$version</generator>
559
560 rss story   <item>
561 rss story     <title>$title</title>
562 rss story     <pubDate>$dw, $da $mo $yr $ti:00 $utc_offset</pubDate>
563 rss story     <link>$url/$yr/$mo_num/$da#$fn</link>
564 rss story     <category>$path</category>
565 rss story     <guid isPermaLink="false">$path/$fn</guid>
566 rss story     <description>$body</description>
567 rss story   </item>
568
569 rss date 
570
571 rss foot   </channel>
572 rss foot </rss>
573
574 error content_type text/html
575
576 error head <html>
577 error head <body>
578 error head     <p><font color="red">Error: I'm afraid this is the first I've heard of a "$flavour" flavoured Blosxom.  Try dropping the "/+$flavour" bit from the end of the URL.</font></p>
579
580
581 error story <p><b>$title</b><br />
582 error story $body <a href="$url/$yr/$mo_num/$da#fn.$default_flavour">#</a></p>
583
584 error date <h3>$dw, $da $mo $yr</h3>
585
586 error foot     </body>
587 error foot </html>
588 __END__