#!/usr/bin/perl --
print "Content-type:text/HTML\n\n";
#Parameters separate with &&
# Required:
# directory==Sports/TestTournament/Division1/Team_vs_Team001/Pictures
#
# Optional:
# size==Thumbnails
# cols==3 defaults to 5 if not included
# table==600 sets the table width
# border==1 turns on the table border
# cellpadding==1 sets the amount of padding inside each table cell
# imagenames==on turn the image names on for viewing at the Thumbnail level
# heading_text==Alaska vs Illinois Text to appear at the top of the page
# title==www.CarmoPhotography.com
# bgcolor==FFFFFF rgb value of color -- do not include the #
# background==/Background/0003.jpg path to background image
# text_color==000000 rgb value of color -- do not include the #
# full_size_style==popup OR page
# image_viewer.cgi
$script_name = "image_viewer.cgi";
$header = "image_header.jpg";
# Set default values
$PARAM{'cols'}="2";
$PARAM{'size'}="Thumbnails";
$PARAM{'table'}="600";
$PARAM{'border'}="0";
$PARAM{'cellpadding'}="10";
$PARAM{'imagenames'}="on";
$PARAM{'heading_text'}="Buy Your Team Photo Now";
$PARAM{'title'}="PA-Softball.com";
$PARAM{'bgcolor'}="FFFFFF";
$PARAM{'background'}="";
$PARAM{'text_color'}="000000";
$PARAM{'full_size_style'}="page";
$PARAM{'link_color'}="0000FF";
$PARAM{'visited_link_color'}="FF0000";
$PARAM{'hover_link_color'}="FF0000";
$PARAM{'paypal_checkout'}="on";
$PARAM{'paypal_userid'}="greg.barrick\@pa-softball.com";
$PARAM{'image_price'}="10.00";
if($ENV{'QUERY_STRING'} ne "") {
$query_string = $ENV{'QUERY_STRING'}; # the file to display
$query_string =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
@qs = split(/&&/,$query_string);
foreach (@qs) {
($name, $value)=split(/==/,$_);
$PARAM{$name} = $value;
# print "$name = \"$value\"
";
}
}
#default number of columns if not set in query string
$number_of_columns=$PARAM{'cols'};
#$directory = $PARAM{'directory'} . "/" . $PARAM{'size'};
$output = "
";
}
else {
$output .= " | ";
if ( $cur_column eq "0" ) {
$output .= "\n";
}
$url_string="image_viewer.cgi?directory==$PARAM{'directory'}/FullSize_Reduced&&file==$file&&file_number==$array_image_number&&bgcolor==$PARAM{'bgcolor'}&&background==$PARAM{'background'}&&text_color==$PARAM{'text_color'}&&title==$PARAM{'title'}&&full_size_style==$PARAM{'full_size_style'}";
if ( $PARAM{'full_size_style'} eq "popup") {
$output_type = "\n";
$output .= "$output_type";
} else {
$output_type = "\n";
$output .= "$output_type";
}
$output .= "\n ";
if ( $PARAM{'imagenames'} ne "off" ) {
$output .= "\n\t\t\t $output_type $file"; } $output .= "\n\t\t\t |
Back";
}
# add paypal stuff if paypal is turned "on"
if ( $PARAM{'paypal_checkout'} eq "on" ){
$output .= "
Buy Now using | |
Item: $PARAM{'file'}
Price: \$$PARAM{'image_price'} Shipping/Handling: FREE Photo Size: 8\" x 10\" | |
** PA Softball Special -- Order 4 or more of the same picture and get 1 free ** |