#!/usr/local/bin/perl $conf = 'logs.conf'; open(CONF, "$conf"); @data = ; close(CONF); chomp @data; foreach $field (@data) { ($key, $value) = split(/: */, $field); $INFO{$key} = $value; } $logdir = 'logs/'; $loginfo = $ENV{QUERY_STRING}; @loginfo =split(/=/,$loginfo); $datecur = $loginfo[0]; $lognum = $loginfo[1]; $viewdate = $datecur; $viewdate =~ s/\_/\//g; $prefix = $INFO{'prefix'}; $title = $INFO{'title'}; $textcolor = $INFO{'textcolor'}; $background = $INFO{'background'}; $bgcolor = $INFO{'bgcolor'}; $linkcolor = $INFO{'linkcolor'}; $vlinkcolor = $INFO{'vlinkcolor'}; $alinkcolor = $INFO{'alinkcolor'}; $titleimage = $INFO{'titleimage'}; $titlewidth = $INFO{'titlewidth'}; $titleheight = $INFO{'titleheight'}; $titlealt = $INFO{'titlealt'}; $line = $INFO{'line'}; $linewidth = $INFO{'linewidth'}; $lineheight = $INFO{'lineheight'}; $previousimg = $INFO{'previousimg'}; $nextimg = $INFO{'nextimg'}; $back = $INFO{'back'}; $backwidth = $INFO{'backwidth'}; $backheight = $INFO{'backheight'}; $backurl = $INFO{'backurlview'}; $epilogs = $INFO{'epilogs'}; $years = $INFO{'years'}; @years =split(/=/,$years); %MONTHS = ("01","January","02","February","03","March","04","April","05","May","06","June","07","July","08","August","09","September","10","October","11","November","12","December"); %YEARS = ("94","1994","95","1995","96","1996","97","1997","98","1998","99","1999","00","2000","01","2001","02","2002","03","2003","04","2004","05","2005","06","2006","07","2007"); @date =split(/_/,$datecur); $month = $MONTHS{$date[0]}; $day = $date[1]; $year = $YEARS{$date[2]}; foreach $yeardir (sort @years) { opendir(DIR, $logdir . $yeardir) or die "Can't opendir $logdir . $yeardir: $!"; foreach $date (sort readdir(DIR)) { next if $date =~ /^\.\.?$/; $date =~ s/$prefix//; if (defined($INFO{$date}) == 1) { $stories = $INFO{$date}; @stories =split(/=/,$stories); push @dates, @stories; } push @dates, $date; } } if (defined($epilogs) == 1) { @epilogs =split(/=/,$epilogs); push @dates, @epilogs; } if ($lognum == -1) { $logprestr = ""; $lognextstr = ""; } else { $lognumpre = $lognum; $lognumpre--; $lognumnext = $lognum; $lognumnext++; $logpre = $dates[$lognumpre]; $lognext = $dates[$lognumnext]; if ($lognumpre == -1) { $logprestr = ""; } elsif ($logpre =~ /_/) { $logprestr = "Previous"; } else { $logprestr = "Previous"; } if (defined($lognext) == 0) { $lognextstr = ""; } elsif ($lognext =~ /_/) { $lognextstr = "Next"; } else { $lognextstr = "Next"; } } print <
$title

$month $day $year

$logprestr$lognextstr

Mail this log to:

HEADEREND ; $logname = $prefix . $datecur; $logpath = "logs/" . $year . "/" . $logname; open(LOG, $logpath); @log = ; close(LOG); chomp @log; foreach $logline (@log) { if ($logline eq "") { print "

\n"; } else { print "$logline "; } } print <


$logprestr$lognextstr

All logs © 1995-2004 World of Terath Gaming Group

FOOTEREND