#!/usr/bin/perl use Cwd; use File::Basename; # CHANGE LINE ABOVE IF NECESSARY TO LOCATION OF YOUR PERL INTERPRETER. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # WebImageLister 1.0 # -------------------- # A no-frills VERY simple but VERY effective, easy-to-install Perl # script to display .GIF, .JPG, .JPEG, .PNG and .BMP images in a table # as clickable thumbnails from a single web directory. # # Defaults: Thumbnails -- 80 pixels wide. Table width -- 7 columns. # # IMPORTANT: Lines in ALL CAPS indicate where changes can or *must* be made # to customize script for your system and/or preferences. # # Script must be run from a cgi-bin directory on the web server. # # Source of script: http://www.10xshooters.com/webimagelister # # Adapted by Henry Baker from a generic script found somewhere on the Web. # Website: http://www.10xshooters.com/webimagelister # Email: hbaker@ipa.net # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $pos=0; $upname=""; $count=0; # YOU *MUST* CHANGE THIS URL *BETWEEN* THE QUOTE MARKS TO YOUR IMAGE DIRECTORY. # BE SURE TO INCLUDE THE TRAILING SLASH. #$imgpath="http://www.tripletransam.com/78ta/2010/w72/"; $imgpath="./"; # UNIX SYSTEM PATH (DEFAULT) # ---------------------------- # YOU *MUST* CHANGE THE PATH BELOW *BETWEEN* THE QUOTE MARKS (the ALL CAPS STUFF) # TO POINT TO YOUR IMAGE DIRECTORY. my $current = getcwd; my $directoryBase = basename($current); #opendir(curdir,"../../../../../public_html/tripletransam/78ta/2010/w72/")||die("Cannot open Directory!"); opendir(curdir,$current)||die("Cannot open Directory!"); # NT SYSTEM PATH (CHANGE FOR AN NT SERVER) # ------------------------------------------ # FOR AN NT SYSTEM CHANGE THIS PATH *BETWEEN* THE QUOTE MARKS TO POINT TO # YOUR IMAGE DIRECTORY. REMOVE THE COMMENT POUND SIGN (#) BEFORE IT AND # PLACE A COMMENT POUND SIGN BEFORE THE UNIX SYSTEM PATH ABOVE. # opendir(CURDIR,"E:\\www\\images\\clipart\\")||die("Cannot open Directory!"); @names=sort(readdir(curdir)); print "content-type: text/html", "\n\n"; # CHANGE TEXT BETWEEN TITLE TAGS TO REFLECT YOUR HTML PAGE TITLE: print "