#c// ################################################################### #c// Album Theme by David Ljung Madison #c// Design by Dave Simmer of DaveWeb.com, modified by Dave Madison #c// -- Auto generated by simmer_theme v3.12 #c// -- From: http://MarginalHacks.com/Hacks/album/ #c// ################################################################### #c// <: # Version requirements if (Version_Num() < 3.10) { print STDERR "\n[THEME ERROR] This theme requires album v3.10\n"; exit(-1); } # Path setting - this is the path to the images $PATH = Theme_URL(); $CSS = ""; $CSS .= "\n "; $BODY=""; $START_TITLE = ""; $START_MAIN = ""; $START_CREDIT = ""; $END_FONT = ""; $SLIDESHOW = Option('slideshow'); # Icons/graphics @Bar_L = ("$PATH/Bar_L.gif", 5, 3); @Bar_M = ("$PATH/Bar_M.gif", '100%', 3); @Bar_R = ("$PATH/Bar_R.gif", 5, 3); @Locked = ("$PATH/Locked.gif", 12, 10); @NotLocked = ("$PATH/NotLocked.gif", 12, 10); @RSS = ("$PATH/RSS.png", 16, 16); sub Bar { my ($colspan) = @_; return unless @Bar_M; :> <: foreach my $bar ( \@Bar_L, \@Bar_ML, \@Bar_M, \@Bar_MR, \@Bar_R ) { next unless @$bar; my $width = $bar->[1] =~ /100%/ ? "" : " width='$bar->[1]'"; print "\t\t\t\t\t\t\t\n"; } :>
"; print Image_Array(@$bar); print "
<: } # Overlays push(@Overlays, ["$PATH/Overlay.1.png", 570, 445]); push(@Overlays, ["$PATH/Overlay.2.png", 570, 445]); push(@Overlays, ["$PATH/Overlay.3.png", 570, 445]); push(@Overlays, ["$PATH/Overlay.4.png", 570, 445]); push(@Overlays, ["$PATH/Overlay.5.png", 445, 570]); push(@Overlays, ["$PATH/Overlay.6.png", 445, 570]); push(@Overlays, ["$PATH/Overlay.7.png", 445, 570]); push(@Overlays, ["$PATH/Overlay.8.png", 445, 570]); push(@Overlays, ["$PATH/Overlay.tn.1.png", 133, 100]); push(@Overlays, ["$PATH/Overlay.tn.2.png", 133, 100]); push(@Overlays, ["$PATH/Overlay.tn.3.png", 133, 100]); push(@Overlays, ["$PATH/Overlay.tn.4.png", 133, 100]); push(@Overlays, ["$PATH/Overlay.tn.5.png", 100, 133]); push(@Overlays, ["$PATH/Overlay.tn.6.png", 100, 133]); push(@Overlays, ["$PATH/Overlay.tn.7.png", 100, 133]); push(@Overlays, ["$PATH/Overlay.tn.8.png", 100, 133]); # Come up with a 'distance' of ratio/size closeness sub OverlayErr { my ($x,$y,$overlay) = @_; my $ox = $overlay->[1]; my $oy = $overlay->[2]; my $err = abs($x-$ox)/$x; $err += abs($y-$oy)/$y; $err += abs(($x/$y)-($ox/$oy))/($x/$y); $err; } srand(time^$$); sub PickOverlay { my ($img, $type) = @_; my $x = Get($img,$type,'x'); return unless $x; my $y = Get($img,$type,'y'); # Find the lowest error my $besterr = undef; foreach my $overlay ( @Overlays ) { my $err = OverlayErr($x,$y,$overlay); next if defined $besterr && $besterr<$err; $besterr = $err; } # Now find a list of overlays that are close to that error $besterr *= 1.05; # Err or within 5% <- HEURISTIC! my @best = grep { OverlayErr($x,$y,$_) <= $besterr; } @Overlays; # Pick one randomly and apply it Overlay($img,$type,'full', $best[int(rand($#best+1))]); } # Thumbnail border @Bord_LT = ("$PATH/Bord_LT.gif", 16, 13); @Bord_RT = ("$PATH/Bord_RT.gif", 16, 13); @Bord_LB = ("$PATH/Bord_LB.gif", 16, 13); @Bord_RB = ("$PATH/Bord_RB.gif", 16, 13); @Bord_L = ("$PATH/Bord_L.gif", 16, 74); @Bord_R = ("$PATH/Bord_R.gif", 16, 74); @Bord_TL = ("$PATH/Bord_TL.gif", 30, 16); @Bord_TR = ("$PATH/Bord_TR.gif", 30, 16); @Bord_BL = ("$PATH/Bord_BL.gif", 30, 16); @Bord_BR = ("$PATH/Bord_BR.gif", 30, 16); @Bord_T = ("$PATH/Bord_T.gif", 72, 16); @Bord_B = ("$PATH/Bord_B.gif", 72, 16); @Border = (\@Bord_TL,\@Bord_T,\@Bord_TR,\@Bord_RT,\@Bord_R,\@Bord_RB,\@Bord_BR,\@Bord_B,\@Bord_BL,\@Bord_LB,\@Bord_L,\@Bord_LT) unless @Border; :>// #c// #c// ################################################################### #c// Everything beyond here is the same for every DaveWeb theme.. #c// ################################################################### <: # Shorthand for column info specified by -columns $Dir_Thumbs = Option('dir_thumbs'); $Cols = Option('columns'); $Col_Perc = int(100/$Cols)."%"; :>// <: Meta() :> <:= Trans('Album:') :> <:= Path('album_name') :> <:= $CSS :> <:Body_Tag():>> <: if ($Dir_Thumbs && isHeader()) { _:> <: } _:> <: Bar($Cols) :> #c// Are there more albums below this one? <: my $alb = First('dirs'); if ($alb) { _:> #c// Bar after child albums <: Bar($Cols) :> #c// #c// End if albums <: } :> #c// #c// The images <: my $img = First('pics'); if ($img) { _:>// <: my @save; while ($img) { _:> <: if (New_Row($img,$Cols) || !Next($img)) { _:> <: foreach my $save ( @save ) { _:> <: } undef @save; if (New_Row($img,$Cols)) { _:> <: } } $img = Next($img); } # End child album loop _:> <: Bar($Cols) :> <:}:>// <: if (isFooter()) { _:> <: Bar($Cols) :> <: } _:>
<:=Image_Array("$PATH/Null.gif",11,10):>
<:=$START_TITLE:> <: if ($Icon) { print Image_Ref($Icon,"align='middle'"); print "\n
    \n"; } else { print "".Trans('Album:')."\n"; } _:> <:= Parent_Albums(':'); :> <:=$END_FONT:>
<: $back=Back(); if ($back && $back ne "''" && $back ne "'0'") { print "$START_TITLE"; print ""; print $Back ? Image_Ref($Back,"align='middle'") : Trans('Up'); print "\n"; print "$END_FONT"; } my $rss = Option('extra/rss2.alp:feedFilename') || Option('extra/rss.alp:feedFilename'); print "".Image_Array(@RSS)."\n" if $rss && $RSS[0]; :>

<:=$START_MAIN:> <:pHeader():> <:=$END_FONT:>
<:=Image_Array("$PATH/Null.gif",20,10):>
<: if (!$Dir_Thumbs) { :> <: } :> #c// #c// Loop on all the albums <: my @save; while ($alb) { if ($Dir_Thumbs) { _:> <: if (New_Row($alb,$Cols,$More?1:0) || !Next($alb)) { _:> <: foreach my $save ( @save ) { _:> <:= "\n" unless !$More || Get($save,'num') :> <: } # end foreach $save undef @save; if (New_Row($alb,$Cols,$More?1:0)) { _:> <: } # end new row } # end printing of $save # end if $Dir_Thumbs } else { print Image_Array( (-e Get($alb,'path').'/.htaccess') ? @Locked : @NotLocked); print "\n"; print Get($alb,'href','dir'); print Pretty(Name($alb),1,1), ""; print "\n"; my $cap = Caption($alb); my $num_pics = Get($alb,'num_pics_str'); my $num_dirs = Get($alb,'num_dirs_str'); if ($cap || $num_pics || $num_dirs) { _:>   <:=$cap if $cap:> <:=": " if $cap && ($num_pics || $num_dirs):> <:=$num_dirs:> <:=", " if $num_pics && $num_dirs:> <:=$num_pics:> <: } print "
\n"; } # end not $Dir_Thumbs $alb = Next($alb); } # End child album loop _:> <: if (!$Dir_Thumbs) { :> <:=$END_FONT:> <: } :>//
<:=$START_TITLE:> <:= $More ? Image_Ref($More) : "".Trans('More albums:')."" :>
<:=$END_FONT:> <:=$START_MAIN:> <: } elsif ($More) { :>
<:=Image_Ref($More):> <: PickOverlay($alb, 'thumb') if @Overlays :> <: Border($alb, 'thumb','dir', @Border) if Get($alb,'thumb','x') :> <: push(@save,$alb); :>
<:=$START_MAIN:> <:= Image_Array( (-e Get($save,'path').'/.htaccess') ? @Locked : @NotLocked) :> <:=Get($save,'href','dir'):> <:=Pretty(Name($save),1,1):> <: my $cap = Caption($save); my $num_pics = Get($save,'num_pics_str'); my $num_dirs = Get($save,'num_dirs_str'); if ($cap || $num_pics || $num_dirs) { _:>
<:=$cap if $cap:> <:="
" if $cap && ($num_pics || $num_dirs):> <:=$num_dirs:> <:=", " if $num_pics && $num_dirs:> <:=$num_pics:>
<: } :> <:=$END_FONT:>
<:=$START_MAIN:> <:pHeader():> <:=$END_FONT:>
<: PickOverlay($img, 'thumb') if @Overlays :> <: Border($img,'thumb','image', @Border) if Get($img,'thumb','x') :> <: push(@save,$img); :>
<:=$START_MAIN:> <:=Get($save,'href','image'):> <:=Pretty(Name($save),1,1):> <: if (my $cap = Caption($save)) { _:>
<:=$cap:>
<: } :> <:=$END_FONT:>
<:=Image_Array("$PATH/Null.gif",20,20):>
<:=Image_Array("$PATH/Null.gif",20,20):>

<:pFooter():>
<:=$START_CREDIT:><: Credit() :> on <:=scalar localtime:><:=$END_FONT:>