summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-08-10 01:36:47 +0000
committerPeter Palfrader <peter@palfrader.org>2002-08-10 01:36:47 +0000
commit0b94c34343aee2dfb449166f4884f16a71e3c7fe (patch)
tree7248e7742d43b40b8bc79bb135a7ea576e51ac46 /Echolot
parenteccb64b18dbc0c65e8b0a218b478d5bae73893a9 (diff)
Produce echolot.html, an index file for echolot resultsecholot-2.0beta25
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Config.pm3
-rw-r--r--Echolot/Stats.pm34
2 files changed, 24 insertions, 13 deletions
diff --git a/Echolot/Config.pm b/Echolot/Config.pm
index 9d818f9..ee15d58 100644
--- a/Echolot/Config.pm
+++ b/Echolot/Config.pm
@@ -1,7 +1,7 @@
package Echolot::Config;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Config.pm,v 1.34 2002/08/05 17:46:17 weasel Exp $
+# $Id: Config.pm,v 1.35 2002/08/10 01:36:47 weasel Exp $
#
=pod
@@ -137,6 +137,7 @@ sub init($) {
# templates
templates => {
+ 'indexfile' => 'templates/echolot.html',
'thesaurusindexfile' => 'templates/thesaurusindex.html',
'mlist' => 'templates/mlist.html',
'mlist2' => 'templates/mlist2.html',
diff --git a/Echolot/Stats.pm b/Echolot/Stats.pm
index 0311bf9..5d64f35 100644
--- a/Echolot/Stats.pm
+++ b/Echolot/Stats.pm
@@ -1,7 +1,7 @@
package Echolot::Stats;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Stats.pm,v 1.26 2002/08/10 00:56:24 weasel Exp $
+# $Id: Stats.pm,v 1.27 2002/08/10 01:36:47 weasel Exp $
#
=pod
@@ -273,28 +273,35 @@ sub read_file($;$) {
sub write_file($$;$) {
my ($filebasename, $html_template, $output) = @_;
- my $filename = $filebasename.'.txt';
- open(F, '>'.$filename) or
- cluck("Cannot open $filename: $!\n"),
- return 0;
- print F $output;
- close (F);
+ my $filename;
+ if (defined $output) {
+ $filename = $filebasename.'.txt';
+ open(F, '>'.$filename) or
+ cluck("Cannot open $filename: $!\n"),
+ return 0;
+ print F $output;
+ close (F);
+ };
return 1 unless defined $html_template;
- $output =~ s/&/&amp;/g;
- $output =~ s/"/&quot;/g;
- $output =~ s/</&lt;/g;
- $output =~ s/>/&gt;/g;
my $template = HTML::Template->new(
filename => $html_template,
strict => 0,
+ die_on_bad_params => 0,
global_vars => 1 );
- $template->param ( list => $output );
+ if (defined $output) {
+ $output =~ s/&/&amp;/g;
+ $output =~ s/"/&quot;/g;
+ $output =~ s/</&lt;/g;
+ $output =~ s/>/&gt;/g;
+ $template->param ( list => $output );
+ };
$template->param ( CURRENT_TIMESTAMP => scalar gmtime() );
$template->param ( SITE_NAME => Echolot::Config::get()->{'sitename'} );
$template->param ( seperate_rlist => Echolot::Config::get()->{'seperate_rlists'} );
$template->param ( combined_list => Echolot::Config::get()->{'combined_list'} );
+ $template->param ( thesaurus => Echolot::Config::get()->{'thesaurus'} );
$template->param ( version => Echolot::Globals::get()->{'version'} );
$filename = $filebasename.'.html';
@@ -557,6 +564,9 @@ sub build_lists() {
build_clist( $clist, $broken1, $broken2, $sameop, Echolot::Config::get()->{'private_resultdir'}.'/'.'clist', Echolot::Config::get()->{'templates'}->{'clist'});
build_clist( $pubclist, $broken1, $broken2, $sameop, Echolot::Config::get()->{'resultdir'}.'/'.'clist', Echolot::Config::get()->{'templates'}->{'clist'});
};
+
+
+ write_file(Echolot::Config::get()->{'resultdir'}.'/'.'echolot', Echolot::Config::get()->{'templates'}->{'indexfile'});
};