package Pisg::HTMLGenerator; # Copyright and license, as well as documentation(POD) for this module is # found at the end of the file. use strict; $^W = 1; sub new { my $type = shift; my %args = @_; my $self = { cfg => $args{cfg}, stats => $args{stats}, users => $args{users}, tmps => $args{tmps} }; # Import common functions in Pisg::Common require Pisg::Common; Pisg::Common->import(); bless($self, $type); return $self; } sub create_html { # This subroutine calls all the subroutines which create their # individual stats. The name of the functions is somewhat saying - if # you don't understand it, most subs have a better explanation in the # sub itself. my $self = shift; print "Now generating HTML($self->{cfg}->{outputfile})...\n" unless ($self->{cfg}->{silent}); open (OUTPUT, "> $self->{cfg}->{outputfile}") or die("$0: Unable to open outputfile($self->{cfg}->{outputfile}): $!\n"); if ($self->{cfg}->{show_time}) { $self->{cfg}->{tablewidth} += 40; } if ($self->{cfg}->{show_words}) { $self->{cfg}->{tablewidth} += 40; } if ($self->{cfg}->{show_wpl}) { $self->{cfg}->{tablewidth} += 40; } if ($self->{cfg}->{show_cpl}) { $self->{cfg}->{tablewidth} += 40; } $self->{cfg}->{headwidth} = $self->{cfg}->{tablewidth} - 4; $self->_htmlheader(); $self->_pageheader(); if ($self->{cfg}->{show_activetimes}) { $self->_activetimes(); } $self->_activenicks(); if ($self->{cfg}->{show_bignumbers}) { $self->_headline($self->_template_text('bignumtopic')); _html("