Skip to content

Commit

Permalink
Smarter loading of skins data
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiemccarthy committed Oct 20, 2004
1 parent e7b2cb1 commit e145d81
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Slash/DB/MySQL/MySQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10484,6 +10484,14 @@ sub getSkins {
my $url_skid = $skins_ref->{$skid}{url} ? $skid : $constants->{mainpage_skid};
my $color_skid = $colors->{$skid} ? $skid : $constants->{mainpage_skid};

# Blank index_handler defaults to index.pl.
$skins_ref->{$skin}{index_handler} ||= 'index.pl';

# Adjust min and max and warn if wacky value.
$skins_ref->{$skin}{artcount_max} = $skins_ref->{$skin}{artcount_min}
if $skins_ref->{$skin}{artcount_max} < $skins_ref->{$skin}{artcount_min};
warn "skin $skid has artcount_max of 0" if !$skins_ref->{$skin}{artcount_max};

# Convert an index_handler of foo.pl to an index_static of
# foo.shtml, for convenience.
($skins_ref->{$skid}{index_static} = $skins_ref->{$skid}{index_handler}) =~ s/\.pl$/.shtml/;
Expand All @@ -10496,7 +10504,8 @@ sub getSkins {

$skins_ref->{$skid}{basedomain} = $skins_ref->{$host_skid}{hostname};

$skins_ref->{$skid}{absolutedir} = $skins_ref->{$url_skid}{url} || "http://$skins_ref->{$skid}{basedomain}";
$skins_ref->{$skid}{absolutedir} = $skins_ref->{$url_skid}{url}
|| "http://$skins_ref->{$skid}{basedomain}";
$skins_ref->{$skid}{absolutedir} =~ s{/+$}{};

my $rootdir_uri = URI->new($skins_ref->{$skid}{absolutedir});
Expand Down

0 comments on commit e145d81

Please sign in to comment.