#!/usr/local/bin/perl -w $conf = 'logs.conf'; open(CONF, "$conf"); @data = ; close(CONF); chomp @data; foreach $field (@data) { ($key, $value) = split(/: */, $field); $INFO{$key} = $value; } $title = $INFO{'title'}; $prefix = $INFO{'prefix'}; $logdir = 'logs/'; $first = $INFO{'first'}; $comment = $INFO{'comment'}; $background = $INFO{'background'}; $textcolor = $INFO{'textcolor'}; $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'}; $tableborder = $INFO{'tableborder'}; $back = $INFO{'back'}; $backwidth = $INFO{'backwidth'}; $backheight = $INFO{'backheight'}; $backurl = $INFO{'backurl'}; $epilogs = $INFO{'epilogs'}; $chapters = $INFO{'chapters'}; @chapters =split(/=/,$chapters); $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"); print < $title - Game Logs
$title

HEADEREND ; if (defined($comment) == 1) { print "

$comment

"; } print <
TABLE ; if (defined($first) == 1) { $num = $first; $num--; } else { $num = 0; } 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; } $lognum = 0; foreach $log (@dates) { if ($log =~ /_/) { $num++; foreach $chapter (@chapters) { if ($INFO{$chapter} =~ $log) { open (CHAPTER, $chapter); @chaptertext = ; close(CHAPTER); print "\n"; } } @logdate =split(/_/,$log); $month = $MONTHS{$logdate[0]}; $day = $logdate[1]; $year = $YEARS{$logdate[2]}; print "\n"; $lognum++; } else { open(STORY, $log); @storystring = ; close(STORY); print "\n"; $lognum++; } } print <

@chaptertext
Episode #$num
$month $day, $year
$INFO{$log}
All logs and stories © 1995-2004 World of Terath Gaming Group

FOOTEREND