options: -known_images
options: -geometry 150x225
#c// ##################################################
#c// The index frame
#c// ##################################################
<:
# Path setting - this is the path to the images
   $PATH = Theme_URL();
:>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Album: <: Path('album_name') :></title>
    <: Meta() :>
  </head>

  <frameset cols='170,*'>
    <noframes><body>
      You will have the best experience with Frames!
	<br /> However, you can see the content of this album <a href='Thumbs.html'>here</a>
		<br />
	or
	<br />
	Look at the sub-albums <a href='Albums.html'>here</a>
    </body>
    </noframes> 

    <frame scrolling='auto' src='Thumbs.html' />
    <frame marginwidth='10' scrolling='auto' name='Photo' src='Albums.html' frameborder="0" />
  </frameset>

</html>

<:
  # Write the Title.html and Thumbs.html
  my $album = Path('album_file');
  my $path = $album;  $path =~ s|[^/]+$||;
  $path = "." unless $path;

  sub PrintChildAlbum {
    my $obj = get_obj($CHILD_ALBUM_CNT,'dirs');
    my $name = Name($obj);
    my $url = Get($obj,'URL','dir');
    print "<a target='_top' href=$url>$name</a>";
  }

  sub ParentAlbum {
    my @PARENT_ALBUMS = @{Path('parent_albums')};
    return "" unless Parent_Albums_Left() > 0;
    if ($PARENT_ALBUM_CNT == num('parent_albums')-1) {
      return "<a href='Albums.html'>$PARENT_ALBUMS[$PARENT_ALBUM_CNT]</a>" unless Image_Page();
      return "<a target='_top' href='../".Option('index')."'>$PARENT_ALBUMS[$PARENT_ALBUM_CNT]</a>";
    }
    my$str = "<a target='_top' href='";
    $str .=   "../"x(Parent_Albums_Left() - (Image_Page()?0:1));
    $str .=   Option('index');
    $str .=   "'>$PARENT_ALBUMS[$PARENT_ALBUM_CNT]</a>";

    return $str;
  }

:>

#c//
#c// ##################################################
#c// Albums.html
#c// ##################################################
<:
  open(STDOUT,">$path/Albums.html") || die("Theme can't write [$path/Albums.html]\n");
:>

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title>Album: <: pAlbum_Name() :></title>
    <: Meta() :>
    <base target="_parent" />
  </head>

  <body bgcolor="white">

  <: if (isHeader()) { _:>
    <br/>
    <center>              
      <:pHeader():>         
    </center>
  <: } _:>

#c// Are there more albums below this one?
  <: if (Child_Albums()) { _:>
    <br/>
    <font size='+2'><i>More albums:</i></font>
    <br/>
    <ul>  
#c// Loop on all the albums
      <: while (Child_Albums()) { _:>
        <li>
        <font size='+1'>
          <: PrintChildAlbum() :>
        </font></li>
        <: Next_Child_Album() :>
      <: } _:>
    </ul>

#c// No child albums
  <: } else { _:>
    <br/>
    <font size='+2'><i>No child albums</i></font>
    <br/>
  <: } :>

  <: if (isFooter()) { _:>
    <center>              
      <:pFooter():>         
    </center>
    <br/>
  <: } _:>

  <hr/>
  <font size='-1'>
    <: Credit() :> on <:=scalar localtime:>
  </font>

  </body>
</html>

<: close STDOUT :>

#c// ##################################################
#c// Thumbs.html
#c// ##################################################

<:
  open(STDOUT,">$path/Thumbs.html") || die("Theme can't write [$path/Thumbs.html]\n");
:>

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title>Album: <:=pAlbum_Name():></title>
    <: Meta() :>
    <base target="Photo" />
  </head>

  <body bgcolor="white">
    <h5>Path</h5>
    <font size="-1">
    <: while(Parent_Albums_Left() > 0) {
         print ParentAlbum();
         Next_Parent_Album();
         print "<br/>\n";
       }
    _:>
    </font>

    <: if (Child_Albums()) { _:>
      <h2><a href='Albums.html'>Children</a></h2>
    <: } _:>

    <: if (Images()) { _:>
      <h5>Images</h5>

#c      <: while(Images()) { _:>
#c        <:pImage():>
#c       <br/>
#c        <font size='-2'>
#c          <:pImage_Caption():>
#c        </font>
#c        <br/>
#c        <br/>
<:    while(Images()) { _:>
	<table border='0' cellpadding='0' cellspacing='0'>
		<tr>
<: $th=Image_Height();
   $tw=Image_Width();
   $tnwidth="120";
   $scale=$tnwidth/$tw;
   if ($tw < $th){:>
			<td rowspan='3'><img height='<:=int($th*$scale)+14:>' width='10' src='<:=$PATH:>/ThBord_long_L.gif'></td>
			<td><img height='7' width='<:=$tnwidth:>' src='<:=$PATH:>/ThBord_T.gif'></td>
			<td rowspan='3'><img height='<:=int($th*$scale)+14:>' width='10' src='<:=$PATH:>/ThBord_long_L.gif'></td>
 <:}else{:>
			<td rowspan='3'><img height='<:=int($th*$scale)+14:>' width='10' src='<:=$PATH:>/ThBord_L.gif'></td>
			<td><img height='7' width='<:=$tnwidth:>' src='<:=$PATH:>/ThBord_T.gif'></td>
			<td rowspan='3'><img height='<:=int($th*$scale)+14:>' width='10' src='<:=$PATH:>/ThBord_R.gif'></td>
<:}:>
		</tr>
		<tr>
			<td style="text-align: center;">
<a href=<:=$picdata->{URL}{album_page}{image}:>><img border='0' width='120' src=<:=$picdata->{URL}{album_page}{thumb}:>></a>
#c<:pImage(0):></td>
		</tr>
		<tr>
			<td><img height='7' width='<:=$tnwidth:>' src='<:=$PATH:>/ThBord_B.gif'></td>
		</tr>
	</table>

        <:Next_Image():>
      <: } _:>
    <: } _:>
  </body>
</html>

<: close STDOUT; :>
