Morten Brix Pedersen 24 лет назад
Родитель
Сommit
c4ad609d1b
3 измененных файлов с 27 добавлено и 2 удалено
  1. 3 0
      docs/Changelog
  2. 12 0
      layout/default.css
  3. 12 2
      modules/Pisg/HTMLGenerator.pm

+ 3 - 0
docs/Changelog

@@ -7,6 +7,9 @@ pisg (x.xx)
    * mirc2egg.sed script added in the scripts/ folder, it's used to convert
      mIRC logs to eggdrop logs. (thanks, Geoff Simmons)
    * Hopefully fix xchat logs interpreting asterixs as the nick.
+   * If a sex has been specified for a user in pisg.cfg, that user will now
+     have a sex-dependent color in the stats page. (E.g. one color for males,
+     another for females etc.)
 
 pisg (0.42) - Fri Nov, 1st 2002
    * ircII logfile support added (thanks, James Andrewartha)

+ 12 - 0
layout/default.css

@@ -44,6 +44,18 @@ td {
     text-align: left;
 }
 
+.male {
+    color: #0000DD;
+}
+
+.female {
+    color: #DD3366;
+}
+
+.bot {
+    color: #00FFFF;
+}
+
 .title {
     font-family: Tahoma, Arial, sans-serif;
     font-size: 16px;

+ 12 - 2
modules/Pisg/HTMLGenerator.pm

@@ -458,7 +458,11 @@ sub _activenicks
         my $line = $self->{stats}->{lines}{$nick};
         my $w = $self->{stats}->{words}{$nick} ? $self->{stats}->{words}{$nick} : 0;
         my $ch   = $self->{stats}->{lengths}{$nick};
-        _html("<td style=\"background-color: $color\">$visiblenick</td>"
+       my $sex = $self->{users}->{sex}{$nick};
+       _html("<td style=\"background-color: $color\""
+       . ($sex ? ($sex eq 'm' ? " class=\"male\">"
+       : ($sex eq 'f' ? " class=\"female\">" : " class=\"bot\">")) : ">")
+       ."$visiblenick</td>"
         . ($self->{cfg}->{showlinetime} ?
         "<td style=\"background-color: $color\" nowrap=\"nowrap\">".$self->_user_linetimes($nick,$active[0])."</td>"
         : "<td style=\"background-color: $color\">$line</td>")
@@ -530,7 +534,13 @@ sub _activenicks
                 } else {
                     $items = $self->{stats}->{lines}{$active[$i]};
                 }
-                _html("<td class=\"rankc10\">$active[$i] ($items)</td>");
+               my $sex = $self->{users}->{sex}{$active[$i]};
+                _html("<td class=\"rankc10\">"
+                . ($sex ? ($sex eq 'm' ? "<span class=\"male\">"
+                : ($sex eq 'f' ? "<span class=\"female\">" : "<span class=\"bot\">")) : "")
+                ."$active[$i] ($items)"
+                . ($sex ? "</span>" : "")
+                ."</td>");
             }
             _html("</tr></table>");
         }