|
|
| If you would like to be informed of upcoming specials and packages at Elmhirst, please enter your e-mail address in the box below. Your e-mail will only be used for this purpose. |
Packages
#!/usr/bin/perl
#
#Make sure that the above line is at the very first line, not
#several lines down, and that it is completely flush with
#the left margin, or your script will not work.
use CGI;
$query = new CGI;
#You need to modify this script at all parts of Step B
#Depending on where Perl is on your server, the above location
#may not be correct. To find where Perl is, telnet to your
#server and at the prompt type: which perl This will tell you
#the correct path to Perl on your server. Or, contact your
#server administrator
#Script Description
#Unique script ID: 37f3-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!
#If this file is placed in the SAME folder as this script, just type the filename below.
#If this file is located in DIFFERENT folder as this script, use the FULL PATH (NOT URL).
#This file will be automatically created when you add your first event.
$data="eventpublisher3.txt";
#B1b. REQUIRED: The location of your TEMPORARY event data file on your server.
#Must be the PATH to your temporary data data file, not the URL. Use a file
#extension other than .tmp to avoid possible conflicts within script.
#If this file is placed in the SAME folder as this script, just type the filename below.
#If this file is located in DIFFERENT folder as this script, use the FULL PATH (NOT URL).
#This file will be automatically created when a user add the first temporary event.
$tempdata="eventpublisher3.tempdata";
#B1c. OPTIONAL: You can format the opening and closing HTML
#of your admin mode in a separate file that can be written in
#regular HTML and saved on your server. For ease of configuration,
#place it in the same directory as your icon images.
#Note: this file must have three plusses +++
#where you want your search results inserted.
$openinghtml="/var/www/html/domains/haliburtonatv/eventpublisher/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.elmhirst.com/eventpublisher/eventpublisher3.cgi";
#B4. REQUIRED TO ADD, DELETE, OR MODIFY.
#Change password to any combination of letters (A-Z, a-z) and
#numbers 0-1. USE ONLY LETTERS AND NUMBERS
$adminpassword="upoint";
#B5. URL to send users to after posting, editing, or getting errors.
#This is usually:
# (1) the admin form (if events are added by you most of the time) OR
# (2) the user submit form (if events are submitted by users most of the time)OR
# (3) this script itself (if you want to show the existing events after posting).
$forwardingURL="http://www.elmhirst.com/eventpublisher/eventpublisher3.cgi";
$forwardingURL1="http://www.elmhirst.com/eventpublisher/eventpublisher_admin3.htm";
#B16. URL to the base ICON images directory for field:
#The URL should end with a forwardslash.
$baseurltoIcon="http://www.randdwebhosting.com/domains/haliburtonatv/eventpublisher/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 =""; ### Recommended: "Verdana, Arial"
$fontsize= "2"; ### Used for event title and description only ###
$fonttitlecolor = "#21386B";
$fontsubtitlecolor ="#800000"; ### Used for event sub titles such as "Venue", "Date" ....
#B19. ****** REMEMBER THIS: IMPORTANT ****
#Open up all the *.htm forms that come with this script. Replace the form action URL
#under the tags " \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;
}
|
|

 |