OK, firstly, this is a great mod. Well done.
I've installed it on Yabb 1.3.2. All is working apart 1 thing. The dreaded zero showing on the album folder size.
I wasn't going to post here (didn't want to make you angry), but I have read as manu posts as I could, tried various things (including #post 1155), but I've come to a halt. So I'm begging someone on bended knees to help me out here please!.
The thing is, it's all working fine. If I go to admin and reduce the max folder size to 1000, it gives the warning about the limit being reached if I upload an image that's larger. It's just not displaying the current folder size which seems stuck at 0. If I up the limit, it lets me upload images and works fine. So it's doing what it should, just not displaying correctly.
I've re-written the sub.pl must be 15-20 times in various different ways now and the same happens every time (or I get internal server error lol).
I've included below the before and after subs.pl section if anyone can give it a look over and see if I've missed anything obvious. But the fact that it's all working tends to make me think that it's a problem with the variable that shows the current folder size.
In both examples below, I have included the full sub readform section.
This is how my sub.pl looked before the mod
sub readform {
my(@pairs, $pair, $name, $value);
sub split_string
{
my ($string, $hash, $altdelim) = @_;
if($altdelim && $$string =~ m~;~) { @pairs = split(/;/, $$string); }
else { @pairs = split(/&/, $$string); }
foreach $pair (@pairs) {
($name,$value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if (exists($hash->{$name})) {
$hash->{$name} .= ", $value";
} else {
$hash->{$name} = $value;
}
}
}
split_string(\$ENV{QUERY_STRING}, \%INFO, 1);
if ($ENV{REQUEST_METHOD} eq 'POST')
{
read(STDIN, my $input, $ENV{CONTENT_LENGTH});
split_string(\$input, \%FORM)
}
$action = $INFO{'action'};
&ToHTML($INFO{'title'}); &ToHTML($FORM{'title'});
&ToHTML($INFO{'subject'}); &ToHTML($FORM{'subject'});
}
And this is what my subs.pl looks like after manually installing the mod (the one that makes it work correctly otherwise)
sub readform {
my(@pairs, $pair, $name, $value);
sub split_string
{
my ($string, $hash, $altdelim) = @_;
if($altdelim && $$string =~ m~;~) { @pairs = split(/;/, $$string); }
else { @pairs = split(/&/, $$string); }
foreach $pair (@pairs) {
($name,$value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if (exists($hash->{$name})) {
$hash->{$name} .= ", $value";
} else {
$hash->{$name} = $value;
}
}
}
split_string(\$ENV{QUERY_STRING}, \%INFO, 1);
if ($ENV{REQUEST_METHOD} eq 'POST') {
if ($ENV{CONTENT_TYPE} =~ /multipart\/form-data/) {
require CGI; import CGI qw(:standard);
my $query = new CGI;
my $zipfile = $query->param('uplzip');
my $tmpfile = $query->tmpFileName($zipfile);
local( $/, *TMP );
open(TMP,"$tmpfile");
my $filedata = <TMP>;
close(TMP);
open(TMP2,">$memberdir/$zipfile");
print TMP2 $filedata;
close(TMP2);
for(my $x=1;$x<=5;$x++) {
$feld = "uplfoto".$x;
my $file = $query->param($feld);
my $tpfl = $query->tmpFileName($file);
local( $/, *TMP );
open(TMP,"$tpfl");
my $filedata = <TMP>;
close(TMP);
open(TMP2,">$memberdir/$file");
print TMP2 $filedata;
close(TMP2);
}
}
else {
read(STDIN, my $input, $ENV{CONTENT_LENGTH});
split_string(\$input, \%FORM)
}
}
$action = $INFO{'action'};
&ToHTML($INFO{'title'}); &ToHTML($FORM{'title'});
&ToHTML($INFO{'subject'}); &ToHTML($FORM{'subject'});
}
Many thanks in advance. I just can't crack this one on my own. It's such a small problem and everything works as it should, but this one is really doing my head in. I need some help from some pro yabbers on this one
My Gallery is
HEREIf you need any more details from me, just shout!