Parcourir la source

New options from Patrick Aussems aka Zyk:
show_mrn, show_mru, show_muw and show_randquote

Morten Brix Pedersen il y a 25 ans
Parent
commit
3c7889094c
5 fichiers modifiés avec 51 ajouts et 16 suppressions
  1. 12 0
      docs/CONFIG-README
  2. 2 0
      docs/CREDITS
  3. 8 0
      docs/Changelog
  4. 5 1
      modules/Pisg.pm
  5. 24 15
      modules/Pisg/HTMLGenerator.pm

+ 12 - 0
docs/CONFIG-README

@@ -129,6 +129,9 @@ show_time           1 or 0, this will enable/disable the showing of the
 show_linetime       1 or 0, the same as above, except this will show the
                     bar next to the number of lines like in mIRCStats
 
+show_randquote      1 or 0, this wil enable or disable the random quote
+                    displayed in the "active nick list"
+
 show_legend         1 or 0, this will add a legend of the different time-
                     bars.
 
@@ -144,6 +147,15 @@ show_shoutline      1 or 0, this will add an example-shoutline to the
 show_violentlines   1 or 0, this will add an example-attack to the
                     "Most aggressive" and "Most attacked"-stats
 
+show_muw            1 or 0, this will enable or disable the "most used
+                    words" list
+
+show_mrn            1 or 0, this will enable or disable the "most
+                    referenced nicks" list
+
+show_mru            1 or 0, this will enable or disable the "most
+                    referenced urls" list
+
 ignorewords         A space seperated list of words to ignore in 'most
                     referenced words'
 

+ 2 - 0
docs/CREDITS

@@ -64,6 +64,8 @@ And all the other contributors:
  * Phil Gregory <phil_g@pobox.com>
    | Regex support in user aliases, grammar corrections, huge changes to
      modularize pisg into packages/objects.
+ * Patrick Aussems aka Zyk <zyk@bugfactory.org>
+   | New options: show_mrn, show_mru, show_muw, show_randquote
 
 I probably forgot a lot of people here, _PLEASE_ notify me if I left you
 out.. because I have a bad habit of forgetting to maintain this list :)

+ 8 - 0
docs/Changelog

@@ -1,3 +1,11 @@
+pisg (0.25)
+   * Fixed days counting wrong when using logdir option.
+   * New options by Patrick Assems:
+     - show_mrn, disable/enable most referenced nicks
+     - show_mru, disable/enable most referenced urls
+     - show_muw, disable/enable most used words
+     - show_randquote, disable/enable the showing of the random quotes
+
 pisg (0.24) - Mon, Sep 24th 2001
    * Logdirs not working, fixed.
    * Fix bug where it posted garbage on stats page where it should say

+ 5 - 1
modules/Pisg.pm

@@ -94,7 +94,7 @@ sub get_default_config_settings
     my $self = shift;
 
     # This is all the default settings of pisg. They can be overriden by the
-    # pisg.cfg file, or by stating the override_cfg argument to the new
+    # pisg.cfg file, or by using the override_cfg argument to the new
     # constructor.
 
     $self->{cfg} = {
@@ -151,6 +151,10 @@ sub get_default_config_settings
         show_actionline => 1,
         show_shoutline => 1,
         show_violentlines => 1,
+        show_randquote => 1,
+        show_muw => 1,
+        show_mrn => 1,
+        show_mru => 1,
 
         # Less important things
 

+ 24 - 15
modules/Pisg/HTMLGenerator.pm

@@ -32,7 +32,7 @@ sub create_html
     # 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";
@@ -71,11 +71,17 @@ sub create_html
     $self->_mostwordsperline($self->{stats});
     _html("</table>"); # Needed for sections
 
-    $self->_mostusedword($self->{stats});
+    if ($self->{cfg}->{show_muw}) {
+        $self->_mostusedword($self->{stats});
+    }
 
-    $self->_mostreferencednicks($self->{stats});
+    if ($self->{cfg}->{show_mrn}) {
+        $self->_mostreferencednicks($self->{stats});
+    }
 
-    $self->_mosturls($self->{stats});
+    if ($self->{cfg}->{show_mru}) {
+        $self->_mosturls($self->{stats});
+    }
 
     $self->_headline($self->_template_text('othernumtopic'));
     _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
@@ -339,15 +345,16 @@ sub _activenicks
     $self->_headline($self->_template_text('activenickstopic'));
 
     _html("<table border=\"0\" width=\"$self->{cfg}->{tablewidth}\"><tr>");
-    _html("<td>&nbsp;</td><td bgcolor=\"$self->{cfg}->{tdtop}\"><b>"
-    . $self->_template_text('nick') . "</b></td><td bgcolor=\"$self->{cfg}->{tdtop}\"><b>"
-    . $self->_template_text('numberlines')
-    . "</b></td><td bgcolor=\"$self->{cfg}->{tdtop}\"><b>"
-    . ($self->{cfg}->{show_time} ? $self->_template_text('show_time')."</b></td><td bgcolor=\"$self->{cfg}->{tdtop}\"><b>" : "")
-    . ($self->{cfg}->{show_words} ? $self->_template_text('show_words')."</b></td><td bgcolor=\"$self->{cfg}->{tdtop}\"><b>" : "")
-    . ($self->{cfg}->{show_wpl} ? $self->_template_text('show_wpl')."</b></td><td bgcolor=\"$self->{cfg}->{tdtop}\"><b>" : "")
-    . ($self->{cfg}->{show_cpl} ? $self->_template_text('show_cpl')."</b></td><td bgcolor=\"$self->{cfg}->{tdtop}\"><b>" : "")
-    . $self->_template_text('randquote') ."</b></td>");
+    _html("<td>&nbsp;</td>"
+    . "<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>" . $self->_template_text('nick') . "</b></td>"
+    . "<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>" . $self->_template_text('numberlines') . "</b></td>"
+    . ($self->{cfg}->{show_time} ? "<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>".$self->_template_text('show_time')."</b></td>" : "")
+    . ($self->{cfg}->{show_words} ? "<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>".$self->_template_text('show_words')."</b></td>" : "")
+    . ($self->{cfg}->{show_wpl} ? "<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>".$self->_template_text('show_wpl')."</b></td>" : "")
+    . ($self->{cfg}->{show_cpl} ? "<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>".$self->_template_text('show_cpl')."</b></td>" : "")
+    . ($self->{cfg}->{show_randquote} ? "<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>".$self->_template_text('randquote')."</b></td>" : "")
+    );
+
     if (scalar keys %{$self->{users}->{userpics}} > 0) {
         _html("<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>" . $self->_template_text('userpic') ."</b></td>");
     }
@@ -419,8 +426,10 @@ sub _activenicks
         . ($self->{cfg}->{show_cpl} ?
         "<td bgcolor=\"#$col_r$col_g$col_b\">".sprintf("%.1f",$ch/$line)."</td>"
         : "")
-        ."<td bgcolor=\"#$col_r$col_g$col_b\">");
-        _html("\"$randomline\"</td>");
+        . ($self->{cfg}->{show_randquote} ?
+        "<td bgcolor=\"#$col_r$col_g$col_b\">\"$randomline\"</td>"
+        : "")
+    );
 
         if ($self->{users}->{userpics}{$nick}) {
             _html("<td bgcolor=\"#$col_r$col_g$col_b\" align=\"center\"><img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\"></td>");