#!/usr/bin/local/perl -w ##################################################### # Slide Viewer # # Author:- Dr.Nagender Sangra # # Created on :- 1 August,2000 # # Last Updated:-10 August,2000 # # Current Version:- 1.0 # # URL:- http://www.nagender.com/ # # Send bug reports/suggestions to nagender@vsnl.com # ##################################################### use CGI qw/ :standard :html3/; ############### Editable variables ################### $cgi_path='http://www.strops.lv/Readdir.pl'; # Path to cgi script $rootdir='/home/httpd/html'; # Path to server root dir $title='Slide Viewer v 1.0'; # Title of Slideshow $file_type='gif|jpg'; # Type of files to be shown $images_dir='/G'; # Dir containing button gifs ############## End of Editable variables ############# if ($ENV{'REQUEST_METHOD'} eq "GET") { $input=$ENV{'QUERY_STRING'}; # Checking environment variables ($query,$stop,$dir,$loop,$refresh)=split(/&/,$input); # splitting name=value pairs } if ($ENV{'REQUEST_METHOD'} eq "POST") { $stop=param('mode'); $dir=param('album'); $loop=param('loop'); $refresh=param('refresh'); } $dir='G'; #mana, N opendir(DIR,$dir) or error("Could not open the directory:$dir"); # Open images dir @files = grep{/$file_type/i} readdir(DIR); # and put given types into array closedir(DIR); # close dir if($query >($last_image=(scalar(@files)-1))){ if ($loop == 0) { $query=0; } else { &goodbye(); exit; } } # Check, if last photo exit ($slidedir)=$dir=~/$rootdir(.+)/; print header; # print html header $new=$query+1; # Setting value for next image $prev=$query-1; # Setting value for previous image print ""; if (!$stop){ # Check the toggle status of Play/Stop button and adds meta if play is active print ""; } print " $title "; print "

$title


Rewind "; # Prints the Navigation buttons alongwith their variables print "Atpakaļ "; print "";#  ";# BORDER=0> print "Uz priekšu "; print "Beigas
 "; print "

$files[$query]
"; # Prints footer print '

This script has been written by Dr.Nagender Sangra of nagender.com'; sub error { my ($message); $message=join('',@_); print header; # print html header print "Error Message is $message"; } sub goodbye { # Show End page print "Content-type: text/html \n\n"; print < Hope you enjoy the slideshow

That's all folks

End }