#======================================================# # EveryAuction Addon # Mail Auction To A Friend Add-On v1.2 #======================================================# # PiTA - Park In The Alley Software (Auction-Script.com) #======================================================# # Author: Splatt 07/19/99 # 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 #======================================================# #------------------------------------------------------# # Rename this file to justmail.pl, put in your CGI-BIN # directory where auction.cgi is located. #------------------------------------------------------# #------------------------------------------------------# # !! CHANGES NEEDED TO AUCTION.CGI !! #------------------------------------------------------# # # Add this statement: require "justmail.pl"; # # Find this section in the beginning of the main code: # # &get_form_data; # parse arguments from post # @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); # $ARGV[0] =~ s/\W//g; # $ARGV[1] =~ s/\D//g; # #------------------------------------------------------# # # If it's not already, rem out the last line so it looks like this: # # &get_form_data; # parse arguments from post # @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); # $ARGV[0] =~ s/\W//g; # #$ARGV[1] =~ s/\D//g; # #------------------------------------------------------# # # Add the following lines AFTER the "elsif ($form{'searchstring'}) { &procsearch; }" statement # # # # MailTo Add-on ############################## # elsif ($form{'action'} eq 'mailto') { &mailtosend; } # elsif ($ARGV[0] eq 'mailto') { &mailto; } # # End Add-on ################################# # #------------------------------------------------------# # # Use a link similar to the one below to call the subroutine from the dispitem subroutine: # # print "(mail this auction to a friend)\n"; # #------------------------------------------------------# #------------------------------------------------------# # Add-On Sub: Mail Auction To A Friend # This sub gets the form input info for mailing the auction #------------------------------------------------------# sub mailto { open THEFILE, "$basepath$ARGV[1]/$ARGV[2].dat"; ($title, $reserve, $inc, $desc, $image, @bids) = ; close THEFILE; chomp($title, $reserve, $inc, $desc, $image, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); print <<"EOF";
Mail This Auction To A Friend
$title
Item #$ARGV[2]
Registration is required for this procedure!
Your User Name:
Must be valid.
Your Password:
Must be valid.
Email Auction To:
Email address you wish to send the auction to. Will not be verified!!
Optional Message:
Optional personal message added to the default message sent!
EOF } #------------------------------------------------------# #------------------------------------------------------# # Add-On Sub: Mail Auction To A Friend # This sub checks user name and sends the mail #------------------------------------------------------# sub mailtosend { $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); &oops('not a registered user') unless (open(REGFILE, "$basepath$regdir/$form{'ALIAS'}.dat")); ($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids) = ; close REGFILE; chomp($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids); &oops('incorrect password') unless ((lc $password) eq (lc $form{'PASSWORD'})); $mailto1 = " Hello, A user at $sitename, $form{'ALIAS'}, has forwarded this auction to you: $form{'MESSAGE'} The item information posted is as follows : Item number : $form{'ITEM'} Item Title : $form{'TITLE'} Current Bid : \$$form{'BID'} URL Below : http://$scripturl$ENV{'SCRIPT_NAME'}\?$form{'CATEGORY'}\&$form{'ITEM'} Thank you and please tell a friend about us! Sincerely, $sitename "; &sendemail($form{'EMAILADD'},'FWD Auction #' . $form{'ITEM'}, 'nobody', $mailserver, $mailto1); print <<"EOF";
Auction# $form{'ITEM'} was sent to $form{'EMAILADD'}.
Click here to return to the auction.
EOF } #------------------------------------------------------# 1;