Просмотр исходного кода

* When no PicHeight is set, don't set the height attribute on images.
Likewise with PicWidth.

Morten Brix Pedersen 23 лет назад
Родитель
Сommit
1e10ea5186
2 измененных файлов с 11 добавлено и 11 удалено
  1. 2 0
      docs/Changelog
  2. 9 11
      modules/Pisg/HTMLGenerator.pm

+ 2 - 0
docs/Changelog

@@ -3,6 +3,8 @@ pisg (x.xx)
      is disabled, instead of having a full list of nicknames in "most
      is disabled, instead of having a full list of nicknames in "most
      referenced nicks", only the number of nicks used will be listed. (thanks,
      referenced nicks", only the number of nicks used will be listed. (thanks,
      David Lynch)
      David Lynch)
+   * When no PicHeight is set, don't set the height attribute on images.
+     Likewise with PicWidth.
 
 
 pisg (0.47) - Wed Feb, 26th 2003
 pisg (0.47) - Wed Feb, 26th 2003
    * Fix bug where multiple URLs in same line would have save name as first URL
    * Fix bug where multiple URLs in same line would have save name as first URL

+ 9 - 11
modules/Pisg/HTMLGenerator.pm

@@ -491,6 +491,12 @@ sub _activenicks
 
 
         my $height = $self->{cfg}->{picheight};
         my $height = $self->{cfg}->{picheight};
         my $width = $self->{cfg}->{picwidth};
         my $width = $self->{cfg}->{picwidth};
+        if ($width ne '') {
+            $width = "width=\"$width\"";
+        }
+        if ($height ne '') {
+            $height = "height=\"$height\"";
+        }
         if ($self->{users}->{userpics}{$nick} && $self->{cfg}->{userpics} !~ /n/i) {
         if ($self->{users}->{userpics}{$nick} && $self->{cfg}->{userpics} !~ /n/i) {
             _html("<td style=\"background-color: $color\" align=\"center\" valign=\"middle\">");
             _html("<td style=\"background-color: $color\" align=\"center\" valign=\"middle\">");
             if (defined $self->{users}->{biguserpics}{$nick}) {
             if (defined $self->{users}->{biguserpics}{$nick}) {
@@ -500,18 +506,10 @@ sub _activenicks
                     _html("<a href=\"$self->{cfg}->{imagepath}$self->{users}->{biguserpics}{$nick}\">");
                     _html("<a href=\"$self->{cfg}->{imagepath}$self->{users}->{biguserpics}{$nick}\">");
                 }
                 }
             }
             }
-            if ($width ne '') {
-                if ($self->{users}->{userpics}{$nick} =~ /^http:\/\//i) {
-                    _html("<img src=\"$self->{users}->{userpics}{$nick}\" width=\"$width\" height=\"$height\" alt=\"$nick\" />");
-                } else {
-                    _html("<img src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\" width=\"$width\" height=\"$height\" alt=\"$nick\" />");
-                }
+            if ($self->{users}->{userpics}{$nick} =~ /^http:\/\//i) {
+                _html("<img src=\"$self->{users}->{userpics}{$nick}\" $width $height alt=\"$nick\" />");
             } else {
             } else {
-                if ($self->{users}->{userpics}{$nick} =~ /^http:\/\//i) {
-                    _html("<img src=\"$self->{users}->{userpics}{$nick}\" alt=\"$nick\" />");
-                } else {
-                    _html("<img src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\" alt=\"$nick\" />");
-                }
+                _html("<img src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\" $width $height alt=\"$nick\" />");
             }
             }
             if (defined $self->{users}->{biguserpics}{$nick}) {
             if (defined $self->{users}->{biguserpics}{$nick}) {
                 _html("</a>");
                 _html("</a>");