#!/usr/bin/perl ############################################ ## ## ## WebCal (Config Script) ## ## by Darryl Burgdorf ## ## (e-mail burgdorf@awsd.com) ## ## ## ## version: 1.21 ## ## last modified: 1/4/00 ## ## copyright (c) 2000 ## ## ## ## latest version is available from ## ## http://awsd.com/scripts/ ## ## ## ############################################ $cgiurl = "http://www.folkets-kamp.org/kalender/webcal.pl"; $addcgiurl = "http://www.folkets-kamp.org/kalender/webcal.add.pl"; $deletecgiurl = "http://www.folkets-kamp.org/kalender/webcal.delete.pl"; @datafiles = ( "/usr/foo/webcal/data.astro.txt", "/usr/foo/webcal/data.holidays.txt", "/usr/foo/webcal/data.jewish.txt" ); %editfiles = ( "File 1","/usr/foo/webcal/data.edit1.txt", "File 2","/usr/foo/webcal/data.edit2.txt" ); $DataDirPath = "/usr/foo/webcal/data"; $DataDirURL = "http://www.foo.com/webcal/data"; $DataDir_header = ""; $DataDir_footer = ""; $bodyspec = "BGCOLOR=\"#ffffff\" TEXT=\"#000000\""; $header_file = "/usr/foo/webcal/header.txt"; $footer_file = "/usr/foo/webcal/footer.txt"; $CalendarTitle = "WebCal Calendar"; $DisplayCounter = 1; $DisplayPhases = 1; $DefaultType = "Table"; $SmallTableText = 1; $PreviousLastOnly = 0; $AllowUserChoice = 1; $AllowHTML = 1; $AllowMultiDate = 1; $bgcolor_normal = "ffffff"; $bgcolor_header = "6666ff"; $bgcolor_special = "ccccff"; $textcolor_normal = "000000"; $textcolor_header = "000000"; $textcolor_today = "ff0000"; $textcolor_special = "0000ff"; $TableFont = "Arial"; $HourOffset = 0; $MonSunWeek = 0; # NOTHING BELOW THIS LINE NEEDS TO BE ALTERED! $version = "1.21"; @months = (January,February,March,April,May,June, July,August,September,October,November,December); @shortmonths = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec); if ($MonSunWeek) { @days = (Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday); @shortdays = (Mon,Tue,Wed,Thu,Fri,Sat,Sun); } else { @days = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday); @shortdays = (Sun,Mon,Tue,Wed,Thu,Fri,Sat); } $time = time; ($mday,$month,$year) = (localtime($time+($HourOffset*3600)))[3,4,5]; $month = $month+1; $year += 1900; unless ($INPUT{'Month'}) { $INPUT{'Month'} = $month; } unless ($INPUT{'Year'}) { $INPUT{'Year'} = $year; } unless ($INPUT{'Type'}) { $INPUT{'Type'} = $DefaultType; $DefaultUsed = 1; } print "Content-type: text/html\n\n"; sub Header { ($title) = @_; print "$title\n"; print "\n"; if ($header_file) { open (HEADER,"$header_file"); @header =
; close (HEADER); foreach $line (@header) { if ($line =~ //i) { &insertadvert($1); } else { print "$line"; } } } } sub Footer { unless ($PreviousLastOnly) { print "


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

Month: "; print "Year: "; if ($AllowUserChoice) { print "Type: "; } print "\n"; print "

\n"; print "

\n"; } if (($INPUT{'Type'} eq "Small Table") && $SmallTableText && !($DefaultUsed)) { print "\n"; } print "


\n\n

"; print "Maintained with "; print ""; print "WebCal $version.\n\n"; if ($footer_file) { open (FOOTER,"$footer_file"); @footer =