Morten Brix Pedersen 24 лет назад
Родитель
Сommit
db7fc53c34
3 измененных файлов с 19 добавлено и 2 удалено
  1. 5 0
      docs/CONFIG-README
  2. 1 0
      modules/Pisg.pm
  3. 13 2
      modules/Pisg/HTMLGenerator.pm

+ 5 - 0
docs/CONFIG-README

@@ -266,6 +266,11 @@ pic_loc             Directory containing your png graphics files.
 charset             Charset to use for stats page.
 charset             Charset to use for stats page.
                     (default: iso-8859-1)
                     (default: iso-8859-1)
 
 
+use_activetime_alt  Use an alternative way to highlight the number under the
+                    time bars, if set to 1, will highlight the hour in which
+                    the stats were generated.
+                    (default: 0)
+
 minquote            Minimal number of letters for a random quote
 minquote            Minimal number of letters for a random quote
                     (default: 25)
                     (default: 25)
 
 

+ 1 - 0
modules/Pisg.pm

@@ -179,6 +179,7 @@ sub get_default_config_settings
         # Less important things
         # Less important things
 
 
         timeoffset => '+0',
         timeoffset => '+0',
+        use_activetime_alt => 0,
         minquote => 25,
         minquote => 25,
         maxquote => 65,
         maxquote => 65,
         wordlength => 5,
         wordlength => 5,

+ 13 - 2
modules/Pisg/HTMLGenerator.pm

@@ -341,8 +341,20 @@ sub _activetimes
 
 
     _html("</tr><tr>");
     _html("</tr><tr>");
 
 
+    # Remove leading zero
+    $toptime[0] =~ s/0(\d)/$1/;
+
     for ($b = 0; $b < 24; $b++) {
     for ($b = 0; $b < 24; $b++) {
-        if ($now[2] == $b) { $class = 'hirankc'; } else { $class = 'rankc'; }
+        if ($toptime[0] == $b && !$self->{cfg}->{use_activetime_alt}) {
+            # Highlight the top time
+            $class = 'hirankc';
+        } elsif ($now[2] == $b && $self->{cfg}->{use_activetime_alt}) {
+            # Highlight the hour the stats is being generated in
+            $class = 'hirankc';
+
+        } else {
+            $class = 'rankc';
+        }
         _html("<td class=\"$class\" style=\"font-size: 10px\" align=\"center\">$b</td>");
         _html("<td class=\"$class\" style=\"font-size: 10px\" align=\"center\">$b</td>");
 }
 }
 
 
@@ -521,7 +533,6 @@ sub generate_colors
     my $red  = sprintf "%0.2x", abs int(((($t_r - $f_r) / $self->{cfg}->{activenicks}) * +$c) + $f_r);
     my $red  = sprintf "%0.2x", abs int(((($t_r - $f_r) / $self->{cfg}->{activenicks}) * +$c) + $f_r);
 
 
     return "#$red$green$blue";
     return "#$red$green$blue";
-
 }
 }
 
 
 sub _html
 sub _html