From 4c4780f4772acb5abcc57b03d114c5e1364af63a Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 14 Aug 2002 22:54:20 +0000 Subject: Create .meta files with the expiry date of pages. Also put the expiry date in HTML meta headers. Make indexfilebasename a configure option. Code cleanup: renamed some functions. --- Echolot/Thesaurus.pm | 49 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 43 deletions(-) (limited to 'Echolot/Thesaurus.pm') diff --git a/Echolot/Thesaurus.pm b/Echolot/Thesaurus.pm index fed040e..201258b 100644 --- a/Echolot/Thesaurus.pm +++ b/Echolot/Thesaurus.pm @@ -1,7 +1,7 @@ package Echolot::Thesaurus; # (c) 2002 Peter Palfrader -# $Id: Thesaurus.pm,v 1.10 2002/08/07 23:33:19 weasel Exp $ +# $Id: Thesaurus.pm,v 1.11 2002/08/14 22:54:20 weasel Exp $ # =pod @@ -19,7 +19,6 @@ This package provides necessary functions for the thesaurus. use strict; use Carp qw{cluck}; use English; -use HTML::Template; sub save_thesaurus($$$) { @@ -100,48 +99,12 @@ sub build_thesaurus() { my @data = map {$data->{$_}} (sort { $data->{$a}->{'nick'} cmp $data->{$b}->{'nick'} } keys (%$data)); - my $template = HTML::Template->new( - filename => Echolot::Config::get()->{'templates'}->{'thesaurusindexfile'}, - global_vars => 1 ); - $template->param ( remailers => \@data ); - $template->param ( CURRENT_TIMESTAMP => scalar gmtime() ); - $template->param ( SITE_NAME => Echolot::Config::get()->{'sitename'} ); - - my $file = Echolot::Config::get()->{'thesaurusindexfile'}; - open (F, ">$file") or - cluck ("Cannot open '$file': $!"), - return 0; - print F $template->output(); - close F; - - return; - - print F 'Thesaurus

Thesaurus

'."\n"; - print F "\n"; - - for my $addr (sort { $data->{$a}->{'nick'} cmp $data->{$b}->{'nick'} } keys (%$data)) { - printf F ''."\n", - $data->{$addr}->{'nick'}, - $addr, - defined ($data->{$addr}->{'conf'}) ? - sprintf('%s
%s
', $data->{$addr}->{'conf'}->{'href'}, $data->{$addr}->{'conf'}->{'date'}, - $data->{$addr}->{'conf'}->{'time'}) : 'N/A', - defined ($data->{$addr}->{'help'}) ? - sprintf('%s
%s
', $data->{$addr}->{'help'}->{'href'}, $data->{$addr}->{'help'}->{'date'}, - $data->{$addr}->{'help'}->{'time'}) : 'N/A', - defined ($data->{$addr}->{'key'}) ? - sprintf('%s
%s
', $data->{$addr}->{'key'}->{'href'}, $data->{$addr}->{'key'}->{'date'}, - $data->{$addr}->{'key'}->{'time'}) : 'N/A', - defined ($data->{$addr}->{'stats'}) ? - sprintf('%s
%s
', $data->{$addr}->{'stats'}->{'href'}, $data->{$addr}->{'stats'}->{'date'}, - $data->{$addr}->{'stats'}->{'time'}) : 'N/A', - defined ($data->{$addr}->{'adminkey'}) ? - sprintf('%s
%s
', $data->{$addr}->{'adminkey'}->{'href'}, $data->{$addr}->{'adminkey'}->{'date'}, - $data->{$addr}->{'adminkey'}->{'time'}) : 'N/A', - }; - print F '
nickAddressconfhelpkeystatsadminkey
%s%s%s%s%s%s%s
'; - close (F); + Echolot::Tools::write_HTML_file( + Echolot::Config::get()->{'thesaurusindexfile'}, + Echolot::Config::get()->{'templates'}->{'thesaurusindexfile'}, + Echolot::Config::get()->{'buildthesaurus'}, + remailers => \@data); }; -- cgit v1.2.3