Sfoglia il codice sorgente

Fix ShowTopics not properly working when disabled.

Morten Brix Pedersen 24 anni fa
parent
commit
60da27c96d
2 ha cambiato i file con 8 aggiunte e 5 eliminazioni
  1. 2 0
      docs/Changelog
  2. 6 5
      modules/Pisg/HTMLGenerator.pm

+ 2 - 0
docs/Changelog

@@ -3,6 +3,8 @@ pisg (x.xx)
      name in a wrong case wouldn't get counted.
    * Fix a bug in the mIRC format, where characters in the nick would be
      counted as mode changes.
+   * When ShowTopics was set to 0, the headline "Latest topics" was still
+     shown, fixed (thanks, Kean "zakarun" Pedersen)
 
 pisg (0.40) - Thu Jul, 4th 2002
    * The "It's Summer And The Sun Is Shining"-release.

+ 6 - 5
modules/Pisg/HTMLGenerator.pm

@@ -118,13 +118,14 @@ sub create_html
         _html("</table>"); # Needed for sections
     }
 
-    $self->_headline($self->_template_text('latesttopic'));
-    _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
+    if ($self->{cfg}->{showtopics}) {
+        $self->_headline($self->_template_text('latesttopic'));
+        _html("<table width=\"$self->{cfg}->{tablewidth}\">\n"); # Needed for sections
 
-    $self->_lasttopics()
-        if ($self->{cfg}->{showtopics});
+        $self->_lasttopics();
 
-    _html("</table>"); # Needed for sections
+        _html("</table>"); # Needed for sections
+    }
 
     my %hash = ( lines => $self->{stats}->{totallines} );
     _html($self->_template_text('totallines', %hash) . "<br /><br />");