#!/usr/pkg/bin/perl ############################################################################## # photoshow.pl # Define Variables: $template_dir = "/usr/tanelorn/dietrich/public_html/cgi-templates"; # Parse the input parameters: $qstring = $ENV{'QUERY_STRING'}; ($templname, $photolistfile, $photonum) = split(/\?/, $qstring); $TEMPLATEPAGE = "$template_dir/$templname"; $PHOTOLISTFILE = "$template_dir/$photolistfile"; print "Content-type: text/html\n\n"; open(FLTEMPL,"$TEMPLATEPAGE"); @templ=; open(FLPHOTOLIST,"$PHOTOLISTFILE"); @photolist=; if ( $photonum >= 0 || $photonum < scalar(@photolist) ) { # Find the photo file name, caption, and other info for this photo: ( $photofilename, $caption, $hasfullsize ) = split (/\t/, @photolist[$photonum] ); # Go through each line of the template file, ignoring every line that's not in the # or section, and look for the special comment tags: $inbody=0; foreach $line (@templ) { chop $line; if (index($line, "/, $line); print " 0 ) { $photonum_prev = $photonum - 1; print (""); } } elsif (index ($line, "