<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
#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.04
#c// -- From: http://MarginalHacks.com/Hacks/album/
#c// ###################################################################
#c//
<:

  # Path setting - this is the path to the images
  $PATH = Theme_URL();

  # Font/color settings for the document
  $TITLE_FONT = "size='4' color='#555555' face='Times New Roman,Georgia,Times'";
  $MAIN_FONT = "face='Times New Roman,Georgia,Times'";
  $CREDIT_FONT = "size='-1' face='Verdana' color='#555555'";
  $BODY = "bgcolor='#ffffff' link='#999999' alink='#999999' vlink='#999999' text='#555555'";

$START_TITLE = "<font $TITLE_FONT>";
$START_MAIN = "<font $MAIN_FONT>";
$START_CREDIT = "<font $CREDIT_FONT>";
$END_FONT = "</font>";
  # Icons/graphics
  @Bar_L =	("$PATH/Bar_L.gif", 42, 53);
  @Bar_ML =	("$PATH/Bar_ML.gif", '100%', 53);
  @Bar_MR =	("$PATH/Bar_MR.gif", '100%', 53);
  @Bar_M =	("$PATH/Bar_M.gif", 94, 53);
  @Bar_R =	("$PATH/Bar_R.gif", 49, 53);
  @Icon =	("$PATH/Icon.gif", 114, 45);
  @Back =	("$PATH/Back.gif", 50, 34);
  @Next =	("$PATH/Next.gif", 37, 37);
  @Prev =	("$PATH/Prev.gif", 37, 37);
sub Bar {
  my ($colspan) = @_;
  return unless @Bar_M;
:>
			<tr>
				<td colspan='<:=$colspan:>' height="<:=$bar_H:>">
					<table cellpadding=0 cellspacing=0 width='100%'>
						<tr>
<: 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<td $width>";
     print Image_Array(@$bar);
     print "</td>\n";
} :>
						</tr>
					</table>
				</td>
			</tr>
<:
}

  @Bord_LT =	("$PATH/Bord_LT.gif", 25, 9);
  @Bord_RT =	("$PATH/Bord_RT.gif", 25, 9);
  @Bord_LB =	("$PATH/Bord_LB.gif", 25, 8);
  @Bord_RB =	("$PATH/Bord_RB.gif", 25, 8);
  @Bord_L =	("$PATH/Bord_L.gif", 25, 38);
  @Bord_R =	("$PATH/Bord_R.gif", 25, 47);
  @Bord_TL =	("$PATH/Bord_TL.gif", 30, 20);
  @Bord_TR =	("$PATH/Bord_TR.gif", 30, 20);
  @Bord_BL =	("$PATH/Bord_BL.gif", 28, 19);
  @Bord_BR =	("$PATH/Bord_BR.gif", 31, 19);
  @Bord_T =	("$PATH/Bord_T.gif", 30, 20);
  @Bord_B =	("$PATH/Bord_B.gif", 76, 19);

  # Thumbnail border

  @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;

  # Thumbnail border

  @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;

  # Thumbnail border

  @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;

  # Thumbnail border

  @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;

  # Thumbnail border

  @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;

  # Thumbnail border

  @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)."%";

:>//
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
		<meta http-equiv="Content-Style-Type" content="text/css">
		<: Meta() :>
		<title>Album: <:= Path('album_name') :></title>
    <:= $CSS :>
	</head>

	<body <:=$BODY:>>
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td colspan="<:=($Cols-1):>" height="10"><:=Image_Array("$PATH/Null.gif",11,10):></td>
			</tr>
			<tr>
				<td colspan="<:=($Cols-1):>">
					<:=$START_TITLE:>
<: if (@Icon) {
          print Image_Array(@Icon,"align='middle'");
					print "\n<br />&nbsp;&nbsp;&nbsp;&nbsp;\n";
   } else {
					print "<b>Album:</b>\n";
   } _:>
					<:= Parent_Albums(':'); :>
					<:=$END_FONT:></td>
				<td valign='top' width="25%">
					<div align="right">
						<:
							$back=Back();
							if ($back && $back ne "''" && $back ne "'0'") {
								print "$START_TITLE";
								print "<a href=$back>";
								print @Back ? Image_Array(@Back,"align='middle'") : "Back";
								print "</a>\n";
								print "$END_FONT";
							}
						:>
					</div>
				</td>
			</tr>
<: if ($Dir_Thumbs && isHeader()) { _:>
			<tr>
				<td colspan="<:=$Cols:>">
					<br />
					<center>
						<:=$START_MAIN:>
						  <:pHeader():>
						<:=$END_FONT:>
					</center>
				</td>
			</tr>
<: } _:>
<: Bar($Cols) :>
			<tr>
				<td colspan="<:=$Cols:>"><:=Image_Array("$PATH/Null.gif",20,10):></td>
			</tr>

#c// Are there more albums below this one?
<:
  my $alb = First('dirs');
  if ($alb) { _:>
			<tr>
				<td colspan="<:=$Cols:>">

	<table width='100%' align='center' cellspacing='3'>
		<tr>
<:    if (!$Dir_Thumbs) { :>
        <td width='50%'>
        <:=$START_TITLE:>
		      <:= @More ? Image_Array(@More) : "<b>Folders</b>:" :>
		      <br />
				<:=$END_FONT:>
		    <:=$START_MAIN:>
<:    } elsif (@More) { :>
			<td height='50' align='center' width='<:=$Col_Perc:>' valign='top'>
				<:=Image_Array(@More):>
			</td>
<:    } :>
#c//
#c// Loop on all the albums
<:  my @save;
    while ($alb) {
      if ($Dir_Thumbs) {
_:>
			<td align='center' width='<:=$Col_Perc:>' valign='bottom'>
					<: PickOverlay($alb, 'thumb') if @Overlays :>
					<: Border($alb, 'thumb','dir', @Border) if Get($alb,'thumb','x') :>
          <: push(@save,$alb); :>
			</td>
<:      if (New_Row($alb,$Cols,@More?1:0) || !Next($alb)) { _:>
		</tr><tr>
<:        foreach my $save ( @save ) { _:>
      <:= "<td></td>\n" unless !@More || Get($save,'num') :>
			<td align='center' width='<:=$Col_Perc:>' valign='top'>
				<:=$START_MAIN:>
				 	<:= Image_Array( (-e Get($save,'path').'/.htaccess') ? @Locked : @NotLocked) :>
					<:=Get($save,'href','dir'):>
					<:=Pretty(Name($save),1,1):></a>
					<: my $cap = Caption($save);
					   my $num_pics = Get($save,'num_pics');
					   $num_pics = $num_pics ? $num_pics>1 ? "$num_pics images\n" : "1 image\n" : "";
					   my $num_dirs = Get($save,'num_dirs');
					   $num_dirs = $num_dirs ? $num_dirs>1 ? "$num_dirs albums\n" : "1 album\n" : "";
					   if ($cap || $num_pics || $num_dirs) { _:>
						<br />
						<font size='-2'>
						<:=$cap if $cap:>
						<:="<br />" if $cap && ($num_pics || $num_dirs):>
						<:=$num_dirs:>
						<:=", " if $num_pics && $num_dirs:>
						<:=$num_pics:>
						</font>
          <: } :>
				<:=$END_FONT:>
<:
          } # end foreach $save
          undef @save;
          if (New_Row($alb,$Cols,@More?1:0)) { _:>
		</tr><tr>
<:
          } # end new row
        } # end printing of $save
      # end if $Dir_Thumbs
      } else {
				 	print Image_Array( (-e Get($alb,'path').'/.htaccess') ? @Locked : @NotLocked);
					print Get($alb,'href','dir');
					print Pretty(Name($alb),1,1), "</a>";
					my $cap = Caption($alb);
# Actually, the current album code doesn't set 'num_pics' if dir_thumb isn't
# set, but I'll leave this here in case that changes.
					my $num_pics = Get($alb,'num_pics');
					$num_pics = $num_pics ? $num_pics>1 ? "$num_pics images\n" : "1 image\n" : "";
					my $num_dirs = Get($alb,'num_dirs');
					$num_dirs = $num_dirs ? $num_dirs>1 ? "$num_dirs albums\n" : "1 album\n" : "";
					if ($cap || $num_pics || $num_dirs) { _:>
						&nbsp;
						<font size='-2'>
						<:=$cap if $cap:>
						<:=": " if $cap && ($num_pics || $num_dirs):>
						<:=$num_dirs:>
						<:=", " if $num_pics && $num_dirs:>
						<:=$num_pics:>
						</font>
          <: }
				print "<br />\n";
      } # end not $Dir_Thumbs
      $alb = Next($alb);
    } # End child album loop
_:>

<:    if (!$Dir_Thumbs) { :>
        <:=$END_FONT:>
      </td>
      <td>
				<center>
					<:=$START_MAIN:>
					  <:pHeader():>
					<:=$END_FONT:>
				</center>
      </td>
<:    }
:>//
		</tr>
	</table>

				</td>
			</tr>

#c// Bar after child albums
<: Bar($Cols) :>

#c//
#c// End if albums
<:  } :>

#c//
#c// The images
<:
  my $img = First('pics');
  if ($img) { _:>//
			<tr>
<:  my @save;
    while ($img) {
_:>
				<td align='center' valign='bottom' width='<:=$Col_Perc:>'>
					<: PickOverlay($img, 'thumb') if @Overlays :>
					<: Border($img,'thumb','image', @Border) if Get($img,'thumb','x') :>
          <: push(@save,$img); :>
			  </td>

<:    if (New_Row($img,$Cols) || !Next($img)) { _:>
		</tr><tr>
<:      foreach my $save ( @save ) { _:>
				<td align='center' valign='top' width='<:=$Col_Perc:>'>
				  <:=$START_MAIN:>
					<:=Get($save,'href','image'):>
					<:=Pretty(Name($save),1,1):></a>
					<: if (my $cap = Caption($save)) { _:>
						<br />
						<font size='-2'>
						<:=$cap:>
						</font>
					<: } :>
					<:=$END_FONT:>
				</td>
<:
        }
        undef @save;
        if (New_Row($img,$Cols)) { _:>
			</tr>
			<tr>
				<td height="20" colspan="<:=$Cols:>"><:=Image_Array("$PATH/Null.gif",20,20):></td>
			</tr>
			<tr>
<:
        }
      }
      $img = Next($img);
    } # End child album loop
_:>

			</tr>
			<tr>
				<td height="20" colspan="<:=$Cols:>"><:=Image_Array("$PATH/Null.gif",20,20):></td>
			</tr>

<: Bar($Cols) :>

<:}:>//

<: if (isFooter()) { _:>
			<tr>
				<td colspan="<:=$Cols:>">
					<br />
					<center>
						<:pFooter():>
					</center>
				</td>
			</tr>

<: Bar($Cols) :>

<: } _:>

			<tr>
				<td colspan="<:=$Cols:>">
					<div align="center">
						<:=$START_CREDIT:><: Credit() :> on <:=scalar localtime:><:=$END_FONT:></div>
				</td>
			</tr>
		</table>
		<p></p>
	</body>

</html>
