#! /usr/local/bin/perl # modify above line for your system # frezfram.cgi - by David Efflandt - efflandt@xnet.com 9/11/95 [9/24/95] # # Displays series of images listed in separate file using form push buttons. # Call the script by link or URL. # # Usage: frezfram.cgi?img_list[[+heightt]+width] # Example: frezfram.cgi?foo+50+75 # # Prefix CGI filname with URL_path/ if necessary. # 'img_list' is the filename of the list of images to display (may be same list used for 'pushin.cgi') # 'height', 'width' in pixels [optional, but 'height' (0 for none) req'd for 'width'] # # img_list format per line: $file [$pause] # # img_list and $file: should be in $path defined below. # $pause: is optional and ignored (so server push list may be used). # # foo.gif 3 # displays foo.gif (pause ignored) ### # path/ or /full_path_from_root/ for img_list and images $path = 'img/'; # <--- change to point your image path ### You should not have to change anything below this line ### # Print out a content-type and title print "Content-type: text/html\n\n"; print "Freeze Frame\n"; print "

Manual Slide Show


\n"; # Image list file, height & width from URL $query = $ENV{'QUERY_STRING'}; $query =~ /(\w[^\s\;]*)/; # minimize hacking $query = $1; ($filein, $height, $width) = split(/\+/, $query); $filein = $path.$filein; # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Uncomment for debugging purposes # print "Setting $name to $value

"; $FORM{$name} = $value; } # Current image from form (hidden) if ($FORM{'img'}) { $x = $FORM{'img'} } else { $x = 0; } # Do button press $x += 1 if ($FORM{'next'}); $x -= 1 if ($FORM{'prev'}); $x = 0 if (($x < 0) || $FORM{'first'}); open(IN, $filein) || warn "Can't open image list $filein: $!\n"; $y = 0; while((($x >= $y) || ($FORM{'last'})) && ($item = )) { $item =~ /(.*[^\n\r])/; $item = $1; # Allow server push list to be used, but ignore $pause ($file, $pause) = split (/ /, $item); $file = $path.$file; $y += 1; $x = $y + 1 if ($FORM{'last'}); } close IN; $x = $y-1; $FORM{'last'} = 1 if ($x eq $FORM{'img'}); # Print remainder of page with new current image (hidden image number) print "

\n"; print "No image list file specified.

\n" unless ($query); print " 0); print " width=$width" if ($width > 0); print "\n

\n"; if (($FORM{'first'}) || ($x < 1)) { print ' '; print ' '; } else { print ' '; print ' '; } print "\n"; if ($FORM{'last'}) { print ' '; print ' '; } else { print ' '; print ' '; } print "
\nClick the button for first, previous, next or last image\n"; print "


\n"; print "Second viewing will be quicker if you cache images.
\n"; print ''; print 'My Home Page'; print "\n\n";