#!/usr/local/bin/perl
#set the line above this to your perl path. Usually fine as is
# or /usr/local/bin/perl /sbin/perl
# make certain that the first line stays the first line!
##################################################################
# (C)1998-2002 Bignosebird.com cardcgi v2.1
# This software is FREEWARE! Do with it as you wish. It is yours
# to share and enjoy. Modify it, improve it, and have fun with it!
# It is distributed strictly as a learning aid and bignosebird.com
# disclaims all warranties- including but not limited to:
# fitness for a particular purpose, merchantability, loss of
# business, harm to your system, etc... ALWAYS BACK UP YOUR
# SYSTEM BEFORE INSTALLING ANY SCRIPT OR PROGRAM FROM ANY
# SOURCE!
use Socket;
$|=1;
#### PROGRAM CONFIGURATION SECTION ############################
#
# Modify each item below to meet your needs.
#
# DAYS: number of days to keep cards before purging
# SMTP_SERVER: the name of the system acting as your sendmail gateway
# localhost should work on most systems.
# IF NOT- SET THE SEND_MAIL VARIABLE!
# BASEDIR is the unix directory that your greeting cards will
# be stored in.
# BASEURL is the URL (http address) of the directory your cards
# will be stored in.
# SITEURL is the home page URL for your site.
# SITENAME is the Name of your site, ie Title
# EXT is the ending name for your card files. NEVER, EVER USE shtml!!
# PROGNAME is the URL of THIS script.
# MAILLOG is a file name that you can capture e-mail addresses in
# FOR SECURITY REASONS: RENAME THIS FILE!!!!!!!!
# okaydomains are (if specified, the ONLY domains that the script
# can be run from. If left empty, anyone could run your script,
# but they wouldn't see any graphics!!! If your site answers to
# both www.domain.com and domain.com, then use both!
#
@okaydomains=("http://bignosebird.com", "http://www.bignosebird.com");
$DAYS=11;
# USE EITHER SMTP OR SEND_MAIL DEPENDING ON YOUR SYSTEM-
# BUT NOT BOTH!
$SMTP_SERVER="localhost";
#$SEND_MAIL="/usr/lib/sendmail -t";
$BASEDIR="/usr/dom/xbignose/www/cards";
$BASEURL="http://bignosebird.com/cards";
$SITEURL="http://bignosebird.com/";
$SITENAME="BigNoseBird.Com";
$EXT=".html";
$PROGNAME="/cgi-bin/card.cgi";
$MAILLOG="maillog";
$SUBJECT ="You have a virtual card waiting for you!";
###############################################################
&main_driver;
###############################################################
#
# Now go thru the program looking for the string "BNB SAYS!"
# to locate other changes you should make, such as wording of
# the notification e-mail and "plug" for the site.
#
# to keep things simple, the field names are hard coded in.
# you can of course modify what you wish.
###############################################################
sub thank_you
{
if ($MAILLOG ne "")
{
open (ML,">>$BASEDIR/$MAILLOG");
print ML "$fields{'recip_email'}\n";
print ML "$fields{'sender_email'}\n";
close(ML);
}
print "Content-type: text/html\n\n";
print <<__STOP_OF_THANKS__;
THANKS!
Your card notification has been sent to $fields{'recip_name'}
The URL of this card is
$URL_NAME
RETURN TO CARD CREATOR
__STOP_OF_THANKS__
}
# BNB SAYS!
# THIS IS WHERE YOU CAN CUSTOMIZE YOUR NOTIFICATION LETTER
# DO NOT TOUCH THE TWO LINES WITH __STOP_OF_MESSAGE__ ON
# THEM!!!!
sub setup_letter
{
$msgtext =<<__STOP_OF_MESSAGE__;
Hi,
$fields{'sender_name'} stopped by my site, $SITENAME
and created a Virtual Card just for you! To pick up your
card, simply point your browser at the page listed below.
$URL_NAME
The card will remain on the server for about one week, so
please print it out or save it as soon as you can.
__STOP_OF_MESSAGE__
}
# BNB SAYS!
# This is what makes up the body of your card. DO NOT REMOVE OR
# MODIFY THE LINES ABOVE THE WORD $param or the $param line
# itself. Doing so will cause the script to fail.
sub make_body
{
$cardbody =<<__END_OF_CARD_BODY__;
$BODYTAG
$params
|
|
$fields{'the_title'}
|
$fields{'the_message'}
$fields{'sig_line'}
|
|
|
|
This card was created by
$fields{'sender_name'}
(
$fields{'sender_email'})
expressly for $fields{'recip_name'}. If you would like to
send a card to a person you really care for, just go to
$SITEURL
and create your own free virtual cards.
$SITENAME
BNB SAYS! DESCRIBE YOUR SITE HERE!
Card Creator Script byBigNoseBird.com
Everything for the webmaster, for free!
|