Explorar o código

Changed names of configuration options, updated docs, removed CONFIG-README
see the full list of changes in docs/Changelog

Morten Brix Pedersen %!s(int64=24) %!d(string=hai) anos
pai
achega
e87ea5ab8a
Modificáronse 9 ficheiros con 366 adicións e 667 borrados
  1. 1 2
      Makefile
  2. 3 3
      README
  3. 0 354
      docs/CONFIG-README
  4. 13 3
      docs/Changelog
  5. 214 214
      docs/pisg-doc.sgml
  6. 84 36
      modules/Pisg.pm
  7. 36 41
      modules/Pisg/HTMLGenerator.pm
  8. 8 8
      modules/Pisg/Parser/Logfile.pm
  9. 7 6
      pisg.cfg

+ 1 - 2
Makefile

@@ -14,8 +14,7 @@ FILES = pisg.pl \
 	 pisg.cfg \
 	 pisg.cfg \
 	 lang.txt
 	 lang.txt
 
 
-DOCS = docs/CONFIG-README \
-	 docs/FORMATS \
+DOCS = docs/FORMATS \
 	 docs/Changelog \
 	 docs/Changelog \
 	 docs/CREDITS \
 	 docs/CREDITS \
 	 docs/html/ \
 	 docs/html/ \

+ 3 - 3
README

@@ -9,6 +9,9 @@ this distribution in the 'docs' directory.
 
 
 SETTING UP PISG
 SETTING UP PISG
 ---------------
 ---------------
+Full documentation located in docs/pisg-doc.txt or docs/html/index.html for
+a HTML version. Quick explanation below:
+
 It's quite simple to set up pisg. You have 2 choices:
 It's quite simple to set up pisg. You have 2 choices:
 
 
  * Set settings from commandline (try pisg.pl --help)
  * Set settings from commandline (try pisg.pl --help)
@@ -17,9 +20,6 @@ It's quite simple to set up pisg. You have 2 choices:
 If you look in the example pisg.cfg, you will see a small working sample
 If you look in the example pisg.cfg, you will see a small working sample
 where you can insert your own data.
 where you can insert your own data.
 
 
-The most important things to set is the name of the logfile, the channel
-name, the format of your logfile and the maintainers name.
-
 The commandline version has the disadvantage that you can only set up one
 The commandline version has the disadvantage that you can only set up one
 channel to be run.
 channel to be run.
 
 

+ 0 - 354
docs/CONFIG-README

@@ -1,354 +0,0 @@
-README for pisg.cfg - the configuration file for pisg
-------------------
-This file is used for:
- - Setting user options (for user aliases, pics, ignores and links)
- - Setting up channel(s) to be parsed.
- - Setting pisg config options (for general things with pisg)
- - Word options (for adding words that are meant to be 'foul(bad) language')
-
-
-USER OPTIONS
-------------------
-User options are set with a simple SGML like syntax in the form:
-
-    <user nick="NICK" option="VALUE">
-
-Remember, the nick is always required.
-
-For example to add aliases to a nick, then you could do this:
-    <user nick="Joe" alias="Joe^*">
-
-The asterix (*) means that it will match all nicks starting with 'Joe^'. So
-it will add all Joe^'s to 'Joe' in the stats.
-
-Another thing you can do is to add a picture to a user:
-    <user nick="Ben" pic="ben_holiday.jpg">
-
-If you have a larger picture of the user as well, you can make the picture
-on the stats page link to it:
-    <user nick="Ben" pic="ben_holiday.jpg" bigpic="ben-big.jpg">
-
-You can also set a user's sex:
-    <user nick="Ben" sex="m">
-
-Also you can add links to URLs and e-mails:
-    <user nick="Christine" link="http://www.christine.com">
-
-    or
-
-    <user nick="Chris" link="chris@host.com">
-
-The last thing you can do is to ignore nicks (for example bots):
-    <user nick="nameofbot" ignore="y">
-
-You don't have to do all this in many lines, you could just as easily do:
-<user nick="Joe" alias="Joe^away Joe^work" pic="joe.jpg" link="joe@joe.com" sex="m">
-
-(Here the aliases is a space separated list of nicks, that also works! But *
-as a wildcard is smarter, but also slower).
-
-CHANNELS SETUP
-------------------
-
-For each of your channels which you want to parse through, you make
-something like this:
-
-<channel="#channel" logfile="channel.log">
- format = "mIRC"
- maintainer = "NameOfMaintainer"
-</channel>
-
-Any options in the <channel *> section will be forced, even over commandline
-options... any options before </channel> can be overridden from command line
-
-There is a lot of options which you can set between the <channel> and
-</channel> tags, these are listed in the next section.
-
-PISG OPTIONS
-------------------
-If you have multiple channels, then you can set some defaults for them, for
-example you can do.
-
-<set format="mIRC">
-
-And you won't have to worry about setting the format for every channel.
-
-You can also combine settings into one line such as:
-<set channel="#channel" logfile="/var/log/channel.log">
-
-All the different options are listed below.
-
-Other examples:
-<set lang='EN'>
-<set bgcolor="#dedeee" text="black" hbgcolor="#666699" hcolor="white" hicell="#BABADD" hicell2="#CCCCCC">
-<set show_voices="1" show_wpl="1">
-<set topichistory="3" timeoffset="+0">
-
-There is many options which can be set, here is a list of them all (not
-case sensitive):
-
---- The most useful ones ---
-
-channel             The name of your channel. E.g. '#mychannel'
-                    (default: unset)
-
-logfile             The exact filename of the logfile. E.g. 'mylog.log'
-                    (default: unset)
-
-logsuffix           Regexes to sort logfiles by in format month||day||year
-                    Note: example will work for eggdrop's default format
-                    Example: logsuffix="\.\d\d([A-Za-z]+)\d\d\d\d||\.(\d\d)[A-Za-z]+\d\d\d\d||\.\d\d[A-Za-z]+(\d\d\d\d)"
-                    (default: unset)
-
-format              The logfile format. See FORMATS file for supported formats
-
-network             Network the channel is using. E.g. 'Undernet'
-
-outputfile          Outputted stats goes to this HTML file.
-                    (default: index.html)
-
-maintainer          The maintainer or bot which makes the logfile.
-
-lang                Language to use (see lang.txt)
-                    EN | DE | DK | FR | ES | PL | PT | NO | NL | SE | EE | IT
-                    HU | SI | FI 
-
-pagehead            Some 'page header' file which you want to include in top
-                    of the output file.
-                    (default: none)
-
-pagefoot            Same as above, this is just the footer.
-                    (default: none)
-
-imagepath           If your user pictures is located in a special directory,
-                    set the path here. E.g. 'userpics/'
-                    (default: current directory)
-
-default_pic         If no picture defined for a user, use this default
-                    picture, good for example to display 'No picture
-                    available'.
-
-logdir              If you specify a path to a directory here, then pisg will
-                    run through the files in that directory, parse all
-                    logfiles in it and create 1 HTML file from it. Useful
-                    with eggdrops.
-
-prefix              Works when logdir is set, only analyze files in logdirs
-                    prefixed by xxx
-
-timeoffset          A time offset on the stats page - if your country has
-                    a different timezone than the machine where the stats
-                    are being generated, then for example set '+1' to add
-                    one hour to the stats.
-                    (default: +0)
-
-show_activetimes    1 or 0, this enables/disables the 'Most Active Times'
-                    section.
-                    (default: 1)
-
-show_bignumbers     1 or 0, enable/disable 'Big Numbers' and 'Other
-                    interesting numbers'.
-                    (default: 1)
-
-show_topics         1 or 0, enable/disable 'Latest topics'.
-                    (default: 1)
-
-show_wpl            1 or 0, this enables pisg to show 'words per line' for
-                    each person in 'most active nicks'
-                    (default: 0)
-
-show_cpl            Same as above, this is just 'characters per line'
-                    (default: 0)
-
-show_words          1 or 0, this will enable/disable both of the 2 above
-                    options.
-                    (default: 0)
-
-show_lastseen       1 or 0, display a column showing when the user was last
-                    on the channel (how many days ago)
-                    (default: 0)
-
-show_time           1 or 0, this will enable/disable the showing of the
-                    fancy timebars indicating when a nick was active.
-                    (default: 1)
-
-show_linetime       1 or 0, the same as above, except this will show the
-                    bar next to the number of lines like in mIRCStats
-                    (default: 0)
-
-show_randquote      1 or 0, this will enable or disable the random quote
-                    displayed in the "active nick list"
-                    (default: 1)
-
-show_legend         1 or 0, this will add a legend of the different time-
-                    bars.
-                    (default: 1)
-
-show_kickline       1 or 0, this will add an example-kickline to the
-                    "Most kicked"-stats
-                    (default: 1)
-
-show_actionline     1 or 0, this will add an example-actionline to the
-                    "Most actions"-stats
-                    (default: 1)
-
-show_shoutline      1 or 0, this will add an example-shoutline to the
-                    "Most shouting people"-stats
-                    (default: 1)
-
-show_violentlines   1 or 0, this will add an example-attack to the
-                    "Most aggressive" and "Most attacked"-stats
-                    (default: 1)
-
-show_muw            1 or 0, this will enable or disable the "most used
-                    words" list
-                    (default: 1)
-
-show_mrn            1 or 0, this will enable or disable the "most
-                    referenced nicks" list
-                    (default: 1)
-
-show_mru            1 or 0, this will enable or disable the "most
-                    referenced urls" list
-                    (default: 1)
-
-show_voices         1 or 0, this will enable or disable the voice statistics
-                    (those who got voice and those who voiced).
-                    (default: 0)
-
-show_mostnicks      1 or 0, this will enable or disble a list with "users
-                    who had most nicks" (those who changed nicks often),
-                    only works properly when nicktracking is set to 1
-                    (default: 0)
-
-ignorewords         A space separated list of words to ignore in 'most
-                    referenced words'
-                    (default: "")
-
-foul                Space separated list of words considered to be 'foul'
-                    language, look in the bottom for a better explanation.
-
-regexp_aliases      1 or 0, enabling this will make aliases in <user> tags
-                    regex-able.
-                    (default: 0)
-
-silent              1 or 0.  Enabling this will suppress all standard output
-                    from pisg.  Error messages will still be sent to STDOUT.
-                    (default: 0)
-
---- Colors / layout for your stats page ---
-
-bgcolor             Background color of the page
-bgpic               Background picture of the page
-text                Normal text color
-hbgcolor            Background color in headlines
-hcolor              Text color in headline
-hicell              Background color in highlighted cells
-hicell2             Background color in highlighted cells
-tdcolor             Color of text in tables
-tdtop               Top color in some tables.
-
-link                Color of links in tables
-vlink               Color of visited links in tables
-hlink               Color of hovered links in tables
-
-bg_link             Color of links on background
-bg_vlink            Color of visited links on background
-bg_hlink            Color of hovered links on background
-
-headline            Border color of headlines
-rankc               Colors of 'ranks' (1,2,3,4) and active times
-hi_rankc            Highlighted ranks
-
-pic_height          Hardcode user picture sizes on stats page. This is when
-                    user has a pic, and you want to make it smaller.
-pic_width
-
-pic_v_0             Below settings are the filenames of the images to be
-pic_v_6             shown on the page on timebars, the names should be
-pic_v_12            self-explainable.
-pic_v_18
-pic_h_0
-pic_h_6
-pic_h_12
-pic_h_18
-
-pic_loc             Directory containing your png graphics files.
-                    (default: current dir)
-
---- Less important things, useful for some people ---
-
-charset             Charset to use for stats page.
-                    (default: iso-8859-1)
-
-use_activetime_alt  Use an alternative way to highlight the number under the
-                    time bars, if set to 1, will highlight the hour in which
-                    the stats were generated.
-                    (default: 0)
-
-minquote            Minimal number of letters for a random quote
-                    (default: 25)
-
-maxquote            Maximum number of letters for a random quote
-                    (default: 65)
-
-wordlength          The minimum number of chars an interesting word may be
-                    in 'most used words'
-                    (default: 5)
-
-activenicks         Number of nicks to show in 'most active nicks'
-                    (default: 25)
-
-activenicks2        Nicks to show in 'these didn't make it...'
-                    (default: 30)
-
-topichistory        Maximum number of topics to show in 'latest topics'
-                    (default: 3)
-
-urlhistory          Maximum number of URLs to show in 'most referenced URLs'
-                    (default: 5)
-
-wordhistory         Maximum number of words to show in 'Most used words'
-                    (default: 10)
-
-nickhistory         Maximum number of nicks to show in 'Most referenced
-                    nicks'
-                    (default: 5)
-
-langfile            Filename of language file.
-                    (default: lang.txt)
-
-nicktracking        1 or 0, track nickchanges and create aliases?
-                    (default: 0)
-
-logtype             The type of logs kept for your channel.  Currently only
-                    "Logfile" is supported, so you don't need to change this
-                    option.
-
-
-WORD OPTIONS
-------------------
-pisg has the feature of making stats of people using "foul words" or bad
-language, like fuck, shit, etc. but this is something people would like to
-configure to their own language and slang.
-
-So this option configures which words which are considered to be "foul":
-
-<set foul="ass bitch fuck">
-
-Or in German:
-<set foul="scheisse scheiße kacke">
-
-pisg also recognizes that people may attack others in a variety of ways.
-The words that pisg considers to be attacks may be set with the "violent"
-option:
-
-<set violent="slaps beats kicks">
-
-Have fun configuring pisg! :)
-
-
-LINKS
-------------------
-It's possible to ignore links in the 'most referenced URLs' section:
-<link url="http://www.slashdot.org" ignore="y">

+ 13 - 3
docs/Changelog

@@ -1,6 +1,16 @@
-pisg (?.??)
-   * 
-   * 
+pisg (0.37)
+   * Some HTML columns were missing their end-tag when no voices had been
+     made.
+   * There is now an "MostNicksHistory" option to define how many nicks you
+     want to have in the "Most Used Nicks" box
+   * The 'use_activetime_alt' option has been removed, not needed.
+   * Underscores in option names has been removed, but can still be used with
+     a small warning.
+   * prefix option has been renamed to LogPrefix
+   * It was not possible to use the logsuffix option before, it's now working
+     again.
+   * Remove CONFIG-README, obsoleted by new and better doc/pisg-doc.txt and
+     doc/html/index.html
 
 
 pisg (0.36) - Fri Feb, 8th 2002
 pisg (0.36) - Fri Feb, 8th 2002
    * Many translation updates (thanks all)
    * Many translation updates (thanks all)

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 214 - 214
docs/pisg-doc.sgml


+ 84 - 36
modules/Pisg.pm

@@ -32,6 +32,7 @@ sub new
         chans => {},
         chans => {},
         users => {},
         users => {},
         cfg => {},
         cfg => {},
+        bwd => {},
         tmps => {},
         tmps => {},
     };
     };
 
 
@@ -95,11 +96,12 @@ sub get_default_config_settings
         pagefoot => 'none',
         pagefoot => 'none',
         configfile => 'pisg.cfg',
         configfile => 'pisg.cfg',
         imagepath => '',
         imagepath => '',
-        default_pic => '',
+        defaultpic => '',
         logdir => '',
         logdir => '',
         lang => 'en',
         lang => 'en',
         langfile => 'lang.txt',
         langfile => 'lang.txt',
-        prefix => '',
+        logprefix => '',
+        logsuffix => '',
         silent => 0,
         silent => 0,
         userpics => 'y',
         userpics => 'y',
 
 
@@ -139,31 +141,30 @@ sub get_default_config_settings
 
 
         # Stats settings
         # Stats settings
 
 
-        show_activetimes => 1,
-        show_bignumbers => 1,
-        show_topics => 1,
-        show_linetime => 0,
-        show_time => 1,
-        show_words => 0,
-        show_wpl => 0,
-        show_cpl => 0,
-        show_lastseen => 0,
-        show_legend => 1,
-        show_kickline => 1,
-        show_actionline => 1,
-        show_shoutline => 1,
-        show_violentlines => 1,
-        show_randquote => 1,
-        show_muw => 1,
-        show_mrn => 1,
-        show_mru => 1,
-        show_voices => 0,
-        show_mostnicks => 0,
+        showactivetimes => 1,
+        showbignumbers => 1,
+        showtopics => 1,
+        showlinetime => 0,
+        showtime => 1,
+        showwords => 0,
+        showwpl => 0,
+        showcpl => 0,
+        showlastseen => 0,
+        showlegend => 1,
+        showkickline => 1,
+        showactionline => 1,
+        showshoutline => 1,
+        showviolentlines => 1,
+        showrandquote => 1,
+        showmuw => 1,
+        showmrn => 1,
+        showmru => 1,
+        showvoices => 0,
+        showmostnicks => 0,
 
 
         # Less important things
         # Less important things
 
 
         timeoffset => '+0',
         timeoffset => '+0',
-        use_activetime_alt => 0,
         minquote => 25,
         minquote => 25,
         maxquote => 65,
         maxquote => 65,
         wordlength => 5,
         wordlength => 5,
@@ -179,17 +180,46 @@ sub get_default_config_settings
 
 
         # Misc settings
         # Misc settings
 
 
-        foul => 'ass fuck bitch shit scheisse scheiße kacke arsch ficker ficken schlampe',
-        violent => 'slaps beats smacks',
+        foulwords => 'ass fuck bitch shit scheisse scheiße kacke arsch ficker ficken schlampe',
+        violentwords => 'slaps beats smacks',
         ignorewords => '',
         ignorewords => '',
         tablewidth => 614,
         tablewidth => 614,
-        regexp_aliases => 0,
+        regexpaliases => 0,
 
 
         # Developer stuff
         # Developer stuff
 
 
         version => "0.37-cvs",
         version => "0.37-cvs",
     };
     };
 
 
+    # Backwards compatibility with old option names:
+    $self->{bwd} = {
+        default_pic => 'DefaultPic',
+        prefix => 'LogPrefix',
+        show_activetimes => 'ShowActiveTimes',
+        show_bignumbers => 'ShowBigNumbers',
+        show_topics => 'ShowTopics',
+        show_linetime => 'ShowLineTime',
+        show_time => 'ShowTime',
+        show_words => 'ShowWords',
+        show_wpl => 'ShowWpl',
+        show_cpl => 'ShowCpl',
+        show_lastseen => 'ShowLastSeen',
+        show_legend => 'ShowLegend',
+        show_kickline => 'ShowKickLine',
+        show_actionline => 'ShowActionLine',
+        show_shoutline => 'ShowShoutLine',
+        show_violentlines => 'ShowViolentLines',
+        show_randquote => 'ShowRandQuote',
+        show_muw => 'ShowMuw',
+        show_mrn => 'ShowMrn',
+        show_mru => 'ShowMru',
+        show_voices => 'ShowVoices',
+        show_mostnicks => 'ShowMostNicks',
+        foul => 'FoulWords',
+        violent => 'ViolentWords',
+        regexp_aliases => 'RegexpAliases',
+    };
+
     # Parse the optional overriden configuration variables
     # Parse the optional overriden configuration variables
     foreach my $key (keys %{$self->{override_cfg}}) {
     foreach my $key (keys %{$self->{override_cfg}}) {
         if ($self->{override_cfg}->{$key}) {
         if ($self->{override_cfg}->{$key}) {
@@ -231,13 +261,13 @@ sub get_language_templates
 sub init_words
 sub init_words
 {
 {
     my $self = shift;
     my $self = shift;
-    $self->{cfg}->{foul} =~ s/(^\s+|\s+$)//g;
-    $self->{cfg}->{foul} =~ s/\s+/|/g;
+    $self->{cfg}->{foulwords} =~ s/(^\s+|\s+$)//g;
+    $self->{cfg}->{foulwords} =~ s/\s+/|/g;
     foreach (split /\s+/, $self->{cfg}->{ignorewords}) {
     foreach (split /\s+/, $self->{cfg}->{ignorewords}) {
         $self->{cfg}->{ignoreword}{$_} = 1;
         $self->{cfg}->{ignoreword}{$_} = 1;
     }
     }
-    $self->{cfg}->{violent} =~ s/(^\s+|\s+$)//g;
-    $self->{cfg}->{violent} =~ s/\s+/|/g;
+    $self->{cfg}->{violentwords} =~ s/(^\s+|\s+$)//g;
+    $self->{cfg}->{violentwords} =~ s/\s+/|/g;
 }
 }
 
 
 sub init_config
 sub init_config
@@ -265,9 +295,9 @@ sub init_config
                 if ($line =~ /alias="([^"]+)"/) {
                 if ($line =~ /alias="([^"]+)"/) {
                     my @thisalias = split(/\s+/, lc($1));
                     my @thisalias = split(/\s+/, lc($1));
                     foreach (@thisalias) {
                     foreach (@thisalias) {
-                        if ($self->{cfg}->{regexp_aliases} and /[\|\[\]\{\}\(\)\?\+\.\*\^\\]/) {
+                        if ($self->{cfg}->{regexpaliases} and /[\|\[\]\{\}\(\)\?\+\.\*\^\\]/) {
                             add_aliaswild($nick, $_);
                             add_aliaswild($nick, $_);
-                        } elsif (not $self->{cfg}->{regexp_aliases} and s/\*/\.\*/g) {
+                        } elsif (not $self->{cfg}->{regexpaliases} and s/\*/\.\*/g) {
                             # quote it if it is a wildcard
                             # quote it if it is a wildcard
                             s/([\|\[\]\{\}\(\)\?\+\^\\])/\\$1/g;
                             s/([\|\[\]\{\}\(\)\?\+\^\\])/\\$1/g;
                             add_aliaswild($nick, $_);
                             add_aliaswild($nick, $_);
@@ -320,8 +350,16 @@ sub init_config
                     my $var = lc($1);
                     my $var = lc($1);
                     $var =~ s/ //; # Remove whitespace
                     $var =~ s/ //; # Remove whitespace
                     if (!defined($self->{cfg}->{$var})) {
                     if (!defined($self->{cfg}->{$var})) {
-                        print STDERR "Warning: $self->{cfg}->{configfile}, line $.: No such configuration option: '$var'\n";
-                        next;
+                        if (defined($self->{bwd}->{$var})) {
+                            print "Using backwards compatibility option '$var'; you should change it to '$self->{bwd}->{$var}'\n";
+                            unless (($self->{cfg}->{lc($self->{bwd}->{$var})} eq $2) || $self->{override_cfg}->{lc($self->{bwd}->{$var})}) {
+                                $self->{cfg}->{$self->{bwd}->{$var}} = $2;
+                            }
+                            next;
+                        } else {
+                            print STDERR "Warning: $self->{cfg}->{configfile}, line $.: No such configuration option: '$var'\n";
+                            next;
+                        }
                     }
                     }
                     unless (($self->{cfg}->{$var} eq $2) || $self->{override_cfg}->{$var}) {
                     unless (($self->{cfg}->{$var} eq $2) || $self->{override_cfg}->{$var}) {
                         $self->{cfg}->{$var} = $2;
                         $self->{cfg}->{$var} = $2;
@@ -334,14 +372,24 @@ sub init_config
                 $self->{cfg}->{chan_done}{$self->{cfg}->{channel}} = 1; # don't parse channel in $self->{cfg}->{channel} if a channel statement is present
                 $self->{cfg}->{chan_done}{$self->{cfg}->{channel}} = 1; # don't parse channel in $self->{cfg}->{channel} if a channel statement is present
                 while ($settings =~ s/\s([^=]+)=["']([^"']*)["']//) {
                 while ($settings =~ s/\s([^=]+)=["']([^"']*)["']//) {
                     my $var = lc($1);
                     my $var = lc($1);
-                    $self->{chans}->{$channel}{$var} = $2;
+                    if (defined($self->{bwd}->{$var})) {
+                        print "Using backwards compatibility option '$var'; you should change it to '$self->{bwd}->{$var}'\n";
+                        $self->{chans}->{$channel}{lc($self->{bwd}->{$var})} = $2;
+                    } else {
+                        $self->{chans}->{$channel}{$var} = $2;
+                    }
                 }
                 }
                 while (<CONFIG>) {
                 while (<CONFIG>) {
                     last if ($_ =~ /<\/*channel>/i);
                     last if ($_ =~ /<\/*channel>/i);
                     if ($_ =~ /^\s*(\w+)\s*=\s*["']([^"']*)["']/) {
                     if ($_ =~ /^\s*(\w+)\s*=\s*["']([^"']*)["']/) {
                         my $var = lc($1);
                         my $var = lc($1);
                         unless ($self->{override_cfg}->{$var}) {
                         unless ($self->{override_cfg}->{$var}) {
-                            $self->{chans}->{$channel}{$var} = $2;
+                            if (defined($self->{bwd}->{$var})) {
+                                print "Using backwards compatibility option '$var'; you should change it to '$self->{bwd}->{$var}'\n";
+                                $self->{chans}->{$channel}{lc($self->{bwd}->{$var})} = $2;
+                            } else {
+                                $self->{chans}->{$channel}{$var} = $2;
+                            }
                         }
                         }
                     } else {
                     } else {
                         print STDERR "Warning: $self->{cfg}->{configfile}, line $.: Unrecognized line\n";
                         print STDERR "Warning: $self->{cfg}->{configfile}, line $.: Unrecognized line\n";

+ 36 - 41
modules/Pisg/HTMLGenerator.pm

@@ -40,16 +40,16 @@ sub create_html
     open (OUTPUT, "> $self->{cfg}->{outputfile}") or
     open (OUTPUT, "> $self->{cfg}->{outputfile}") or
         die("$0: Unable to open outputfile($self->{cfg}->{outputfile}): $!\n");
         die("$0: Unable to open outputfile($self->{cfg}->{outputfile}): $!\n");
 
 
-    if ($self->{cfg}->{show_time}) {
+    if ($self->{cfg}->{showtime}) {
         $self->{cfg}->{tablewidth} += 40;
         $self->{cfg}->{tablewidth} += 40;
     }
     }
-    if ($self->{cfg}->{show_words}) {
+    if ($self->{cfg}->{showwords}) {
         $self->{cfg}->{tablewidth} += 40;
         $self->{cfg}->{tablewidth} += 40;
     }
     }
-    if ($self->{cfg}->{show_wpl}) {
+    if ($self->{cfg}->{showwpl}) {
         $self->{cfg}->{tablewidth} += 40;
         $self->{cfg}->{tablewidth} += 40;
     }
     }
-    if ($self->{cfg}->{show_cpl}) {
+    if ($self->{cfg}->{showcpl}) {
         $self->{cfg}->{tablewidth} += 40;
         $self->{cfg}->{tablewidth} += 40;
     }
     }
     $self->{cfg}->{headwidth} = $self->{cfg}->{tablewidth} - 4;
     $self->{cfg}->{headwidth} = $self->{cfg}->{tablewidth} - 4;
@@ -57,12 +57,12 @@ sub create_html
     $self->_pageheader()
     $self->_pageheader()
         if ($self->{cfg}->{pagehead} ne 'none');
         if ($self->{cfg}->{pagehead} ne 'none');
 
 
-    if ($self->{cfg}->{show_activetimes}) {
+    if ($self->{cfg}->{showactivetimes}) {
         $self->_activetimes();
         $self->_activetimes();
     }
     }
     $self->_activenicks();
     $self->_activenicks();
 
 
-    if ($self->{cfg}->{show_bignumbers}) {
+    if ($self->{cfg}->{showbignumbers}) {
         $self->_headline($self->_template_text('bignumtopic'));
         $self->_headline($self->_template_text('bignumtopic'));
         _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
         _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
         $self->_questions();
         $self->_questions();
@@ -77,29 +77,29 @@ sub create_html
         _html("</table>"); # Needed for sections
         _html("</table>"); # Needed for sections
     }
     }
 
 
-    if ($self->{cfg}->{show_mostnicks}) {
+    if ($self->{cfg}->{showmostnicks}) {
         $self->_mostnicks();
         $self->_mostnicks();
     }
     }
 
 
-    if ($self->{cfg}->{show_muw}) {
+    if ($self->{cfg}->{showmuw}) {
         $self->_mostusedword();
         $self->_mostusedword();
     }
     }
 
 
-    if ($self->{cfg}->{show_mrn}) {
+    if ($self->{cfg}->{showmrn}) {
         $self->_mostreferencednicks();
         $self->_mostreferencednicks();
     }
     }
 
 
-    if ($self->{cfg}->{show_mru}) {
+    if ($self->{cfg}->{showmru}) {
         $self->_mosturls();
         $self->_mosturls();
     }
     }
 
 
-    if ($self->{cfg}->{show_bignumbers}) {
+    if ($self->{cfg}->{showbignumbers}) {
         $self->_headline($self->_template_text('othernumtopic'));
         $self->_headline($self->_template_text('othernumtopic'));
         _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
         _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
         $self->_gotkicks();
         $self->_gotkicks();
         $self->_mostkicks();
         $self->_mostkicks();
         $self->_mostop();
         $self->_mostop();
-        $self->_mostvoice() if $self->{cfg}->{show_voices};
+        $self->_mostvoice() if $self->{cfg}->{showvoices};
         $self->_mostactions();
         $self->_mostactions();
         $self->_mostmonologues();
         $self->_mostmonologues();
         $self->_mostjoins();
         $self->_mostjoins();
@@ -111,7 +111,7 @@ sub create_html
     _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
     _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
 
 
     $self->_lasttopics()
     $self->_lasttopics()
-        if ($self->{cfg}->{show_topics});
+        if ($self->{cfg}->{showtopics});
 
 
     _html("</table>"); # Needed for sections
     _html("</table>"); # Needed for sections
 
 
@@ -388,13 +388,9 @@ sub _activetimes
     $toptime[0] =~ s/0(\d)/$1/;
     $toptime[0] =~ s/0(\d)/$1/;
 
 
     for ($b = 0; $b < 24; $b++) {
     for ($b = 0; $b < 24; $b++) {
-        if ($toptime[0] == $b && !$self->{cfg}->{use_activetime_alt}) {
+        if ($toptime[0] == $b) {
             # Highlight the top time
             # Highlight the top time
             $class = 'hirankc';
             $class = 'hirankc';
-        } elsif ($now[2] == $b && $self->{cfg}->{use_activetime_alt}) {
-            # Highlight the hour the stats is being generated in
-            $class = 'hirankc';
-
         } else {
         } else {
             $class = 'rankc';
             $class = 'rankc';
         }
         }
@@ -403,7 +399,7 @@ sub _activetimes
 
 
     _html("</tr></table>");
     _html("</tr></table>");
 
 
-    if($self->{cfg}->{show_legend} == 1) {
+    if($self->{cfg}->{showlegend} == 1) {
         $self->_legend();
         $self->_legend();
     }
     }
 }
 }
@@ -419,12 +415,12 @@ sub _activenicks
     _html("<td>&nbsp;</td>"
     _html("<td>&nbsp;</td>"
     . "<td class=\"tdtop\"><b>" . $self->_template_text('nick') . "</b></td>"
     . "<td class=\"tdtop\"><b>" . $self->_template_text('nick') . "</b></td>"
     . "<td class=\"tdtop\"><b>" . $self->_template_text('numberlines') . "</b></td>"
     . "<td class=\"tdtop\"><b>" . $self->_template_text('numberlines') . "</b></td>"
-    . ($self->{cfg}->{show_time} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_time')."</b></td>" : "")
-    . ($self->{cfg}->{show_words} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_words')."</b></td>" : "")
-    . ($self->{cfg}->{show_wpl} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_wpl')."</b></td>" : "")
-    . ($self->{cfg}->{show_cpl} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_cpl')."</b></td>" : "")
-    . ($self->{cfg}->{show_lastseen} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_lastseen')."</b></td>" : "")
-    . ($self->{cfg}->{show_randquote} ? "<td class=\"tdtop\"><b>".$self->_template_text('randquote')."</b></td>" : "")
+    . ($self->{cfg}->{showtime} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_time')."</b></td>" : "")
+    . ($self->{cfg}->{showwords} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_words')."</b></td>" : "")
+    . ($self->{cfg}->{showwpl} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_wpl')."</b></td>" : "")
+    . ($self->{cfg}->{showcpl} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_cpl')."</b></td>" : "")
+    . ($self->{cfg}->{showlastseen} ? "<td class=\"tdtop\"><b>".$self->_template_text('show_lastseen')."</b></td>" : "")
+    . ($self->{cfg}->{showrandquote} ? "<td class=\"tdtop\"><b>".$self->_template_text('randquote')."</b></td>" : "")
     );
     );
 
 
     my @active = sort { $self->{stats}->{lines}{$b} <=> $self->{stats}->{lines}{$a} } keys %{ $self->{stats}->{lines} };
     my @active = sort { $self->{stats}->{lines}{$b} <=> $self->{stats}->{lines}{$a} } keys %{ $self->{stats}->{lines} };
@@ -471,7 +467,7 @@ sub _activenicks
 
 
         my $lastseen;
         my $lastseen;
 
 
-        if ($self->{cfg}->{show_lastseen}) {
+        if ($self->{cfg}->{showlastseen}) {
             $lastseen = $self->{stats}->{days} - $self->{stats}->{lastvisited}{$nick};
             $lastseen = $self->{stats}->{days} - $self->{stats}->{lastvisited}{$nick};
             if ($lastseen == 0) {
             if ($lastseen == 0) {
                 $lastseen = $self->_template_text('today');
                 $lastseen = $self->_template_text('today');
@@ -488,25 +484,25 @@ sub _activenicks
         my $w = $self->{stats}->{words}{$nick} ? $self->{stats}->{words}{$nick} : 0;
         my $w = $self->{stats}->{words}{$nick} ? $self->{stats}->{words}{$nick} : 0;
         my $ch   = $self->{stats}->{lengths}{$nick};
         my $ch   = $self->{stats}->{lengths}{$nick};
         _html("$c</td><td style=\"background-color: $color\">$visiblenick</td>"
         _html("$c</td><td style=\"background-color: $color\">$visiblenick</td>"
-        . ($self->{cfg}->{show_linetime} ?
+        . ($self->{cfg}->{showlinetime} ?
         "<td style=\"background-color: $color\">".$self->_user_linetimes($nick,$active[0])."</td>"
         "<td style=\"background-color: $color\">".$self->_user_linetimes($nick,$active[0])."</td>"
         : "<td style=\"background-color: $color\">$line</td>")
         : "<td style=\"background-color: $color\">$line</td>")
-        . ($self->{cfg}->{show_time} ?
+        . ($self->{cfg}->{showtime} ?
         "<td style=\"background-color: $color\">".$self->_user_times($nick)."</td>"
         "<td style=\"background-color: $color\">".$self->_user_times($nick)."</td>"
         : "")
         : "")
-        . ($self->{cfg}->{show_words} ?
+        . ($self->{cfg}->{showwords} ?
         "<td style=\"background-color: $color\">$w</td>"
         "<td style=\"background-color: $color\">$w</td>"
         : "")
         : "")
-        . ($self->{cfg}->{show_wpl} ?
+        . ($self->{cfg}->{showwpl} ?
         "<td style=\"background-color: $color\">".sprintf("%.1f",$w/$line)."</td>"
         "<td style=\"background-color: $color\">".sprintf("%.1f",$w/$line)."</td>"
         : "")
         : "")
-        . ($self->{cfg}->{show_cpl} ?
+        . ($self->{cfg}->{showcpl} ?
         "<td style=\"background-color: $color\">".sprintf("%.1f",$ch/$line)."</td>"
         "<td style=\"background-color: $color\">".sprintf("%.1f",$ch/$line)."</td>"
         : "")
         : "")
-        . ($self->{cfg}->{show_lastseen} ?
+        . ($self->{cfg}->{showlastseen} ?
         "<td style=\"background-color: $color\">$lastseen</td>"
         "<td style=\"background-color: $color\">$lastseen</td>"
         : "")
         : "")
-        . ($self->{cfg}->{show_randquote} ?
+        . ($self->{cfg}->{showrandquote} ?
         "<td style=\"background-color: $color\">\"$randomline\"</td>"
         "<td style=\"background-color: $color\">\"$randomline\"</td>"
         : "")
         : "")
         );
         );
@@ -527,8 +523,8 @@ sub _activenicks
 		_html("</a>");
 		_html("</a>");
 	    }
 	    }
 	    _html("</td>");
 	    _html("</td>");
-        } elsif ($self->{cfg}->{default_pic} ne '' && $self->{cfg}->{userpics} !~ /n/i)  {
-            _html("<td style=\"background-color: $color\" align=\"center\"><img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{cfg}->{default_pic}\" /></td>");
+        } elsif ($self->{cfg}->{defaultpic} ne '' && $self->{cfg}->{userpics} !~ /n/i)  {
+            _html("<td style=\"background-color: $color\" align=\"center\"><img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{cfg}->{defaultpic}\" /></td>");
         }
         }
 
 
         _html("</tr>");
         _html("</tr>");
@@ -701,7 +697,7 @@ sub _capspeople
         );
         );
 
 
         my $text = $self->_template_text('allcaps1', %hash);
         my $text = $self->_template_text('allcaps1', %hash);
-        if($self->{cfg}->{show_shoutline}) {
+        if($self->{cfg}->{showshoutline}) {
             my $exttext = $self->_template_text('allcapstext', %hash);
             my $exttext = $self->_template_text('allcapstext', %hash);
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
         } else {
         } else {
@@ -741,7 +737,7 @@ sub _violent
             line    => htmlentities($self->{stats}->{violencelines}{$aggressors[0]})
             line    => htmlentities($self->{stats}->{violencelines}{$aggressors[0]})
         );
         );
         my $text = $self->_template_text('violent1', %hash);
         my $text = $self->_template_text('violent1', %hash);
-        if($self->{cfg}->{show_violentlines}) {
+        if($self->{cfg}->{showviolentlines}) {
             my $exttext = $self->_template_text('violenttext', %hash);
             my $exttext = $self->_template_text('violenttext', %hash);
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
         } else {
         } else {
@@ -775,7 +771,7 @@ sub _violent
             line    => htmlentities($self->{stats}->{attackedlines}{$victims[0]})
             line    => htmlentities($self->{stats}->{attackedlines}{$victims[0]})
         );
         );
         my $text = $self->_template_text('attacked1', %hash);
         my $text = $self->_template_text('attacked1', %hash);
-        if($self->{cfg}->{show_violentlines}) {
+        if($self->{cfg}->{showviolentlines}) {
             my $exttext = $self->_template_text('attackedtext', %hash);
             my $exttext = $self->_template_text('attackedtext', %hash);
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
         } else {
         } else {
@@ -811,7 +807,7 @@ sub _gotkicks
 
 
         my $text = $self->_template_text('gotkick1', %hash);
         my $text = $self->_template_text('gotkick1', %hash);
 
 
-        if ($self->{cfg}->{show_kickline}) {
+        if ($self->{cfg}->{showkickline}) {
             my $exttext = $self->_template_text('kicktext', %hash);
             my $exttext = $self->_template_text('kicktext', %hash);
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
         } else {
         } else {
@@ -1034,7 +1030,6 @@ sub _mostfoul
 
 
     my @foul = sort { $spercent{$b} <=> $spercent{$a} } keys %spercent;
     my @foul = sort { $spercent{$b} <=> $spercent{$a} } keys %spercent;
 
 
-
     if (@foul) {
     if (@foul) {
 
 
         my %hash = (
         my %hash = (
@@ -1242,7 +1237,7 @@ sub _mostactions
             line    => htmlentities($self->{stats}->{actionlines}{$actions[0]})
             line    => htmlentities($self->{stats}->{actionlines}{$actions[0]})
         );
         );
         my $text = $self->_template_text('action1', %hash);
         my $text = $self->_template_text('action1', %hash);
-        if($self->{cfg}->{show_actionline}) {
+        if($self->{cfg}->{showactionline}) {
             my $exttext = $self->_template_text('actiontext', %hash);
             my $exttext = $self->_template_text('actiontext', %hash);
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
             _html("<tr><td class=\"hicell\">$text<br /><span class=\"small\">$exttext</span><br />");
         } else {
         } else {

+ 8 - 8
modules/Pisg/Parser/Logfile.pm

@@ -113,9 +113,9 @@ sub _parse_dir
     opendir(LOGDIR, $self->{cfg}->{logdir}) or
     opendir(LOGDIR, $self->{cfg}->{logdir}) or
     die("Can't opendir $self->{cfg}->{logdir}: $!");
     die("Can't opendir $self->{cfg}->{logdir}: $!");
     @filesarray = grep {
     @filesarray = grep {
-        /^[^\.]/ && /^$self->{cfg}->{prefix}/ && -f "$self->{cfg}->{logdir}/$_"
+        /^[^\.]/ && /^$self->{cfg}->{logprefix}/ && -f "$self->{cfg}->{logdir}/$_"
     } readdir(LOGDIR) or
     } readdir(LOGDIR) or
-    die("No files in \"$self->{cfg}->{logdir}\" matched prefix \"$self->{cfg}->{prefix}\"");
+    die("No files in \"$self->{cfg}->{logdir}\" matched prefix \"$self->{cfg}->{logprefix}\"");
     closedir(LOGDIR);
     closedir(LOGDIR);
 
 
     my %state = (
     my %state = (
@@ -217,7 +217,7 @@ sub _parse_file
 
 
                 $hour   = $hashref->{hour};
                 $hour   = $hashref->{hour};
                 $nick   = find_alias($hashref->{nick});
                 $nick   = find_alias($hashref->{nick});
-                checkname($hashref->{nick}, $nick, $stats) if ($self->{cfg}->{show_mostnicks});
+                checkname($hashref->{nick}, $nick, $stats) if ($self->{cfg}->{showmostnicks});
                 $saying = $hashref->{saying};
                 $saying = $hashref->{saying};
 
 
                 if ($hour < $state->{oldtime}) { $stats->{days}++ }
                 if ($hour < $state->{oldtime}) { $stats->{days}++ }
@@ -271,7 +271,7 @@ sub _parse_file
                     }
                     }
 
 
                     $stats->{foul}{$nick}++
                     $stats->{foul}{$nick}++
-                        if ($saying =~ /$self->{cfg}->{foul}/io);
+                        if ($saying =~ /$self->{cfg}->{foulwords}/io);
 
 
                     # Who smiles the most?
                     # Who smiles the most?
                     # A regex matching al lot of smilies
                     # A regex matching al lot of smilies
@@ -309,7 +309,7 @@ sub _parse_file
 
 
             $hour   = $hashref->{hour};
             $hour   = $hashref->{hour};
             $nick   = find_alias($hashref->{nick});
             $nick   = find_alias($hashref->{nick});
-            checkname($hashref->{nick}, $nick, $stats) if ($self->{cfg}->{show_mostnicks});
+            checkname($hashref->{nick}, $nick, $stats) if ($self->{cfg}->{showmostnicks});
             $saying = $hashref->{saying};
             $saying = $hashref->{saying};
 
 
             if ($hour < $state->{oldtime}) { $stats->{days}++ }
             if ($hour < $state->{oldtime}) { $stats->{days}++ }
@@ -325,7 +325,7 @@ sub _parse_file
                 $stats->{lastvisited}{$nick} = $stats->{days};
                 $stats->{lastvisited}{$nick} = $stats->{days};
                 $stats->{line_times}{$nick}[int($hour/6)]++;
                 $stats->{line_times}{$nick}[int($hour/6)]++;
 
 
-                if ($saying =~ /^($self->{cfg}->{violent}) (\S+)/o) {
+                if ($saying =~ /^($self->{cfg}->{violentwords}) (\S+)/o) {
                     my $victim = find_alias($2);
                     my $victim = find_alias($2);
                     if (!is_ignored($victim)) {
                     if (!is_ignored($victim)) {
                         $stats->{violence}{$nick}++;
                         $stats->{violence}{$nick}++;
@@ -353,7 +353,7 @@ sub _parse_file
             $hour     = $hashref->{hour};
             $hour     = $hashref->{hour};
             $min      = $hashref->{min};
             $min      = $hashref->{min};
             $nick     = find_alias($hashref->{nick});
             $nick     = find_alias($hashref->{nick});
-            checkname($hashref->{nick}, $nick, $stats) if ($self->{cfg}->{show_mostnicks});
+            checkname($hashref->{nick}, $nick, $stats) if ($self->{cfg}->{showmostnicks});
             $kicker   = find_alias($hashref->{kicker})
             $kicker   = find_alias($hashref->{kicker})
                 if ($hashref->{kicker});
                 if ($hashref->{kicker});
             $newtopic = $hashref->{newtopic};
             $newtopic = $hashref->{newtopic};
@@ -388,7 +388,7 @@ sub _parse_file
 
 
                 } elsif (defined($newnick) and ($self->{cfg}->{nicktracking} == 1)) {
                 } elsif (defined($newnick) and ($self->{cfg}->{nicktracking} == 1)) {
                     add_alias($nick, $newnick);
                     add_alias($nick, $newnick);
-                    checkname($nick, $newnick, $stats) if ($self->{cfg}->{show_mostnicks});
+                    checkname($nick, $newnick, $stats) if ($self->{cfg}->{showmostnicks});
                 }
                 }
             }
             }
         }
         }

+ 7 - 6
pisg.cfg

@@ -1,17 +1,18 @@
 # Config file for pisg (set up all your channels/logfiles here)
 # Config file for pisg (set up all your channels/logfiles here)
 #
 #
-# You should read CONFIG-README if you want to get started with this file.
+# For a list of all configuration options, see docs/pisg-doc.txt or
+# docs/html/index.html for a HTML version.
 #
 #
 # Here is some basic examples, uncomment them to make them actually do
 # Here is some basic examples, uncomment them to make them actually do
 # something.
 # something.
 #
 #
 # <user nick="Joe" alias="Joe^away Joe^work" pic="joe.jpg" link="joe@joe.com">
 # <user nick="Joe" alias="Joe^away Joe^work" pic="joe.jpg" link="joe@joe.com">
 #
 #
-# <set foul="ass bitch fuck" maintainer="SomeMaintainer">
+# <set FoulWords="ass bitch fuck" Maintainer="SomeMaintainer">
 #
 #
-# <channel="#channel" logfile="channel2.log">
-#   format="mIRC"
-#   network="SomeIRCNet"
-#   outputfile="index.html"
+# <channel="#channel" LogFile="channel2.log">
+#   Format="mIRC"
+#   Network="SomeIRCNet"
+#   OutputFile="index.html"
 # </channel>
 # </channel>
 #
 #

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio