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

* A new option, ShowLines, for disabling the column with the number of
lines in "Most Active Nicks" has been added.

Morten Brix Pedersen 21 лет назад
Родитель
Сommit
a396677c20
4 измененных файлов с 47 добавлено и 4 удалено
  1. 2 0
      docs/Changelog
  2. 36 0
      docs/pisg-doc.xml
  3. 2 1
      modules/Pisg.pm
  4. 7 3
      modules/Pisg/HTMLGenerator.pm

+ 2 - 0
docs/Changelog

@@ -1,4 +1,6 @@
 pisg (0.63) - ??
+   * A new option, ShowLines, for disabling the column with the number of
+     lines in "Most Active Nicks" has been added.
    * Updated the Swedish foul1 template (thanks, Torbjörn Svensson).
 
 pisg (0.62) - Sat Dec, 11th 2004

+ 36 - 0
docs/pisg-doc.xml

@@ -1140,6 +1140,42 @@
     </refsect1>
     </refentry>
 
+    <!-- *** SHOWLINES *** -->
+    <refentry id="ShowLines">
+
+    <refmeta> <refentrytitle>ShowLines</refentrytitle> </refmeta>
+
+    <refnamediv>
+    <refname>ShowLines</refname>
+    <refpurpose>enable/disable "words per line"</refpurpose>
+    </refnamediv>
+
+    <refsynopsisdiv><programlisting>
+      <![CDATA[
+        <channel="#channel">
+         Logfile = "channel.log"
+         Format = "xchat"
+         ShowLines = "0"
+        </channel>
+
+        <set ShowLines="1">
+      ]]>
+    </programlisting></refsynopsisdiv>
+
+    <refsect1>
+    <title>Description</title>
+    <para>
+    The default behaviour is to add a column to the "Most Active Nicks"
+    section displaying the number of lines a user wrote. With this option it
+    can be disabled.
+    </para>
+    </refsect1>
+    <refsect1>
+    <title>Default</title>
+    <para> 1 (enabled) </para>
+    </refsect1>
+    </refentry>
+
     <!-- *** SHOWWPL *** -->
     <refentry id="ShowWpl">
 

+ 2 - 1
modules/Pisg.pm

@@ -137,6 +137,7 @@ sub get_default_config_settings
         showtopics => 1,
         showlinetime => 0,
         showwordtime => 0,
+        showlines => 1,
         showtime => 1,
         showwords => 0,
         showwpl => 0,
@@ -193,7 +194,7 @@ sub get_default_config_settings
         violentwords => 'slaps beats smacks',
         ignorewords => '',
         noignoredquotes => 0,
-        tablewidth => 614,
+        tablewidth => 574,
         regexpaliases => 0,
 
         botnicks => '',            # Needed for DCpp format (non-irc)

+ 7 - 3
modules/Pisg/HTMLGenerator.pm

@@ -65,6 +65,9 @@ sub create_output
     open (OUTPUT, "> $fname") or
         die("$0: Unable to open outputfile($fname): $!\n");
 
+    if ($self->{cfg}->{showlines}) {
+        $self->{cfg}->{tablewidth} += 40;
+    }
     if ($self->{cfg}->{showtime}) {
         $self->{cfg}->{tablewidth} += 40;
     }
@@ -489,7 +492,7 @@ sub _activenicks
     _html("<table border=\"0\" width=\"$self->{cfg}->{tablewidth}\"><tr>");
     _html("<td>&nbsp;</td>"
     . "<td class=\"tdtop\"><b>" . $self->_template_text('nick') . "</b></td>"
-    . "<td class=\"tdtop\"><b>" . $self->_template_text('numberlines') . "</b></td>"
+    . ($self->{cfg}->{showlines} ? "<td class=\"tdtop\"><b>" . $self->_template_text('numberlines') . "</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>" : "")
@@ -578,9 +581,10 @@ sub _activenicks
        . ($sex ? ($sex eq 'm' ? " class=\"male\">"
        : ($sex eq 'f' ? " class=\"female\">" : " class=\"bot\">")) : ">")
        ."$visiblenick</td>"
-        . ($self->{cfg}->{showlinetime} ?
+        . ($self->{cfg}->{showlines} ? 
+         ($self->{cfg}->{showlinetime} ?
         "<td style=\"background-color: $color\" nowrap=\"nowrap\">".$self->_user_linetimes($nick,$active[0])."</td>"
-        : "<td style=\"background-color: $color\">$line</td>")
+        : "<td style=\"background-color: $color\">$line</td>") : "")
         . ($self->{cfg}->{showtime} ?
         "<td style=\"background-color: $color\">".$self->_user_times($nick)."</td>"
         : "")