فهرست منبع

Add 'bigpic' option, thanks to Phil Gregory

Morten Brix Pedersen 24 سال پیش
والد
کامیت
cccfcccebe
4فایلهای تغییر یافته به همراه19 افزوده شده و 2 حذف شده
  1. 4 0
      docs/CONFIG-README
  2. 1 0
      docs/CREDITS
  3. 4 0
      modules/Pisg.pm
  4. 10 2
      modules/Pisg/HTMLGenerator.pm

+ 4 - 0
docs/CONFIG-README

@@ -24,6 +24,10 @@ it will add all Joe^'s to 'Joe' in the stats.
 Another thing you can do is to add a picture to a user:
     <user nick="Ben" pic="ben_holiday.jpg">
 
+If you have a larger picture of the user as well, you can make the picture
+on the stats page link to it:
+    <user nick="Ben" pic="ben_holiday.jpg" bigpic="ben-big.jpg">
+
 You can also set a user's sex:
     <user nick="Ben" sex="m">
 

+ 1 - 0
docs/CREDITS

@@ -64,6 +64,7 @@ And all the other contributors:
  * Phil Gregory <phil_g@pobox.com>
    | Regex support in user aliases, grammar corrections, huge changes to
      modularize pisg into packages/objects.
+   | 'bigpic' user option
  * Patrick Aussems aka Zyk <zyk@bugfactory.org>
    | New options: show_mrn, show_mru, show_muw, show_randquote
  * David Leadbeater

+ 4 - 0
modules/Pisg.pm

@@ -278,6 +278,10 @@ sub init_config
                     $self->{users}->{userpics}{$nick} = $1;
                 }
 
+                if ($line =~ /bigpic="([^"]+)"/) {
+                    $self->{users}->{biguserpics}{$nick} = $1;
+                }
+
                 if ($line =~ /link="([^"]+)"/) {
                     $self->{users}->{userlinks}{$nick} = $1;
                 }

+ 10 - 2
modules/Pisg/HTMLGenerator.pm

@@ -481,11 +481,19 @@ sub _activenicks
         my $height = $self->{cfg}->{pic_height};
         my $width = $self->{cfg}->{pic_width};
         if ($self->{users}->{userpics}{$nick} && $self->{cfg}->{userpics} !~ /n/i) {
+	    _html("<td style=\"background-color: $color\" align=\"center\">");
+	    if (defined $self->{users}->{biguserpics}{$nick}) {
+		_html("<a href=\"$self->{cfg}->{imagepath}$self->{users}->{biguserpics}{$nick}\">");
+	    }
             if ($width ne '') {
-                _html("<td style=\"background-color: $color\" align=\"center\"><img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\" width=\"$width\" height=\"$height\" /></td>");
+		_html("<img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\" width=\"$width\" height=\"$height\" />");
             } else {
-                _html("<td style=\"background-color: $color\" align=\"center\"><img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\" /></td>");
+                _html("<img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{users}->{userpics}{$nick}\" />");
             }
+	    if (defined $self->{users}->{biguserpics}{$nick}) {
+		_html("</a>");
+	    }
+	    _html("</td>");
         } elsif ($self->{cfg}->{default_pic} ne '' && $self->{cfg}->{userpics} !~ /n/i)  {
             _html("<td style=\"background-color: $color\" align=\"center\"><img valign=\"middle\" src=\"$self->{cfg}->{imagepath}$self->{cfg}->{default_pic}\" /></td>");
         }