Explorar el Código

Add 'wordhistory' option

Morten Brix Pedersen hace 25 años
padre
commit
f4504b7eb8
Se han modificado 3 ficheros con 5 adiciones y 1 borrados
  1. 3 0
      docs/CONFIG-README
  2. 1 0
      modules/Pisg.pm
  3. 1 1
      modules/Pisg/HTMLGenerator.pm

+ 3 - 0
docs/CONFIG-README

@@ -296,6 +296,9 @@ topichistory        Maximum number of topics to show in 'latest topics'
 urlhistory          Maximum number of URLs to show in 'most referenced URLs'
 urlhistory          Maximum number of URLs to show in 'most referenced URLs'
                     (default: 5)
                     (default: 5)
 
 
+wordhistory         Maximum number of words to show in 'Most used words'
+                    (default: 10)
+
 langfile            Filename of language file.
 langfile            Filename of language file.
                     (default: lang.txt)
                     (default: lang.txt)
 
 

+ 1 - 0
modules/Pisg.pm

@@ -169,6 +169,7 @@ sub get_default_config_settings
         activenicks2 => 30,
         activenicks2 => 30,
         topichistory => 3,
         topichistory => 3,
         urlhistory => 5,
         urlhistory => 5,
+        wordhistory => 10,
         nicktracking => 0,
         nicktracking => 0,
         charset => 'iso-8859-1',
         charset => 'iso-8859-1',
 
 

+ 1 - 1
modules/Pisg/HTMLGenerator.pm

@@ -1401,7 +1401,7 @@ sub _mostusedword
 
 
 
 
         my $count = 0;
         my $count = 0;
-        for(my $i = 0; $count < 10; $i++) {
+        for(my $i = 0; $count < $self->{cfg}->{wordhistory}; $i++) {
             last unless $i < $#popular;
             last unless $i < $#popular;
             # Skip nicks.  It's far more efficient to do this here than when
             # Skip nicks.  It's far more efficient to do this here than when
             # @popular is created.
             # @popular is created.