#!/usr/local/bin/perl ####################################################################### # somr basic configs & var-initialisation # ####################################################################### #Kennzeichen-Kürzel plateID $cid = "EICLUSt"; # Stadt / town name $stadt = "Linux-Stammtisch Eichsfeld"; # Webdomainname $webdomain = "linux.eichsfeld.net"; ####################################################################### # # Groupware DataRegio kalender # # Version: 4.0 # # Last Modified: 08-14-96 ####################################################################### # Print http Header. # ####################################################################### #require("/home/httpd/cgi-bin/banner/iweb.pm"); $! = 1; print "Content-type: text/html\n\n"; ####################################################################### # Require Libraries. # ####################################################################### $font_titelcateg="FONT FACE=Verdana,Helvetica"; $titel_bgcolor="#EAE7FE"; $lib = "./Library"; &CgiRequire("$lib/cgi-lib.pl", "$lib/cgi-lib.sol", "$lib/auth-lib.pl", "$lib/date.pl"); ####################################################################### # Gather Form Data. # ####################################################################### # Now use cgi-lib.pl to parse the incomming form data. We'll pass # cgi-lib.pl (*form_data) so that our variable will come out as # $form_data{'key'} instead of $in{'$key'}. I like to use form_data # because it is easier for me to remember what the variable is. # In the end, we will be able to refernce all of the incoming form data as # $form_data{'variablename'} &ReadParse(*form_data); ####################################################################### # Determine Which Calendar Database to Use. # ####################################################################### # Now we will need to determine which calendar databse to use. If the # admin has set up more than one calendar, each calendar database will be # in a subdirectory. In order to reference these separate databases, the # link to this script must have added ?calenar=Somesubdirectory at the end # of the URL. If we are asking for the main calendar, this variable will # not be equal to anything. if ($form_data{'calendar'} ne "") { $calendar_type = "./$form_data{'calendar'}"; } else { $calendar_type = "./"; } ####################################################################### # Define Variables # ####################################################################### # Now we will define all of our variables by using the define file that # you should have customized for your own site. &CgiRequire("calendar.setup"); # Now we are going to want to make sure that we "remember" the # session_file so that we can continually check for authentication and # keep track of who the current client is. However, if the client has # already logged on, then we will not be going back through the # authentication rouitines but will be getting the $session_file as form # data (the same hidden field we are about to define). So, we need to # rename $form_data{'session_file'} to $session_file so that in both cases # (first time to this point or continuing client) we'll have the # session_id in the same variable name form. if ($form_data{'session_file'} ne "") { $session_file = $form_data{'session_file'}; } # Now rename some other variables with the same idea... if ($form_data{'year'} ne "") { $current_year = "$form_data{'year'}"; } else { $current_year = "$the_current_year"; } if ($form_data{'month'} eq "") { @mymonth = &make_month_array(&today); $current_month_name = &monthname($currentmonth); } else { @mymonth = &make_month_array(&jday($form_data{'month'},1,$current_year)); $current_month_name = &monthname($form_data{'month'}); } %categorylist=('für Anfänger'=>'anfaenger.gif', 'für Fortgeschrittene'=>'fortg.gif', 'Themenabend','thema.gif', 'Private Termine','privat.gif', 'Tips von anderswo...'=>'tips.gif', 'TLUG'=>'tlug.gif'); $img_dir="/kalender/grafik"; ####################################################################### # Print out Generic Header HTML. # ####################################################################### # Okay, so if we got to this line, it means that the client has # successsfully made it past security. So let's print out the basic # header information. You may modify everything between the # "print qq! and the !; but be careful of # illegal characters like @ which must be preceeded by a backslash # (ie: selena\@eff.org) # # Also create the hidden form tags that will pass along the session_file # info and the name of the calendar that we are dealing with. It is # crucial that we make sure to pass this info along through every page so # that this script can keep track of the clients as they wander about. ####################################################################### # Print out Calendar # ####################################################################### # Now let's actually print out the dynamically generated calendar. We'll # need to do this in two cases. Firstly, if we have just logged on and # the client is asking for the very first page ($form_data{'session_file'} # ne "") and secondly, if the client has already been moving through # various pages and has asked to view the calendar again # ($form_data{'change_month_year'} ne ""). The || means "or". Thus, if # either case is true, we will procede. if ($form_data{'change_month_year'} ne "" || $ENV{'REQUEST_METHOD'} eq "GET" && $form_data{'day'} eq "") { # Now print out the HTML calendar &header ("Linux-Stammtisch Eichsfeld - Termine $current_month_name - $current_year"); print qq!
<$font_titelcateg>!;
($form_data{'ort'} ne"") && print "Ort: $form_data{'ort'} "; ($form_data{'nutzername'} ne "") && print "Kalenderblatt von $form_data{'nutzername'} "; print qq! Termine $current_month_name - $current_year |
Schnellsuche: !;
($form_data{'ort'} ne"") && print "";
($form_data{'nutzername'} ne "") && print "";
print qq!
um einen Tag einzusehen,
klicken Sie bitte auf die entprechende Nr.
$day | \n"; } print "|
---|---|
\n!;
print qq!$day_number\n !; } else{ print qq! | \n!;
print qq!$day_number\n !; } # Grab the subject listings for all the entries on that day. Make sure # also that if we are unable to open the database file, that we send a # useful message back to us for debugging. We'll do this using the # open_error subroutine in cgi-lib.sol passing the routine the location of # the database file. open (DATABASE, "$database_file") || &CgiDie ("I am sorry, but I was unable to open the calendar data file in the Create a Table Cell for Each Day routine. The value I have is $database_file. Would you please check the path ansd the permissions."); while ( | \n";
undef %is_printed;
# If, however, we have reached the end of a week row, we are going to need
# to begin a new table row for the next week. If $weekday is equal to
# zero, then we know that it is time. If not, continue with the row.
# (BTW, here we use == instead of just = because if we used =, perl would
# interpret the part inside the if () to be assigning the value of zero to
# $weekday...which it would do...and evaluate the whole process as true.
# That of course would undercut the whole point of counting with
# $weekday.)
if ($weekday == 0)
{
print "