Upcoming Shows
#!/usr/bin/perl use CGI; $query = new CGI; #Script Description #Unique script ID: yel/coc/f/yel-5b2d #Created on: 12/19/2001 #Last edited on: 12/19/2001 #Script class: D #STEP A======== #A1. The following lines get and process data passed #through the URL, do not modify $stringpassed=$ENV{'QUERY_STRING'}; #A2. Replace all plusses with spaces for data passed via URL $stringpassed=~s/\+/ /g; #STEP B=== ########### # START OF CONFIGURATION ########### #B1. REQUIRED: The location of event data file on your server. This must #be the PATH to your data file, not the URL of your data file! $data="/home/mrgforce/public_html/usaent/cgi/ep/eventpublisher.txt"; $tempdata="/home/mrgforce/public_html/usaent/cgi/ep/eventpublisher.tempdata"; $openinghtml="/home/mrgforce/public_html/usaent/ep/icons/template.htm"; #B2. REQUIRED: The URL of this file in your cgi-bin directory. You must #provide the full URL, beginning with http:// $thisurl="http://www.usaentertainment.com/cgi/eventpublisher2.cgi"; #B4. REQUIRED TO ADD, DELETE, OR MODIFY. $adminpassword="tbeg123"; $forwardingURL="http://www.usaentertainment.com/cgi/eventpublisher2.cgi"; #B16. URL to the base ICON images directory for field: #The URL should end with a forwardslash. $baseurltoIcon="http://www.usaentertainment.com/ep/icons/"; #B17. Maximum number of events to display (sorted according to event date - event on #December 01, 2001 will be displayed on top of event on December 31, 2001). $maximumpage=100; #B18. Font settings of the event display $fontface ="Verdana, Arial"; ### Recommended: "Verdana, Arial" $fontsize= "1"; ### Used for event title and description only ### $fonttitlecolor = "#000099"; $fontsubtitlecolor ="#ffffff"; ### Used for event sub titles such as "Venue", "Date" .... #B19. ****** REMEMBER THIS: IMPORTANT **** ############################ # END OF CONFIGURATION ############################ $maximum=1200; @variablenames = $query->param; foreach $variable (@variablenames){ $value=$query->param($variable); $tempapprove{$variable}="$value";} #STEP D================================ #You should not need to modify this section at all #D1. Check to see if opening html file is on server if (-e "$openinghtml"){ #D2. If so, open it and write opening and closing text to different strings #to be used throughout the script $problem="Can't open template file. Make sure you are referencing the file and not just a directory."; open(OPENING, "$openinghtml") || &security; @wholefile=; close(OPENING); $fulltemplate=join("\n",@wholefile); ($templatestart,$templateend)=split(/\+\+\+/,$fulltemplate);} else{ #D3. If template file not found, use this for now $templatestart=""; $templateend="";} $delimiter="\t"; #D6. Get Password Entered by User $checkpassword=$query->param('checkpassword'); #D7. Figure out what action user wants to take. $actiontotake=$query->param('actiontotake'); $linenumberpass=$query->param('linenumberpass'); #D8. If user wants to delete record, and has already #verified password, then go to the makechange subroutine if ($actiontotake eq "Delete Record"){ $recordaction="Deleted"; &makechange; exit;} #D9. If user wants to edit record, and has already #verified password, then go to the makechange subroutine if ($actiontotake eq "Edit Record"){ $recordaction="Edited"; &makechange; exit;} #D10. If user wants to edit record, to go subroutine to verify if ($actiontotake eq "Edit"){ &edit; exit;} #D11. If user wants to delete record, to go subroutine to verify if ($actiontotake eq "Delete"){ &delete; exit;} #D12. If user wants to add record, go to add subroutine if ($actiontotake eq "Add"){ &addrecord; exit;} #D13. If user wants to add record to temporary file if ($actiontotake eq "Addtemp"){ &addtemp; exit;} #D14. If owner wants to evaluate records in temp file if ($actiontotake eq "Scrolltemp"){ &scrolltemp; exit;} #D15. If user wants to update temp file if ($actiontotake eq "Updatetemp"){ &updatetemp; exit;} #STEP E================================ #E1. Get the data passed from user $Event=$query->param('Event'); $Eventwork=lc($Event); if ($Eventwork eq "select"){ $Eventwork=""; $Event="";} $Eventpass="$Event"; #E1. Get the data passed from user $Description=$query->param('Description'); $Descriptionwork=lc($Description); if ($Descriptionwork eq "select"){ $Descriptionwork=""; $Description="";} $Descriptionpass="$Description"; #E1. Get the data passed from user $Venue=$query->param('Venue'); $Venuework=lc($Venue); if ($Venuework eq "select"){ $Venuework=""; $Venue="";} $Venuepass="$Venue"; #E1. Get the data passed from user $Month=$query->param('Month'); $Monthwork=lc($Month); if ($Monthwork eq "select" || ""){ $Monthwork=""; $Month="";} $Monthpass="$Month"; #E1. Get the data passed from user $Day=$query->param('Day'); $Daywork=lc($Day); if ($Daywork eq "select"){ $Daywork=""; $Day="";} $Daypass="$Day"; #E1. Get the data passed from user $Year=$query->param('Year'); $Yearwork=lc($Year); if ($Yearwork eq "select"){ $Yearwork=""; $Year="";} $Yearpass="$Year"; #E6. Get number of records already displayed $startitem=$query->param('startitem'); #E7. Figure the last record to display on this page $enditem=$startitem+$maximumpage; ($Eventone, $Eventtwo, $Eventthree, $Eventfour, $Eventfive, $Eventsix, $Eventseven)=split(/ /, $Eventwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. $Lo1="P"; $Lo2="is"; ($Descriptionone, $Descriptiontwo, $Descriptionthree, $Descriptionfour, $Descriptionfive, $Descriptionsix, $Descriptionseven)=split(/ /, $Descriptionwork); $Text1="Fr"; $Text2="Ev"; $Text3="her"; #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. $Hi1="ee"; $Hi2="ent"; $Hi3="ubl"; ($Venueone, $Venuetwo, $Venuethree, $Venuefour, $Venuefive, $Venuesix, $Venueseven)=split(/ /, $Venuework); #F4a. Support for European characters. Uncomment and replace with your ($Monthone, $Monthtwo, $Monththree, $Monthfour, $Monthfive, $Monthsix, $Monthseven)=split(/ /, $Monthwork); ($Dayone, $Daytwo, $Daythree, $Dayfour, $Dayfive, $Daysix, $Dayseven)=split(/ /, $Daywork); $comp1="INT"; $comp2="O"; $comp3="U"; $lcomp1="int"; $lcomp2="po"; $lcomp3="u"; $and1="b"; $and2="y"; ($Yearone, $Yeartwo, $Yearthree, $Yearfour, $Yearfive, $Yearsix, $Yearseven)=split(/ /, $Yearwork); #STEP G================================ #Do not modify this section #G1. Open datafile and write contents to an array, if can't open report the problem at the security subroutine $problem="You do not have a file to search on the server. Please ADD test records before trying to search your test data file."; open (FILE, "$data") || &security; @all=; close (FILE); #G2. The line below is required, do not modify print "Content-type: text/html\n\n"; #G3. Display HTML Header if ($adminpassword eq $checkpassword){ print "$templatestart\n";} else { print "";} #STEP H================================ #H1. Read each line of the data file, compare with search words foreach $line (@all){ $line=~s/\n//g; $loopsaround++; $checkleng=length($line); if ($checkleng<2){next}; $linetemp1=lc($line); #H1a. Support for European characters. Uncomment and replace with your ($Icon,$Event,$Description,$Venue,$Day,$Month,$Year,$Time,$Website,$Email,$Public_Remarks,$Private_Remarks,$skipthisfield)=split (/$delimiter/,$linetemp1); #H9. This line specifies the fields to sort results by #See help databases for patches to allow various kinds of sorts $line="$Year$Month$Day$Event$delimiter$loopsaround$delimiter$line"; #H9.5 This line removes stray leading spaces before sorting your results $line=~s/^ +//; $increcount=0; #H12. Look for matches in field named Event if (($Event =~/\b$Eventone/ && $Event =~/\b$Eventtwo/ && $Event =~/\b$Eventthree/ && $Event =~/\b$Eventfour/ && $Event =~/\b$Eventfive/ && $Event=~/\b$Eventsix/ && $Event=~/\b$Eventseven/) || !$Eventwork) { $increcount++;} #H12. Look for matches in field named Description if (($Description =~/\b$Descriptionone/ && $Description =~/\b$Descriptiontwo/ && $Description =~/\b$Descriptionthree/ && $Description =~/\b$Descriptionfour/ && $Description =~/\b$Descriptionfive/ && $Description=~/\b$Descriptionsix/ && $Description=~/\b$Descriptionseven/) || !$Descriptionwork) { $increcount++;} #H12. Look for matches in field named Venue if (($Venue =~/\b$Venueone/ && $Venue =~/\b$Venuetwo/ && $Venue =~/\b$Venuethree/ && $Venue =~/\b$Venuefour/ && $Venue =~/\b$Venuefive/ && $Venue=~/\b$Venuesix/ && $Venue=~/\b$Venueseven/) || !$Venuework) { $increcount++;} #H12. Look for matches in fields named Month & Day if ($Monthpass == "" && $Daypass == "") { $increcount++;} elsif ($Monthpass == $Month && $Daypass == "") { $increcount++;} elsif ($Monthpass == "" && $Daypass == $Day) { $increcount++;} elsif ($Monthpass == $Month && $Daypass == $Day) { $increcount++;} #H12. Look for matches in field named Year if (($Year =~/\b$Yearone/ && $Year =~/\b$Yeartwo/ && $Year =~/\b$Yearthree/ && $Year =~/\b$Yearfour/ && $Year =~/\b$Yearfive/ && $Year=~/\b$Yearsix/ && $Year=~/\b$Yearseven/) || !$Yearwork) { $increcount++;} if ($line=~/markedtoedit/ && $actiontotake eq "markedtoedit"){ $line=~s/markedtoedit//g; push (@keepers2,$line);} $line=~s/markedtoedit//g; if ($increcount==5){ push (@keepers,$line);}} #STEP J=============== if ($actiontotake eq "markedtoedit"){ @keepers=@keepers2;} #J1. Sort matches stored in array. @keepers=sort(@keepers); #J2. Get and display number of matches found $length1=@keepers; #J3. If the number of matches is less than enditem, adjust if ($length1<$enditem){ $enditem=$length1; $displaystat="Y";} #J4. The first field about to display $disstart=$startitem+1; #J5. Show user total number of matches found if ($length1){ print ""; } else { print "

No Local Events Found.<\/B>
Press your Browsers Back Button and try again.<\/P><\/font>\n";} #STEP K=========== ################ FROM NEW PROGRAM ################ #Server time vs. local time adjustment #Turn it on to show the current date and time. This is to ease #troubleshooting. Turn it OFF once everything is working fine. $debug = "0"; #Debug mode 1 = ON 0 = OFF $offset = 120; #Time offset in minutes. Default is zero for no adjustment. #Formatting for Today Date ($secstamp,$minstamp,$hourstamp,$mdaystamp,$monthstamp,$yearstamp,$wdaystamp,$dayofyearstamp,$isdst1stamp) = localtime(time+($offset*60)); $monthstamp++; $yearstamp=1900+$yearstamp; if (length($monthstamp)==1){ $monthstamp="0$monthstamp";} if (length($mdaystamp)==1){ $mdaystamp="0$mdaystamp";} if (length($hourstamp)==1){ $hourstamp="0$hourstamp";} if (length($minstamp)==1){ $minstamp="0$minstamp";} if (length($secstamp)==1){ $secstamp="0$secstamp";} $todaydate="
Current date: $yearstamp/$monthstamp/$mdaystamp Current time: $hourstamp:$minstamp:$secstamp
- This date and time are displayed here for server time vs. local time adjustment checking only. Please go to Step K in upevent.cgi and set the \$offset switch until they match your local time. Then turn off this box by setting \$debug to 0.
"; if ($debug){ print "$todaydate";} ############## PARTIAL END OF FROM NEW PROGRAM - MORE BELOW ################ #K1. Do some HTML formatting before showing results print "
\n"; #K4. Keep track of results processed on this page foreach $line (@keepers){ #K5. Delete stray hard returns $line=~s/\n//g; #K6. Keep track of records displayed $countline1++; #K7. Decide whether or not this record goes on this page if ($countline1>$startitem && $countline1<=$enditem){ #K8. Open each line of sorted array for displaying ($sortfield,$loopsaround,$Icon,$Event,$Description,$Venue,$Day,$Month,$Year,$Time,$Website,$Email,$Public_Remarks,$Private_Remarks,$skipthisfield)=split (/$delimiter/,$line); if ($Month eq "01"){ $Month2 = "January";} if ($Month eq "02"){ $Month2 = "February";} if ($Month eq "03"){ $Month2 = "March";} if ($Month eq "04"){ $Month2 = "April";} if ($Month eq "05"){ $Month2 = "May";} if ($Month eq "06"){ $Month2 = "June";} if ($Month eq "07"){ $Month2 = "July";} if ($Month eq "08"){ $Month2 = "August";} if ($Month eq "09"){ $Month2 = "September";} if ($Month eq "10"){ $Month2 = "October";} if ($Month eq "11"){ $Month2 = "November";} if ($Month eq "12"){ $Month2 = "December";} ############# MORE FROM NEW PROGRAM - TO DISPLAY NEW EVENTS ############### $localdate = "$yearstamp$monthstamp$mdaystamp"; $eventdate = "$Year$Month$Day"; if (($eventdate >= $localdate) or (($eventdate < $localdate) and ($adminpassword eq $checkpassword))){ ############# END OF FROM NEW PROGRAM ############################## #K15. Formatting for ad separating line. print "\n"; #K15. Formatting for field Day. If you add any HTML, make sure you #put a backslash in front of all quote marks inside print statements if ($Day){ print "\n";} #K15. Formatting for field Event. If you add any HTML, make sure you #K15. Formatting for field Venue. If you add any HTML, make sure you if ($Venue){ print "\n";} #K15. Formatting for field Time. If you add any HTML, make sure you if ($Time){ print "\n";} #K15. Formatting for field Website. If you add any HTML, make sure you if ($Website){ print "\n";} #K15. Formatting for field Email. If you add any HTML, make sure you if ($Email){ print "\n";} #K15. Formatting for field Description. If you add any HTML, make sure you if ($Description){ #print "\n";} print "\n";} #K15. Formatting for field Public_Remarks. if ($Public_Remarks){ print "\n";} #K11. Check passwords before showing edit and delete buttons if ($adminpassword eq $checkpassword){ print "\n";} ######### FROM NEW PROGRAM TO END ############ } else { $skip1 = $skip1+1; $countline1 = $countline1-1;} ########## END FROM NEW PROGRAM TO END ######## #STEP L===== #L1. If total displayed equals maximum you set, then exit if ($countline1 == $maximum && $maximum){ $problem2="Your search was terminated because there were more than $maximum matching records found, please be more specific in your search"; last;} #L2. If script just got to last match then exit program if ($length1 == $countline1){ last;} #L3. If script is at the end of a page then show NEXT button if ($countline1 == $enditem && $displaystat ne "Y" && $maximum>$countline1){ $stopit="Y"; last; } }} print "

Date:$Month2 $Day, $Year
Where:$Venue
Time:$Time
WebSite:$Website
Email:$Email
$Description
Info:$Description
$Public_Remarks
\n"; $fcc="2"; $fcd="1"; $fce="w"; $fcf="tp"; $fcg="dn"; $fci="e"; $checkfcc="ne"; $checkfcd="t"; $checkfcf="s"; $checkfcg="ef"; $checkfci="ank"; $checkfcj="_bl"; $mer1="
"; $mer3=" "; #$comp3$Lo1$comp2$comp1 #L4. Display NEXT MATCHES button if ($stopit eq "Y"){ print "
\n"; #L5. Pass hidden variables so script will know how to display next page print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n";} $errormode ="$mer1"; if (($stopit eq "Y") and ($adminpassword eq $checkpassword)){ print "
\n"; } #L6. Show problems if ((!$mer1) or (!$mer2) or (!$mer3)){ &low;} if ($problem2){ print "$problem2";} else { print "$mer3"; } #L8. If opening.htm was found, show its closing html codes if (!$errormode) { &low;} srand(); $checkval=int(rand(30)); if ($checkval==3){ print "";} if ($adminpassword eq $checkpassword){ print "$templateend\n";} else { print "";} exit; #STEP M================================ sub security{ #M1. This is the subroutine that reports all problems print "Content-type: text/html\n\n"; print "$templatestart\n"; print "
Data Error

\n"; print "Please correct the following error:

$problem
\n"; print "$templateend\n"; exit; } sub low{ #M1. This is the subroutine that reports all problems print "$templatestart\n"; print "
Data Error

\n"; print "Error:

Script Corrupted!
\n"; print "$templateend\n"; exit; } #STEP N================================ sub edit{ #N1. Open data file and read it $problem="Can't open data file to read from it at edit subroutine"; open (FILE,"$data") || &security; @all=; close (FILE); #N2. Read each line of the data file foreach $line (@all){ $line=~s/\n//g; ($copyIcon,$copyEvent,$copyDescription,$copyVenue,$copyDay,$copyMonth,$copyYear,$copyTime,$copyWebsite,$copyEmail,$copyPublic_Remarks,$copyPrivate_Remarks,$skipthisfield)=split (/$delimiter/,$line); $keepcount++; #N3. Find the line user wants to modify if ($keepcount==$linenumberpass){ $linetokeep=$line; $linetokeep=~s/markedtoedit//g; last; } } #N4. Check password sent via hidden field if ($adminpassword ne $checkpassword){ $problem="Your password does not match the master password, please re-enter."; &security;} #N6. Split matching line into its respective variables ($Icon,$Event,$Description,$Venue,$Day,$Month,$Year,$Time,$Website,$Email,$Public_Remarks,$Private_Remarks,$skipthisfield)=split (/$delimiter/,$linetokeep); #Required Header, do not delete print "Content-type: text/html\n\n"; #N8. If can't find opening html, display default header print "$templatestart\n"; print "

Admin Mode: Edit this Record\n"; print "

\n"; print "";} print "\n"; $Description=~s/
/\n/g; $Description=~s/
/\n/g; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $Public_Remarks=~s/
/\n/g; $Public_Remarks=~s/
/\n/g; print "\n"; $Private_Remarks=~s/
/\n/g; $Private_Remarks=~s/
/\n/g; print "\n"; #N10. Pass values to next screen print "
Icon:\n"; if ($Icon){ print "
* Event:
* Description:
Venue:
* Date:\n"; print ":\n"; print ": (DD:MM:YY)
Time: eg. 8:30am ~ 9pm
Website:
Start with http:// if used.
Email:
Public Remarks:
This remark is shown to the public.
Private Remarks:
This remark is shown ONLY to the administrator.
\n"; print "\n"; print "\n"; print "

\n"; print "$templateend\n"; exit; } #STEP O================================ sub delete{ #O1. Open data file and read it $problem="Can't open data file to read from it at delete subroutine"; open (FILE,"$data") || &security; @all=; close (FILE); #O2. Read each line of the file foreach $line (@all){ $line=~s/\n//g; ($copyIcon,$copyEvent,$copyDescription,$copyVenue,$copyDay,$copyMonth,$copyYear,$copyTime,$copyWebsite,$copyEmail,$copyPublic_Remarks,$copyPrivate_Remarks,$skipthisfield)=split (/$delimiter/,$line); $keepcount++; #O3. Find line to delete if ($keepcount==$linenumberpass){ $linetokeep=$line; $linetokeep=~s/markedtoedit//g; last; } } ($Icon,$Event,$Description,$Venue,$Day,$Month,$Year,$Time,$Website,$Email,$Public_Remarks,$Private_Remarks,$skipthisfield)=split (/$delimiter/,$linetokeep); #O4. Check password sent via hidden field if ($adminpassword ne $checkpassword){ $problem="Your password does not match the master password."; &security;} #O6. Requred Header, do not delete print "Content-type: text/html\n\n"; print "$templatestart\n"; print "

Admin Mode: Delete this Record?\n"; ($Icon,$Event,$Description,$Venue,$Day,$Month,$Year,$Time,$Website,$Email,$Public_Remarks,$Private_Remarks,$skipthisfield)=split (/$delimiter/,$linetokeep); #O7. Show validation HTML print "

\n"; print "\n"; print "";} else { print "Nil";} if ($Month eq "01"){ $Month2 = "January";} if ($Month eq "02"){ $Month2 = "February";} if ($Month eq "03"){ $Month2 = "March";} if ($Month eq "04"){ $Month2 = "April";} if ($Month eq "05"){ $Month2 = "May";} if ($Month eq "06"){ $Month2 = "June";} if ($Month eq "07"){ $Month2 = "July";} if ($Month eq "08"){ $Month2 = "August";} if ($Month eq "09"){ $Month2 = "September";} if ($Month eq "10"){ $Month2 = "October";} if ($Month eq "11"){ $Month2 = "November";} if ($Month eq "12"){ $Month2 = "December";} print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Icon: $Icon"; if ($Icon){ print "
Event: $Event
Description: $Description
Venue: $Venue
Date: $Month2 $Day, $Year
Time: $Time
Website: $Website
Email: $Email
Public Remarks: $Public_Remarks
Private Remarks: $Private_Remarks

\n"; print "\n"; print "\n"; print "

\n"; #If opening.htm was not found, show default closing html codes print "$templateend\n"; exit; } #STEP P================================ sub makechange{ #P1. For each variable, translate it, remove any delimiters that #user may have accidentally included, replace hard returns with #HTML line breaks, and delete all carriage returns #Go to get variable subroutine and make sure add preferences apply if ($recordaction eq "Edited"){ &getvariables;} #P2. This step either replaces or empties the existing line if ($recordaction eq "Deleted"){ $replacementline="";} else{ $replacementline="$Icon$delimiter$Event$delimiter$Description$delimiter$Venue$delimiter$Day$delimiter$Month$delimiter$Year$delimiter$Time$delimiter$Website$delimiter$Email$delimiter$Public_Remarks$delimiter$Private_Remarks";} $problem="Can't open data file to read from it"; open (FILE,"$data") || &security; @all=; close (FILE); $linenumberpass--; $all[$linenumberpass]=$replacementline; $problem="Can't open temporary file. You need to chmod 777 the directory your data file is in. See the help files under Permissions for Class B Scripts."; #P6. Write the entire changed file to a temporary file open (FILE2,">$data.tmp") || &security; foreach $line (@all){ $line=~s/\n//g; print FILE2 "$line\n";} close(FILE2); #P7. Rename the temp file to your master data file $problem="Can't rename file after making change"; rename("$data.tmp", "$data") || &security; print "Content-type: text/html\n\n"; #P8. If can't find opening html, display default header print "$templatestart\n"; print "Your record has been $recordaction. Please click here to continue.\n"; close (FILE); #If opening.htm was not found, show default closing html codes print "$templateend\n"; exit; } #STEP Q================================ #This subroutine adds records to your database sub addrecord{ #Q1. Check password if ($adminpassword ne $checkpassword && $adminpassword){ $problem="The password you entered does not match your administration password. Please press BACK on your browser to fix this problem."; &security;} &getvariables; $replacementline="$Icon$delimiter$Event$delimiter$Description$delimiter$Venue$delimiter$Day$delimiter$Month$delimiter$Year$delimiter$Time$delimiter$Website$delimiter$Email$delimiter$Public_Remarks$delimiter$Private_Remarks"; #Q3. Write the new record to the bottom of the data file $problem="Can't write to the data file. Please verify its location and change its permissions to 777."; open (FILE2,">>$data") || &security; print FILE2 "$replacementline\n"; close(FILE2); print "Content-type: text/html\n\n"; #Q4. If can't find opening html, display default header print "$templatestart\n"; print "Your record has been added. Please click here to continue.\n"; #If opening.htm was not found, show default closing html codes print "$templateend\n"; exit; } #STEP R================================ sub getvariables{ #R1. This step checks your variables before adding/editing them $Icon=$query->param('Icon'); $Event=$query->param('Event'); $Description=$query->param('Description'); $Private_Remarks=$query->param('Private_Remarks'); $Venue=$query->param('Venue'); if ($Venue eq "Choose From The Many Venues Listed Here ... Or Enter the Info Below"){ $Venue=$Private_Remarks;} $Day=$query->param('Day'); $Month=$query->param('Month'); $Year=$query->param('Year'); $Time=$query->param('Time'); $Website=$query->param('Website'); $Email=$query->param('Email'); $Public_Remarks=$query->param('Public_Remarks'); #R3. Replace hard returns with
, cut carriage returns $Icon=~s/\n/
/g; $Icon=~s/\r//g; if ($Icon eq "Select"){ $Icon="";} #R3. Replace hard returns with
, cut carriage returns $Event=~s/\n/
/g; $Event=~s/\r//g; if ($Event eq "Select"){ $Event="";} #R3. Replace hard returns with
, cut carriage returns $Description=~s/\n/
/g; $Description=~s/\r//g; if ($Description eq "Select"){ $Description="";} #R3. Replace hard returns with
, cut carriage returns $Venue=~s/\n/
/g; $Venue=~s/\r//g; if ($Venue eq "Select"){ $Venue="";} #R3. Replace hard returns with
, cut carriage returns $Day=~s/\n/
/g; $Day=~s/\r//g; if ($Day eq "Select"){ $Day="";} #R3. Replace hard returns with
, cut carriage returns $Month=~s/\n/
/g; $Month=~s/\r//g; if ($Month eq "Select"){ $Month="";} #R3. Replace hard returns with
, cut carriage returns $Year=~s/\n/
/g; $Year=~s/\r//g; if ($Year eq "Select"){ $Year="";} #R3. Replace hard returns with
, cut carriage returns $Time=~s/\n/
/g; $Time=~s/\r//g; if ($Time eq "Select"){ $Time="";} #R3. Replace hard returns with
, cut carriage returns $Website=~s/\n/
/g; $Website=~s/\r//g; if ($Website eq "Select"){ $Website="";} #R3. Replace hard returns with
, cut carriage returns $Email=~s/\n/
/g; $Email=~s/\r//g; if ($Email eq "Select"){ $Email="";} #R3. Replace hard returns with
, cut carriage returns $Public_Remarks=~s/\n/
/g; $Public_Remarks=~s/\r//g; if ($Public_Remarks eq "Select"){ $Public_Remarks="";} #R3. Replace hard returns with
, cut carriage returns $Private_Remarks=~s/\n/
/g; $Private_Remarks=~s/\r//g; if ($Private_Remarks eq "Select"){ $Private_Remarks="";} #R4. You have marked Event as a field that must contain at least 2 $Eventcheck=$Event; $Eventcheck=~s/ +/ /g; $Eventcheck=length($Eventcheck); if ($Eventcheck<2){ $problem="Please press back on your browser and provide more information for the .. Event .. field."; &security;} #R4. You have marked Venue as a field that must contain at least 2 $Venuecheck=$Venue; $Venuecheck=~s/ +/ /g; $Venuecheck=length($Venuecheck); if ($Venuecheck<2){ $problem="Please press the Back Button on your browser and provide more information for the .. Venue .. Field. It is either not indicated in the dropdown box or not indicated in the additional field provided"; &security;} #R4. You have marked Day as a field that must contain at least 1 $Daycheck=$Day; $Daycheck=~s/ +/ /g; $Daycheck=length($Daycheck); if ($Daycheck<1){ $problem="Please press back on your browser and provide more information for the .. Day .. field."; &security;} #R4. You have marked Month as a field that must contain at least 1 $Monthcheck=$Month; $Monthcheck=~s/ +/ /g; $Monthcheck=length($Monthcheck); if ($Monthcheck<1){ $problem="Please press back on your browser and provide more information for the .. Month .. field."; &security;} #R4. You have marked Year as a field that must contain at least 2 $Yearcheck=$Year; $Yearcheck=~s/ +/ /g; $Yearcheck=length($Yearcheck); if ($Yearcheck<2){ $problem="Please press back on your browser and provide more information for the .. Year .. field."; &security;} #R4. You have marked Time as a field that must contain at least 2 $Timecheck=$Time; $Timecheck=~s/ +/ /g; $Timecheck=length($Timecheck); if ($Timecheck<2){ $problem="Please press back on your browser and provide more information for the .. Time .. field."; &security;} #R13. You have marked Website as a field that must contain a valid hyperlink #$Websitecheck=substr($Website,0,7); #if ($Website && $Websitecheck!~/http:\/\//i){ #$problem="The information you have provided in the Website field does not look like a valid #hyperlink, beginning with http://. Please press back on your browser and fix this problem."; #&security;} #R10. You have marked Email as a field that must contain a valid e-mail #Address, OR, be empty. To remove requirement, comment out 9 lines below $Emailcheck=$Email; ($firstpart,$secondpart)=split(/\@/,$Emailcheck); if ($Email && (!$firstpart || !$secondpart || $secondpart!~/\./)){ $problem="The information you have provided in the e-mail field does not look like a valid e-mail address. Please press back on your browser and fix this problem."; &security;} #R11. Remove characters that could cause security issues in e-mail field if ($Emailcheck =~/[\!\|\~\^\'\"]/){ $problem="The information you entered into the e-mail field contains illegal characters. This field should contain letters, numbers, the \@ symbol, and periods only. Please press BACK and fix this problem."; &security;} } #STEP S================================ sub addtemp{ #S1. This subroutine adds records to your temporary file for approval #S2. Check variable sent &getvariables; #S3. Randomize in preparation for random generator srand(); #S4. Get IP address of person posting record $ipstamp=$ENV{'REMOTE_ADDR'}; #S5. Generate a large random number to serve as key $randnumb=int(rand(9999999)); $replacementline="$ipstamp&&temp$randnumb(\+\+)$Icon$delimiter$Event$delimiter$Description$delimiter$Venue$delimiter$Day$delimiter$Month$delimiter$Year$delimiter$Time$delimiter$Website$delimiter$Email$delimiter$Public_Remarks$delimiter$Private_Remarks"; #S6. Write the temp record to the bottom of the $problem="Can't write to the data file. Please verify its location and change its permissions to 777."; open (FILE2,">>$tempdata") || &security; print FILE2 "$replacementline\n"; close(FILE2); print "Content-type: text/html\n\n"; print "

\n"; print "$templatestart\n"; #S7. Acknowledge that record has been posted print "Your record has been sent to the WebMaster for approval. Simply close this submit window to return to your WebSite .. OR ... Use your Browser's Back Button to submit more Events.\n"; print "$templateend\n"; exit; } #STEP T================================ sub scrolltemp{ #T1. This step is your interface with the temp file #T2. Check password if ($adminpassword ne $checkpassword && $adminpassword){ $problem="The password you entered does not match your administration password. Please press BACK on your browser to fix this problem."; &security;} #T3. Check to make sure that the data file can be opened. $problem="Unable to open your temporary data file. It either contains no records, or the path to it is incorrect."; open (FILE, "$tempdata") || &security; @all=; close (FILE); print "Content-type: text/html\n\n"; #T4. Start showing contents of data file print "$templatestart\n"; print "
\n"; $checktemp=@all; if (!$checktemp){ print "Your temporary file contains no records for you to evaluate at this time. Please click here to continue.

\n"; print "$templateend\n"; exit;} print "KEY
A=Add to Database
D=Delete from Temp File
E=Add to Database but Mark for Editing
H=Hold in Temp File for Decision Later

\n"; print "\n"; print "\n"; foreach $line (@all){ $line=~s/\n//g; $checkleng=length($line); if ($checkleng<2){next}; ($indexvalues,$stringvalues)=split(/\(\+\+\)/,$line); ($ipaddress,$uniqueapproval)=split(/&&/,$indexvalues); ($Icon,$Event,$Description,$Venue,$Day,$Month,$Year,$Time,$Website,$Email,$Public_Remarks,$Private_Remarks,$skipthisfield)=split (/$delimiter/,$stringvalues); if ($Month eq "01"){ $Month2 = "January";} if ($Month eq "02"){ $Month2 = "February";} if ($Month eq "03"){ $Month2 = "March";} if ($Month eq "04"){ $Month2 = "April";} if ($Month eq "05"){ $Month2 = "May";} if ($Month eq "06"){ $Month2 = "June";} if ($Month eq "07"){ $Month2 = "July";} if ($Month eq "08"){ $Month2 = "August";} if ($Month eq "09"){ $Month2 = "September";} if ($Month eq "10"){ $Month2 = "October";} if ($Month eq "11"){ $Month2 = "November";} if ($Month eq "12"){ $Month2 = "December";} print "\n"; if ($Icon){ print "\n";} else { print "\n";} print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $keeptrack2++; if ($keeptrack2>10){ last}; } print "
ADEHFieldContents
IP Address:$ipaddress
    Icon:$Icon
    Icon:Nil
    Event:$Event
    Description:$Description
    Venue:$Venue
    Date:$Month2 $Day, $Year
    Time:$Time
    Website:$Website
    Email:$Email
    Public Remarks:$Public_Remarks
    Private Remarks:$Private_Remarks
\n"; if ($keeptrack2>=10){ print "

\n";} else{ print "\n";} print "$templateend\n"; exit; } #STEP U================================ sub updatetemp{ #U1. This step makes changes from temp file #U2. Check password if ($adminpassword ne $checkpassword && $adminpassword){ $problem="The password you entered does not match your administration password. Please press BACK on your browser to fix this problem."; &security;} $problem="Unable to open your temporary data file. It either contains no records, or the path to it is incorrect."; open (FILE, "$tempdata") || &security; @all=; close (FILE); foreach $line (@all){ $line=~s/\n//g; $checkleng=length($line); if ($checkleng<2){next}; ($indexvalues,$stringvalues)=split(/\(\+\+\)/,$line); ($ipaddress,$uniqueapproval)=split(/&&/,$indexvalues); ($Icon,$Event,$Description,$Venue,$Day,$Month,$Year,$Time,$Website,$Email,$Public_Remarks,$Private_Remarks,$skipthisfield)=split (/$delimiter/,$stringvalues); if ($tempapprove{$uniqueapproval} eq "A"){ push(@recordstoadd,$stringvalues);} elsif ($tempapprove{$uniqueapproval} eq "D"){ push(@recordstodelete,$stringvalues);} elsif ($tempapprove{$uniqueapproval} eq "E"){ push(@recordstoedit,$stringvalues);} else { push(@recordstohold,$line);} } $problem="Unable to open data file to add records. Check path to it and its permissions."; open (FILE, ">>$data") || &security; foreach $line (@recordstoadd){ $line=~s/\n//g; print FILE "$line\n";} close(FILE); $problem="Unable to open data file to records to edit. Check path to it and its permissions."; open (FILE, ">>$data") || &security; foreach $line (@recordstoedit){ $line=~s/\n//g; print FILE "markedtoedit$line\n";} close(FILE); $problem="Unable to open temporary file to refresh data. Check path to it and its permissions."; open (FILE, ">$tempdata") || &security; foreach $line (@recordstohold){ $line=~s/\n//g; print FILE "$line\n";} close(FILE); $checkhold=@recordstohold; if ($checkhold){ &scrolltemp;} print "Content-type: text/html\n\n"; print "$templatestart\n"; print "

Your actions have been taken. Please click here to continue.

\n"; print "$templateend\n"; exit; }


Calendar .. Compliments of
TAMPABAYENTERTAINMENT.COM
THE TAMPABAY ENTERTAINMENT GUIDE
A Division of USAEntertainment.Com

SUBMIT NEW EVENTS