Просмотр исходного кода

Added option BigNumbersThreshold to make previously undocumented behavior configurable.

Christoph Berg 22 лет назад
Родитель
Сommit
d4986b8020
4 измененных файлов с 45 добавлено и 6 удалено
  1. 2 0
      docs/Changelog
  2. 36 0
      docs/pisg-doc.sgml
  3. 1 0
      modules/Pisg.pm
  4. 6 6
      modules/Pisg/HTMLGenerator.pm

+ 2 - 0
docs/Changelog

@@ -4,6 +4,8 @@ pisg (x.xx)
    than the actual number of logfiles.
    * Sanitize nicks in _activenicks (fixes problem reported by
    shr3kst3r@hushmail.com/Andreas Blaafladt).
+   * Added option BigNumbersThreshold to make previously undocumented behavior
+   configurable.
 
 pisg (0.56) - Sat Jun, 19th 2004
    * Fix parsing of energymech kick messages and modes (thanks, optika81)

+ 36 - 0
docs/pisg-doc.sgml

@@ -2208,6 +2208,42 @@
     </refsect1>
     </refentry>
 
+    <!-- *** BIGNUMBERSTHRESHOLD *** -->
+    <refentry id="BigNumbersThreshold">
+
+    <refmeta> <refentrytitle>BigNumbersThreshold</refentrytitle> </refmeta>
+
+    <refnamediv>
+    <refname>BigNumbersThreshold</refname>
+    <refpurpose>Minimum number of lines per user for some "Big Numbers" statistics</refpurpose>
+    </refnamediv>
+
+    <refsynopsisdiv><programlisting>
+      <![CDATA[
+        <channel="#channel">
+         Logfile = "channel.log"
+         Format = "xchat"
+         BigNumbersThreshold = "10"
+        </channel>
+
+        <set BigNumbersThreshold="10">
+      ]]>
+    </programlisting></refsynopsisdiv>
+
+    <refsect1>
+    <title>Description</title>
+    <para>
+    Pisg will ignore users with less than this setting lines in the "questions
+    asked", "shouts loudest", "CAPSLOCK", "longest line", "most sad", and "most
+    happy" sections.
+    </para>
+    </refsect1>
+    <refsect1>
+    <title>Default</title>
+    <para> 100 </para>
+    </refsect1>
+    </refentry>
+
     <!-- *** ACTIVENICKS *** -->
     <refentry id="ActiveNicks">
 

+ 1 - 0
modules/Pisg.pm

@@ -168,6 +168,7 @@ sub get_default_config_settings
         minquote => 25,
         maxquote => 65,
         quotewidth => 80,
+        bignumbersthreshold => 100,
         wordlength => 5,
         activenicks => 25,
         activenicks2 => 30,

+ 6 - 6
modules/Pisg/HTMLGenerator.pm

@@ -671,7 +671,7 @@ sub _questions
 
     foreach my $nick (sort keys %{ $self->{stats}->{questions} }) {
         if ($self->{topactive}{$nick} || !$self->{cfg}->{showonlytop}) {
-          if ($self->{stats}->{lines}{$nick} > 100) {
+          if ($self->{stats}->{lines}{$nick} > $self->{cfg}->{bignumbersthreshold}) {
               $qpercent{$nick} = ($self->{stats}->{questions}{$nick} / $self->{stats}->{lines}{$nick}) * 100;
               $qpercent{$nick} =~ s/(\.\d)\d+/$1/;
           }
@@ -713,7 +713,7 @@ sub _shoutpeople
 
     foreach my $nick (sort keys %{ $self->{stats}->{shouts} }) {
         if ($self->{topactive}{$nick} || !$self->{cfg}->{showonlytop}) {
-          if ($self->{stats}->{lines}{$nick} > 100) {
+          if ($self->{stats}->{lines}{$nick} > $self->{cfg}->{bignumbersthreshold}) {
               $spercent{$nick} = ($self->{stats}->{shouts}{$nick} / $self->{stats}->{lines}{$nick}) * 100;
               $spercent{$nick} =~ s/(\.\d)\d+/$1/;
           }
@@ -757,7 +757,7 @@ sub _capspeople
 
     foreach my $nick (sort keys %{ $self->{stats}->{allcaps} }) {
         if ($self->{topactive}{$nick} || !$self->{cfg}->{showonlytop}) {
-          if ($self->{stats}->{lines}{$nick} > 100) {
+          if ($self->{stats}->{lines}{$nick} > $self->{cfg}->{bignumbersthreshold}) {
               $cpercent{$nick} = $self->{stats}->{allcaps}{$nick} / $self->{stats}->{lines}{$nick} * 100;
               $cpercent{$nick} =~ s/(\.\d)\d+/$1/;
           }
@@ -1041,7 +1041,7 @@ sub _linelengths
 
     foreach my $nick (sort keys %{ $self->{stats}->{lengths} }) {
         if ($self->{topactive}{$nick} || !$self->{cfg}->{showonlytop}) {
-          if ($self->{stats}->{lines}{$nick} > 100) {
+          if ($self->{stats}->{lines}{$nick} > $self->{cfg}->{bignumbersthreshold}) {
               $len{$nick} = $self->{stats}->{lengths}{$nick} / $self->{stats}->{lines}{$nick};
               $len{$nick} =~ s/(\.\d)\d+/$1/;
           }
@@ -1171,7 +1171,7 @@ sub _mostsad
 
     foreach my $nick (sort keys %{ $self->{stats}->{frowns} }) {
         if ($self->{topactive}{$nick} || !$self->{cfg}->{showonlytop}) {
-          if ($self->{stats}->{lines}{$nick} > 100) {
+          if ($self->{stats}->{lines}{$nick} > $self->{cfg}->{bignumbersthreshold}) {
               $spercent{$nick} = $self->{stats}->{frowns}{$nick} / $self->{stats}->{lines}{$nick} * 100;
               $spercent{$nick} =~ s/(\.\d)\d+/$1/;
           }
@@ -1452,7 +1452,7 @@ sub _mostsmiles
 
     foreach my $nick (sort keys %{ $self->{stats}->{smiles} }) {
         if ($self->{topactive}{$nick} || !$self->{cfg}->{showonlytop}) {
-          if ($self->{stats}->{lines}{$nick} > 100) {
+          if ($self->{stats}->{lines}{$nick} > $self->{cfg}->{bignumbersthreshold}) {
               $spercent{$nick} = $self->{stats}->{smiles}{$nick} / $self->{stats}->{lines}{$nick} * 100;
               $spercent{$nick} =~ s/(\.\d)\d+/$1/;
           }