;
close fhFooter;
} else {
print "Can't open footer file (", $album->getAttribute ('FOOTER'), ")!";
}
}
# *****
sub PrintIEAlbum {
my ($album) = @_;
print <<"EOF";
This will be set from JavaScript
EOF
PrintDivFolders ($album);
PrintDivPictures ($album);
PrintDivImage ($album);
PrintDivFooter ($album);
print "\n\n";
}
# *******
my $FolderNum = 0;
sub PrintDivFolders {
my ($album) = @_;
print '', "\n";
PrintFolders ($album, -1);
print '
', "\n";
}
sub PrintDivPictures {
my ($album) = @_;
print '', "\n";
PrintPictures ($album);
print '
';
}
sub PrintDivImage {
my ($album) = @_;
print '', "\n";
}
sub PrintDivFooter {
my ($album) = @_;
print '";
}
# *******
sub PrintFolders {
my ($folder, $level) = @_;
my $title = $folder->getAttribute ('TITLE');
print "\t" x $level, '', ' ' x (($level-1)*5), ' | $title |
\n"
if ++$level;
my $children = $folder->getChildNodes ();
for (0..$children->getLength ()-1) {
my $child = $children->item ($_);
PrintFolders ($child, $level)
if $child->getNodeName eq 'FOLDER';
}
}
$Pic = 0;
sub PrintPictures {
my ($folder) = @_;
my $children = $folder->getChildNodes ();
# expand sub-folders
for (0..$children->getLength ()-1) {
my $child = $children->item ($_);
PrintPictures ($child)
if $child->getNodeName eq 'FOLDER';
}
# Now print the pictures
print '
';
# Annotation
for (0..$children->getLength ()-1) {
my $child = $children->item ($_);
next if $child->getNodeName () ne 'ANNOTATION';
print '', $child->getFirstChild ()->getData (), " |
\n";
}
# The pictures
my $PicCount = 0;
for (0..$children->getLength ()-1) {
my $child = $children->item ($_);
next if $child->getNodeName () ne 'PICTURE';
$PicCount++;
$Pic = !$Pic;
print ' | getAttribute ('HREF'), '"); return false;', "'>",
$child->getFirstChild ()->getData (), " |
\n";
}
print "
\n";
print "No pictures in this folder."
if !$PicCount;
print "
\n";
}
__END__
=head1 DESCRIPTION
This simple script can be used for organizing web photo album. The script can be used for online or Off-Line
photo album generation. It does not provides web interface for picture uploading, thumbnail generation or web
authoring of the album. Those tasks you will have to do using standard image processing tools and ftp. However it generates
rather nice browsable photo album.
Those are XPhotoAlbum features:
=over
=item *
Support threee different alum viewing modes:
=over
=item 1
Three pane DHTML (client side) browsing.
=item 2
Thumbnail based album.
=item 3
Plain text outline for outdated browsers.
=back
=item *
Generate album dynamically from index XML file
=item *
Support dynamic clients side album
=item *
For the 1st two modes are supported only with Internet Explorer.
=item *
Plain text album is supported on all browsers.
=item *
Support international (Unicode based) text within album.
=back
=head1 USAGE
=over
=item 1
Put the script in your cgi-bin directory.
=item 2
Edit the script to set script parameters to your configuration
=over
=item *
$UrlBase = '/cgi-bin/XPhotoAlbum.pl'; # path to the album script from web server root.
=back
=item 3
Refer to the script as:
I&type=B> to be translated.
=over
=item *
B - is relative url to the XML file with the album index.
=item *
B - is one of the three album types:
=over
=item a.
B - Three pane DHTML (client side) browsing (Internet Explorer only).
=item b.
B - Thumbnail based album (Internet Explorer only).
=item c.
B - Plain text outline (all browsers).
=back
=back
=back
=head1 XML Index File Format
Please see the examples below to understand the format of the files.
However one nuance must be noticed regarding the thumbnail image files.
Thumbnails shiuld be placed in the directory B under image path. Thumbnail image names are derrived
from regular images names appending B<_thumb> before file extension. For example
for file B<~john/Image.JPG> thumbnils is sought under B<~john/thumb/Image_thumb.JPG>.
=head1 CAVEATS
Send your feedback...
=head1 TIPS AND TRICKS
Send your feedback...
=head1 EXAMPLES
Please see http://www.neystadt.org/ for three instances of the albums using this technology.
Particulary examples of the XML index files are located at:
http://www.neystadt.org/gal/birth/index.xml
http://www.neystadt.org/john/album/index.xml
http://www.neystadt.org/leonid/album.xml
=head1 PREREQUISITES
This script requires the C, C
modules available from CPAN (http://www.cpan.org)
=pod OSNAMES
All UNIXes, Windows NT
=pod SCRIPT CATEGORIES
Web
=pod README
This simple script can be used for organizing web photo album. The script can be used for online or Off-Line
photo album generation. It does not provides web interface for picture uploading, thumbnail generation or web
authoring of the album. Those tasks you will have to do using standard image processing tools and ftp. However it generates
rather nice browsable photo album.
=cut