#======================================================# # EveryAuction Addon # Upload A Picture Add-On v1.1b #======================================================# # PiTA - Park In The Alley Software (Auction-Script.com) #======================================================# # Author: Splatt 11/20/00 # justguns.com auction-script.com compalley.com #------------------------------------------------------# # Unauthorized redistribution is prohibited!!! # The latest version of my addons can be found at: # www.auction-script.com/addons #======================================================# #======================================================# # INSTALL INSTRUCTIONS #======================================================# #======================================================# # NOTES: # - Give all directories needed full rights. # - The file will be renamed to the category + item number # For example, if the item number was 12345678 # and the category was computers, the final file name # would be computers12345678.gif. # I did this to be able to delete the file when the # auction closed, however that's not implemented yet. # - Put the upload.pl file in the same cgi-bin directory # as your auction.cgi file. #======================================================# #======================================================# #======================================================# # Changes needed to AUCTION.CGI #======================================================# #======================================================# # In your auction.cgi require and use section add the # following section. # (if you do not have that section, put these near the top) #-Image Upload-----------------------------------------# # NOTE: The $imageuploaddir MUST match the $basedir var # in the upload.pl code except for the trailing slash, # it also MUST be under your auctions base directory # otherwise you will get a permission error when trying # to write to it. # # allowupload - You might want to turn it off someday # uploadcharge - If you are using AF you can charge for this # imageuploaddir - Destination directory for storage # imageuploadurl - URL pointing to storage directory #------------------------------------------------------# use File::Copy; # needed for upload add-on $allowupload = 1; # 0 for no 1 for yes $uploadcharge = '0'; # ie -1.00 or set to zero '0' for no charge (for AccountFirst) $imageuploaddir = '/usr/www/auction/uploadedpictures'; $imageuploadurl = "http://www.yourdomain.com/auction/uploadedpictures"; #--Image Upload END------------------------------------# #======================================================# #======================================================# # Now create the $imageuploaddir directory giving full rights #======================================================# #======================================================# #======================================================# # Search for the following line: $ARGV[1] =~ s/\D//g; #======================================================# # Then REPLACE that line with the following section: #--Image Upload----------------------------------------# # $ARGV[1] =~ s/\D//g; #--Image Upload END------------------------------------# #======================================================# # Search for the following line: elsif ($ARGV[2] eq 'n') { &newitem; } #======================================================# # Then REPLACE that line with the following section: #--Image Upload----------------------------------------# # elsif ($ARGV[2] eq 'n') { &newitem; } elsif ($ARGV[2] eq 'n') { &uploadform; } elsif ($form{'picture'}) { &newitem; } elsif ($form{'pictureurl'}) { &newitem; } elsif (lc($ARGV[0]) eq 'uploaddone') { &newitem; } #--Image Upload END------------------------------------# #======================================================# # In your newitem sub search for this line: Image URL:
Optional, should be no larger than 200x200 #======================================================# # Then REPLACE that line with the following section: EOF #--Image Upload----------------------------------------# # Image URL:
Optional, should be no larger than 200x200 if ($ARGV[0] eq 'uploaddone') { $form{'IMAGEUPLOAD'} = "YES"; if ($ARGV[2] ne '') { $form{'EXTENSION'} = $ARGV[2]; print ""; } $image = $ARGV[1]; print ""; } else { $form{'IMAGEUPLOAD'} = "NO"; print ""; $image = "NONE" if $form{'picture'}; $image = $form{'pictureurl'} if $form{'pictureurl'}; } print "Image:
"; print "$image"; #--Image Upload END------------------------------------# print <<"EOF"; #======================================================# # In your preview sub search for this line: $image = "" if ($form{'IMAGE'}); #======================================================# # Then REPLACE that line with the following section: #--Image Upload----------------------------------------# # $image = "" if ($form{'IMAGE'}); if ($form{'IMAGEUPLOAD'} eq 'NO') { $image = "" if ($form{'IMAGE'}); $image = "" if ($form{'IMAGE'} eq 'http://'); $image = "" if ($form{'IMAGE'} eq 'NONE'); } if ($form{'IMAGEUPLOAD'} eq 'YES') { $image = ""; }; #--Image Upload END------------------------------------# #======================================================# # In your preview sub search for this line: print "\n"; #======================================================# # Then paste the following section BELOW that: #--Image Upload----------------------------------------# print ""; #--Image Upload END------------------------------------# #======================================================# # In your procnew sub search for this line: $form{'IMAGE'} = "" if ($form{'IMAGE'} eq "http://"); #======================================================# # Then paste the following section BELOW that: #--Image Upload----------------------------------------# $form{'IMAGE'} = "" if ($form{'IMAGE'} eq "NONE"); #--Image Upload END------------------------------------# #======================================================# # In your procnew sub search for this section: if ($form{'FROMPREVIEW'}) { foreach $key (keys %form) { $form{$key} =~ s/\[greaterthansign\]/\>/gs; $form{$key} =~ s/\[lessthansign\]/\
Add New Auction Item

Are you adding a picture to the item?
If You Do Not Have a Picture
Click to continue the item listing process without adding a picture.
Enter Your Picture URL
If you have a picture that is hosted on a Web server, you can enter the URL of the image file in the field below. 
Picture URL:
Click to use the above Picture URL and continue the item listing process.
Upload Your Picture
$chargetext
If you have a picture on your hard drive that you would like to upload and add to your item listing, you can click the 'Browse' button and select the file from your hard drive.

The picture upload requires Netscape 3.0 or higher, or Internet Explorer (IE) 3.02 or higher. IE 3.02 users need to download and install a file from Microsoft to use the picture upload. Click here to download this file.
Picture File:
Click to upload your files and continue the item listing process.
EOF } #------------------------------------------------------#