){
my $o = $_;
$o =~ s/\r//g;
$o =~ s/in\((\w+)\)/$in{$1}/g;
$o =~ s/\"/\\"/g;
$o =~ s/\\n/\\\\n/g;
$o =~ s/(scr)(ipt)/$1\"\+\"$2/gsi;
my @mylines = split(/\r*\n/,$o);
foreach my $q (@mylines){
print qq|document.write("$q\\n");\n|;
}
}
close OUT;
exit;
}
sub CheckVars{
##check for long lines
$in{'title'} =~ s/(\S{80,81})/$1 /g;
$in{'body'} =~ s/(\S{100,101})/$1 /g;
$in{'cv1'} =~ s/(\S{80,81})/$1 /g;
$in{'cv2'} =~ s/(\S{80,81})/$1 /g;
$in{'cv3'} =~ s/(\S{80,81})/$1 /g;
$in{'cv4'} =~ s/(\S{80,81})/$1 /g;
$in{'cv5'} =~ s/(\S{80,81})/$1 /g;
$in{'cv6'} =~ s/(\S{80,81})/$1 /g;
$in{'cv7'} =~ s/(\S{80,81})/$1 /g;
$in{'cv8'} =~ s/(\S{80,81})/$1 /g;
$in{'cv9'} =~ s/(\S{80,81})/$1 /g;
$in{'cv10'} =~ s/(\S{80,81})/$1 /g;
##dhtml
if($in{'command'} eq 'submitforapproval'){
$in{'title'} =~ s/\<.*?\>//gs;
$in{'body'} =~ s/\<.*?\>//gs;
$in{'cv1'} =~ s/\<.*?\>//gs;
$in{'cv2'} =~ s/\<.*?\>//gs;
$in{'cv3'} =~ s/\<.*?\>//gs;
$in{'cv4'} =~ s/\<.*?\>//gs;
$in{'cv5'} =~ s/\<.*?\>//gs;
$in{'cv6'} =~ s/\<.*?\>//gs;
$in{'cv7'} =~ s/\<.*?\>//gs;
$in{'cv8'} =~ s/\<.*?\>//gs;
$in{'cv9'} =~ s/\<.*?\>//gs;
$in{'cv10'} =~ s/\<.*?\>//gs;
($in{'requireapproval'})&&(!$in{'email'})&&(&PError("Please enter your email address"));
}
$in{'title'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'body'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv1'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv2'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv3'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv4'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv5'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv6'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv7'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv8'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv9'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'cv10'} =~ s/(\d+);/pack("c",$1)/ge;
$in{'title'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'body'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'body'} =~ s/\r*\n/\\n/g;
$in{'c1'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c2'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c3'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c4'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c5'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c6'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c7'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c8'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c9'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
$in{'c10'} =~ s/([^\w\s\n])/''.ord($1).';'/ge;
(!$in{'title'})&&(&PError("Error. Please enter a title"));
if($in{'showtimes'}){
(!$in{'sthour'})&&(!$in{'stmin'})&&(!$in{'stsuf'})&&(&PError("Please enter a start time"));
(!$in{'ethour'})&&(!$in{'etmin'})&&(!$in{'etsuf'})&&(&PError("Please enter an end time"));
}
if($in{'etype'} eq 'single'){
(!$in{'sedate'})&&(&PError("Please enter a date for this event"));
($in{'sedate'} !~ /[\d]{1,2}\-[\d]{1,2}\-[\d]{4}/)&&(&PError("Invalid event date format. Must be MM-DD-YYYY"));
}
if($in{'etype'} eq 'multiple'){
(!$in{'sdate'})&&(&PError("Please enter a start date for this event"));
($in{'sdate'} !~ /[\d]{1,2}\-[\d]{1,2}\-[\d]{4}/)&&(&PError("Invalid start date format. Must be MM-DD-YYYY"));
(!$in{'edate'})&&(&PError("Please enter an end date for this event"));
($in{'edate'} !~ /[\d]{1,2}\-[\d]{1,2}\-[\d]{4}/)&&(&PError("Invalid end date format. Must be MM-DD-YYYY"));
}
if($in{'etype'} eq 'recurring'){
(!$in{'srdate'})&&(&PError("Please enter a start date"));
if($in{'ed'} eq '1'){
$in{'oc'} = '';
$in{'erdate'} = '';
}
if($in{'ed'} eq '2'){
(!$in{'oc'})&&(&PError("Please enter the number of occurrences for this event"));
$in{'erdate'} = '';
}
if($in{'ed'} eq '3'){
(!$in{'erdate'})&&(&PError("Please an end date for this event"));
($in{'erdate'} !~ /[\d]{1,2}\-[\d]{1,2}\-[\d]{4}/)&&(&PError("Invalid end date format. Must be MM-DD-YYYY"));
$in{'oc'} = '';
}
if($in{'pattern'} eq '1'){
(!$in{'pdaily'})&&(&PError("Please enter the number of days for this event"));
}
if($in{'pattern'} eq '2'){
(!$in{'pweekly'})&&(&PError("Please enter the number of weeks for this event"));
(!$in{'wd0'})&&(!$in{'wd1'})&&(!$in{'wd2'})&&(!$in{'wd3'})&&(!$in{'wd4'})&&(!$in{'wd5'})&&(!$in{'wd6'})&&(&PError("Please select at least one weekday for this event"));
}
if(($in{'pattern'} eq '3')&&($in{'monthlytype'} eq '1')){
(!$in{'m1'})&&(&PError("Please the day for this event"));
(!$in{'m2'})&&(&PError("Please the number of months for this event"));
}
if(($in{'pattern'} eq '3')&&($in{'monthlytype'} eq '2')){
(!$in{'m3'})&&(&PError("Please select the day for this event"));
(!$in{'m4'})&&(&PError("Please select the day for this event"));
(!$in{'m5'})&&(&PError("Please select the number of months for this event"));
}
if(($in{'pattern'} eq '4')&&($in{'yearlytype'} eq '1')){
(!$in{'y1'})&&(&PError("Please the month for this event"));
(!$in{'y2'})&&(&PError("Please the year for this event"));
}
if(($in{'pattern'} eq '4')&&($in{'yearlytype'} eq '2')){
(!$in{'y3'})&&(&PError("Please the day for this event"));
(!$in{'y4'})&&(&PError("Please the month for this event"));
(!$in{'y5'})&&(&PError("Please the year for this event"));
}
}
($in{'color'})&&($in{'color'} =~ /[^#0-9A-Za-z]/)&&(&PError("Error. Invalid color specification"));
return;
}
www.CrestonValley.com
Virtual Designs
Copyright © 98-03