Kaynağa Gözat

Fix bug where the 'These didn't make it to the top' section wasn't being
shown on the stats page when 'activenicks2' was less than the people in the
top 25.

Morten Brix Pedersen 25 yıl önce
ebeveyn
işleme
fd441d30c7
1 değiştirilmiş dosya ile 7 ekleme ve 5 silme
  1. 7 5
      modules/Pisg/HTMLGenerator.pm

+ 7 - 5
modules/Pisg/HTMLGenerator.pm

@@ -445,13 +445,14 @@ sub _activenicks
 
 
     # Almost as active nicks ('These didn't make it to the top..')
     # Almost as active nicks ('These didn't make it to the top..')
 
 
-    my $nickstoshow = $self->{cfg}->{activenicks} + $self->{cfg}->{activenicks2};
-    $hash{totalnicks} = $nicks - $nickstoshow;
+    my $toshow = $self->{cfg}->{activenicks2} - $self->{cfg}->{activenicks};
+    my $remain = $self->{cfg}->{activenicks} + $toshow;
 
 
-    unless ($nickstoshow > $nicks) {
+    unless ($toshow > $nicks) {
+        print "\ttest\n";
 
 
         _html("<br><b><i>" . $self->_template_text('nottop') . "</i></b><table><tr>");
         _html("<br><b><i>" . $self->_template_text('nottop') . "</i></b><table><tr>");
-        for (my $c = $self->{cfg}->{activenicks}; $c < $nickstoshow; $c++) {
+        for (my $c = $self->{cfg}->{activenicks}; $c < $remain; $c++) {
             unless ($c % 5) { unless ($c == $self->{cfg}->{activenicks}) { _html("</tr><tr>"); } }
             unless ($c % 5) { unless ($c == $self->{cfg}->{activenicks}) { _html("</tr><tr>"); } }
             _html("<td bgcolor=\"$self->{cfg}->{rankc}\" class=\"small\">");
             _html("<td bgcolor=\"$self->{cfg}->{rankc}\" class=\"small\">");
             my $nick = $active[$c];
             my $nick = $active[$c];
@@ -462,7 +463,8 @@ sub _activenicks
         _html("</table>");
         _html("</table>");
     }
     }
 
 
-    if($hash{totalnicks} > 0) {
+    $hash{totalnicks} = $nicks - $remain;
+    if ($hash{totalnicks} > 0) {
         _html("<br><b>" . $self->_template_text('totalnicks', %hash) . "</b><br>");
         _html("<br><b>" . $self->_template_text('totalnicks', %hash) . "</b><br>");
     }
     }
 }
 }