#!/usr/bin/perl $title = "MyManFriday Premier Sale Photo Gallery"; # This is the title of your page $bgcolor = "ffffff"; # This is the background color for the pages this script creates $border = "6"; # This is the size of the border you want around the large images. $dir_url = "http://mymanfriday.com/4sale/images"; # This is the url to the directory where the full size images are. $tn_dir_url = "http://mymanfriday.com/4sale/thumbnails"; # This is the url to the directory where the thumbnail images are. # The thumbnail images MUST have the same name as the full size images. $tn_dir = "/home/mymanfr/www/4sale/thumbnails"; # This is the path to the directory where the thumbnail images are. $caption_file = "/home/mymanfr/www/4sale/captions.dat"; # This is the full path (including the file name to the captions file) of # the caption file if you choose to use one. Only images in the caption file # will be displayed. If you don't want captions leave this blank, and the # script will display every image in the $tn_dir and none will have captions. $script_name = "4sale.cgi"; # This is the script name, as you have it on your server. $header = <

Your search is over! - MORE PHOTOS TO FOLLOW ON 3/5/09 - Photo Gallery
BEST DEAL IN CITRUS SPRINGS. (Minutes from El Diablo golf course and Withlacoochee river boat ramp). Newly renovated 3/1.5 block home available immediately. NEW (wood floors, appliances, kitchen cabinets, bathrooms, paint) both CENTRAL HVAC & window AC. \$51,500. Please call for details (352) 427-2700.
EOM 1; # This is where you put the html that goes in the header. Everything MUST # be after and before You DO NOT # need to put a backslash (\) before quotation marks or @ symbols. $footer = < EOM 1; # This is where you put the html that goes in the footer. Everything MUST # be after and before . You DO NOT # need to put a backslash (\) before quotation marks or @ symbols. # # That's it! # You must get my permission by e-mail (mwheeler@command-o.com) # to change anything below this point. ##################################### if ($ENV{'QUERY_STRING'} eq ""){ &table; exit; } else { &display; exit; } ######################### # Display requested picture sub display { $file = "$ENV{'QUERY_STRING'}"; print "Content-type: text/html\n\n"; print "$title: $file\n"; print "\n"; print "$header\n"; print "



\n"; print "$footer\n"; print "\n"; } ####################### # Make table page sub table { if ($caption_file ne "") { open(CAPS,"$caption_file"); while () { chop; ($key,$value) = split(/:/); $photos{$key} = $value; } close(CAPS); foreach (sort keys %photos) { push (@tnlist,$_); push (@captions,$photos{$_}); } } else { opendir (TN, "$tn_dir"); rewinddir (TN); @tnlist = grep(!/^\.\.?$/, readdir (TN)); closedir (TN); $temp = pop @tnlist; @tntemp = reverse(@tnlist); push (@tntemp,$temp); @tnlist = reverse(@tntemp); } $tnnum = @tnlist; $anum = int ($tnnum / 3); $bnum = ((($tnnum / 3) - $anum) * 3); print "Content-type: text/html\n\n"; print "$title\n"; print "\n"; print "$header\n"; print "


Click on any image to see a larger-size version of it

\n"; if ($bnum eq "0") { &main_table; &end; } if ($bnum eq "1") { &main_table; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "

$captions[($anum * 3)]

\n"; } if ($bnum eq "2") { &main_table; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "

$captions[($anum * 3)]

$captions[($anum * 3) + 1]

\n"; } print "

Click on any image to see a full-size version of it


\n"; print "$footer\n"; print "\n"; } sub main_table { $dnum = ($anum * 3); $cnum = "0"; while ($dnum > $cnum) { print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "

$captions[$cnum]

$captions[$cnum + 1]

$captions[$cnum + 2]
\n"; $cnum = $cnum + 3; print "
\n"; } }