#!/usr/local/bin/perl -w ######################################### # poetry_publisher.cgi v1.0 # # # #Written by John Drury - 2003 # #Email johnadrury@brighterhorizons.com # # # #You may use and alter this script in # #any way. # # # # # # ######################################### use Socket; $|=1; ####################################### # PROGRAM CONFIGURATION SECTION ####################################### @okaydomains=(); $DAYS=30000; # USE EITHER SMTP OR SEND_MAIL $SMTP_SERVER="localhost"; #$SEND_MAIL="/usr/lib/sendmail -t"; $HOMEDIR="/home/brighterhorizons/www"; $BASEDIR="/home/brighterhorizons/www/poems"; $SITEURL="http://brighterhorizons.com"; $BASEURL="$SITEURL/poems"; $SITENAME="Brighter Horizons Community"; $EXT=".htm"; $PROGNAME="/cgi-bin/poetry_test.cgi"; $MAILLOG="/data/authorlog.txt"; $MAINDB="/cgi-bin/rating/db/main.db"; $basedata="/cgi-bin/rating/db"; $SUBJECT ="Your poem has been published!"; ####################################### &main_driver; ####################################### ####################################### sub poem_published { ####################################### if ($MAILLOG ne "") { open (ML,">>$BASEDIR/$MAILLOG"); print ML "$fields{'author_name'}|$fields{'author_email'}|$fields{'poem_title'}|$URL_NAME\n"; close(ML); } if ($MAINDB ne "") { open (ML,">>$HOMEDIR/$MAINDB"); print ML "$id\|$fields{'poem_title'}\n"; close(ML); } open(NEW,">$HOMEDIR/$basedata/$id.db") || &error("The ID database file failed to be created."); print NEW "$id\|$fields{'poem_title'}\|0\|0\|0"; close(NEW); open(NEWIP,">$HOMEDIR/$basedata/ip$id.db") || &error("The IP Log database file failed to be created."); print NEWIP ""; close(NEWIP); print "Content-type: text/html\n\n"; print <<__STOP_OF_PUBLISHED__;
Alternatively, you may find your poem by clicking HERE.
__STOP_OF_PUBLISHED__ } ####################################### sub setup_letter { ####################################### $msgtext =<<__STOP_OF_MESSAGE__; Greetings $fields{'author_name'}, You have just published "$fields{'poem_title'}" in the online poetry section of Brighter Horizons community. All rights to your poetry shall remain yours. Your poem has been published on $date EST. We have formatted a permanent webpage for $fields{'poem_title'} at $URL_NAME. We recommend that you save this email since it also serves as a dated proof of copyright for your poem. __STOP_OF_MESSAGE__ } ####################################### sub poem_page { ####################################### $poembody =<<__END_OF_POEM_BODY__;
| $fields{'poem_title'} | |||
|
|||
|
|||
| Copyright © 2003
|