Enable Own Userpics 1 Dieses Mod gibt jedem Benutzer die Möglichkeit, sein eigenes Bild im Profil einzublenden, indem er den Pfad zu seinem Bild angibt. Die Bilder werden in ihrer Originalgröße angezeigt, solange sie das festgelegte Limit nicht überschreiten. Das Seitenverhältnis Höhe/Breite wird in jedem Fall beibehalten! Das Limit kann im Adminbereich geändert werden (sogar die Deaktivierung des Limits ist möglich). Achtung: Um die Anzeige in Originalgröße zu ermöglichen, wird das Modul "LWP::Simple" benutzt, was nicht auf jedem Server funktioniert! Benutzen Sie gegebenenfalls den "enable_own_userpics.mod". Original-mod von [CV]XXL (enable_own_userpics.mod), Überarbeitung von Frank Wessel [CV]XXL, Frank Wessel http://xxl.cstrike.de Sources\Display.pl if($memset[13] ne "\n" && $memset[13] ne "" && $musername[$a] ne "Guest") { $userpic = "

"; }
if($memset[13] ne "\n" && $memset[13] ne "" && $musername[$a] ne "Guest") { if ($memset[13] =~ /^\http:\/\// ) { use LWP::Simple; $userimage = get ($memset[13]); if ($memset[13] =~ /\.gif/i) { ($imagewidth,$imageheight)=&gifsize($userimage) ; } elsif ($memset[13] =~ /\.jpg/i) { ($imagewidth,$imageheight)=&jpegsize($userimage) ; } if ($userpic_width ne 0) { if ($imagewidth > $userpic_width) { $tmp_width = "width=$userpic_width"; } else { $tmp_width = "width=$imagewidth"; } } else { $tmp_width = "width=$imagewidth"; } if ($userpic_height ne 0) { if ($imageheight > $userpic_height) { $tmp_height = "height=$userpic_height"; } else { $tmp_height = "height=$imageheight"; } } else { $tmp_height = "height=$imageheight"; } if (($userpic_height / ($userpic_width + 1)) > ($imageheight / ($imagewidth + 1))) { $tmp_height = ""; } else { $tmp_width = ""; } $userpic = "

"; } else { $userpic = "

"; } }
Sources\Profile.pl
$txt{'229'}:
$enable_own_userpics{'1'} $userpic_limits $enable_own_userpics{'2'} EOT if ($memsettings[13] =~ /^\http:\/\// ) { $tmp_value = "$memsettings[13]"; } else { $tmp_value = "http://"; } print <<"EOT";


EOT if ($memsettings[13] =~ /^\http:\/\// ) { use LWP::Simple; $userimage = get ($memsettings[13]); if ($memsettings[13] =~ /\.gif/i) { ($imagewidth,$imageheight)=&gifsize($userimage) ; } elsif ($memsettings[13] =~ /\.jpg/i) { ($imagewidth,$imageheight)=&jpegsize($userimage) ; } if ($userpic_width ne 0) { if ($imagewidth > $userpic_width) { $tmp_width = "width=$userpic_width"; } else { $tmp_width = "width=$imagewidth"; } } else { $tmp_width = "width=$imagewidth"; } if ($userpic_height ne 0) { if ($imageheight > $userpic_height) { $tmp_height = "height=$userpic_height"; } else { $tmp_height = "height=$imageheight"; } } else { $tmp_height = "height=$imageheight"; } if (($userpic_height / ($userpic_width + 1)) > ($imageheight / ($imagewidth + 1))) { $tmp_height = ""; } else { $tmp_width = ""; } print "
"; print "<\/a>

"; } else { print "
"; print "<\/a>

"; } print <<"EOT"; print FILE "$FORM{'userpic'}\n"; @array = split (/\./, $FORM{'userpic'}); $b = 0; foreach $tmp_line (@array){ $b++; } if ("$array[$b-1]" eq "gif" || "$array[$b-1]" eq "jpg"){ print FILE "$FORM{'userpic'}\n"; } else { print FILE "blank.gif\n"; } Sources\Register.pl
$txt{'229'}:
$enable_own_userpics{'1'} $userpic_limits $enable_own_userpics{'2'} EOT if ($memsettings[13] =~ /^\http:\/\// ) { $tmp_value = "$memsettings[13]"; } else { $tmp_value = "http://"; } print <<"EOT";
print FILE "$FORM{'userpic'}\n"; @array = split (/\./, $FORM{'userpic'}); $b = 0; foreach $tmp_line (@array){ $b++; } if ("$array[$b-1]" eq "gif" || "$array[$b-1]" eq "jpg"){ print FILE "$FORM{'userpic'}\n"; } else { print FILE "blank.gif\n"; } Settings.pl 1; ########## MemberPic Addon ########## $userpic_width = 60; # Set pixel size to which the selfselected userpics are resized, 0 disables this limit $userpic_height = 60; # Set pixel size to which the selfselected userpics are resized, 0 disables this limit $userpic_limits = "Please note that your image has to be gif or jpg and that it will be resized to 60x60 pixels!"; # Text To Describe The Limits Sources\Admin.pl
$enable_own_userpics{'3'}: $enable_own_userpics{'4'}: $enable_own_userpics{'5'}:
1; ~; ########## MemberPic Addon ########## \$userpic_width = $FORM{'userpic_width'}; # Set pixel size to which the selfselected userpics are resized, 0 disables this limit \$userpic_height = $FORM{'userpic_height'}; # Set pixel size to which the selfselected userpics are resized, 0 disables this limit \$userpic_limits = "$FORM{'userpic_limits'}"; # Text To Describe The Limits Sources/Subs.pl 1; sub gifsize { my ($GIF)=@_; my ($type,$a,$b,$c,$d,$s,$width,$height) ; $type=substr($GIF,0,6); if(!($type =~ m/GIF8[7,9]a/) || (length($s=substr($GIF, 6, 4))!=4) ){ return; } ($a,$b,$c,$d)=unpack("C"x4,$s); $width= $b<<8|$a; $height= $d<<8|$c; return ($width,$height); } sub jpegsize { my ($JPEG)=@ _ ; my ($count)=2 ; my ($length)=length($JPEG) ; my ($ch)="" ; my ($c1,$c2,$a,$b,$c,$d,$width,$height) ; while (($ch ne "\xda") && ($count<$length)) { while (($ch ne "\xff") && ($count < $length)) { $ch=substr($JPEG,$count,1); $count++; } while (($ch eq "\xff") && ($count<$length)) { $ch=substr($JPEG,$count,1); $count++; } if ((ord($ch) >= 0xC0) && (ord($ch) <= 0xC3)) { $count+=3; ($a,$b,$c,$d)=unpack("C"x4,substr($JPEG,$count,4)); $width=$c<<8|$d; $height=$a<<8|$b; return($width,$height); } else { ($c1,$c2)= unpack("C"x2,substr($JPEG,$count,2)); $count += $c1<<8|$c2; } } } german.lng 1; $enable_own_userpics{'1'} = "Sie können entweder eines der unten angebotenen Bilder wählen oder ein eigenes, indem Sie die komplette Webadresse angeben (Beispiel: http://www.meineseite.de/meinbild.gif)."; $enable_own_userpics{'2'} = "Ich habe mein eigenes Bild:"; $enable_own_userpics{'3'} = "Benutzerbild-Breite (0 = deaktiviert das Limit)"; $enable_own_userpics{'4'} = "Benutzerbild-Höhe (0 = deaktiviert das Limit)"; $enable_own_userpics{'5'} = "Text, der das Limit beschreibt";