#!/usr/bin/perl ############################################################################### # imageFolio.cgi (lightbox ready) # ############################################################################### # BizDesign ImageFolio Professional Edition # BizDesign Software # written by Greg Raaum, webmaster@imageFolio.com # Available from http://www.ImageFolio.com # --------------------------------------------------------------------------- # PROGRAM NAME : ImageFolio Pro Edition # VERSION : 2.26 # LAST MODIFIED : 04/12/2001 # =========================================================================== # COPYRIGHT NOTICE : # # Copyright (c) 1999-2001 BizDesign, Inc. All Rights Reserved. # Selling the code for this program without prior written consent is # expressly forbidden. # # Obtain written permission before redistributing this software over the # Internet or in any other medium. In all cases copyright and header must # remain intact. # # Feel free to modify the code of this program to suit your likings. # # Although this program has been thoroughly tested on BizDesign's servers, we # do not warrant that it works on all servers and will not be held liable # for anything, including but not limited to, misusage, error, or loss of data. # # Use at your own risk! ############################################################################### # Do not modify below this line unless you know what you are doing. ############################################################################### use vars qw/$libpath $referrer_check $domain $image_directory/; eval { ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows require "config.pl"; # Change this to the absolute path if you have problems. if ($display_lightbox==1){ require "$lightbox_scripts_path/lightbox_config.pl"; } require "$libpath/shared.pl"; # Change this to the absolute path if you have problems. ⊤ }; if ($@) { print "Content-type: text/html\n\n
Script Error: $@\n"; } exit; ############################################################################### # TOP # Determines what to do ############################################################################### sub top { $| = 1; # flush output local(%FORM) = &parse_form; &load_values; if (!$FORM{'lightbox'}){ if ($referrer_check) { &check_referrer; }} if ($FORM{'action'} eq "view") { require "$libpath/images.pl"; &view_image; } elsif ($FORM{'direct'}) { require "$libpath/thumbnails.pl"; &gen_image_table; } elsif ($FORM{'search'}) { require "$libpath/search.pl"; &search; } elsif ($FORM{'lightbox'}) { require "$lightbox_scripts_path/lightbox.pl"; &gen_image_table; } else { require "$libpath/home.pl"; &gen_home_page; } } ############################################################################### # CHECK REFERRER # Make sure we are pulling this page from the site and not a bookmark or link ############################################################################### sub check_referrer { my $ok; for(@ref) { if ($ENV{'HTTP_REFERER'} =~ /$_/) { $ok = 1; } } if ($ok != 1) { print "Content-type: text/html\nLocation:$domain\n\n"; exit; } } ############################################################################### # LOAD VALUES # Establishes default values for commonly used variables ############################################################################### sub load_values { my ($found, $i, $pos, $count, $cnt, $nav, $subcatlinks, $thumbimages, $template); if ($FORM{'direct'}) { if ( (!(-e "$image_directory/$FORM{'direct'}")) || (!(-d "$image_directory/$FORM{'direct'}")) || ($FORM{'direct'} =~ /\.\./) ) { print qq|Content-type: text/html\n\n