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

+ 4 - 0
docs/CONFIG-README

@@ -104,6 +104,10 @@ pagehead            Some 'page header' file which you want to include in top
 imagepath           If your user pictures is located in a special direcotry,
                     set the path here. E.g. 'userpics/'
 
+default_pic         If no picture defined for a user, use this default
+                    picture, good for example to display 'No picture
+                    available'.
+
 logdir              If you specify a path to a directory here, then pisg will
                     run through the files in that directory, parse all
                     logfiles in it and create 1 HTML file from it. Useful

+ 1 - 0
modules/Pisg.pm

@@ -113,6 +113,7 @@ sub get_default_config_settings
         pagehead => 'none',
         configfile => 'pisg.cfg',
         imagepath => '',
+        default_pic => '',
         logdir => '',
         lang => 'EN',
         langfile => 'lang.txt',

+ 3 - 1
modules/Pisg/HTMLGenerator.pm

@@ -365,7 +365,7 @@ sub _activenicks
     . ($self->{cfg}->{show_randquote} ? "<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>".$self->_template_text('randquote')."</b></td>" : "")
     );
 
-    if (scalar keys %{$self->{users}->{userpics}} > 0) {
+    if (scalar keys %{$self->{users}->{userpics}} > 0 or $self->{cfg}->{default_pic} ne '') {
         _html("<td bgcolor=\"$self->{cfg}->{tdtop}\"><b>" . $self->_template_text('userpic') ."</b></td>");
     }
 
@@ -456,6 +456,8 @@ sub _activenicks
             } else {
                 _html("<td bgcolor=\"#$col_r$col_g$col_b\" align=\"center\"><img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\"></td>");
             }
+        } elsif ($self->{cfg}->{default_pic} ne '')  {
+            _html("<td bgcolor=\"#$col_r$col_g$col_b\" align=\"center\"><img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{cfg}->{default_pic}\"></td>");
         }
 
         _html("</tr>");