home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet 1996 World Exposition
/
park.org.s3.amazonaws.com.7z
/
park.org.s3.amazonaws.com
/
cgi-bin
/
Japan
/
Theme
/
meet.cgi
< prev
next >
Wrap
Text File
|
2017-09-21
|
3KB
|
150 lines
#!/usr/local/bin/perl
$| = 1;
# script for meeting room
# jrh
$CgiPath = '/stage/htdocs/cgi-bin/Japan/Theme';
push(@INC, "$CgiPath");
require 'jcode.pl'; # tends to be in /usr/local/lib/perl
require 'read-form.pl'; # tends to be in your cgi path
require 'meetinit.pl';
require 'frames.pl';
require 'output.pl';
$ThisFile = '/stage/htdocs/cgi-bin/Japan/Theme/meet.cgi';
# print "Content-type: text/html\n\n";
&read_in_data;
&init_dbm;
&calculate_frame;
&print_frame;
&close_dbm;
#########################################################################
sub read_in_data {
# read in submitted form data contents into the hash %FormDataHash
&ReadInFormData(\%FormDataHash);
$GifName = $FormDataHash{'gif'};
$UserName = $FormDataHash{'username'};
$ParkName = $FormDataHash{'park'};
# print "$FormDataHash{'gif'}\n";
# print "$FormDataHash{'username'}\n";
}
sub init_dbm {
$LastPath = "$ThemeDBMPath/$ParkName/$LastAccess";
$UserPath = "$ThemeDBMPath/$ParkName/$UserAccess";
$UpdatePath = "$ThemeDBMPath/$ParkName/$LastUpdate";
$EntryPath = "$ThemeDBMPath/$ParkName/$EntryTime";
$GifPath = "$ThemeDBMPath/$ParkName/$GifNumber";
$TextPath = "$ThemeDBMPath/$ParkName/$TextLocation";
$ColorFilePath = "$ThemeDBMPath/$ParkName/$ColorFile";
$ColorNamesPath = "$ThemeDBMPath/$ParkName/$ColorNames";
dbmopen(%LastAccessToPage,$LastPath,0666);
dbmopen(%UserAccessToPage,$UserPath,0666);
dbmopen(%LastUpdateToPage,$UpdatePath,0666);
dbmopen(%EntryToPage,$EntryPath,0666);
dbmopen(%GifToPage,$GifPath,0666);
dbmopen(%TextDB,$TextPath,0666);
dbmopen(%Colors,$ColorFilePath,0666);
dbmopen(%ColorName,$ColorNamesPath,0666);
}
sub calculate_frame {
$Accessing = 0;
$ExpireTime = time - $ExpiryTime;
$LastKey = 1;
$WhileNo = $FrameNo + 1;
$Key = 1;
$NewUpdate = 0;
while ($Key < $WhileNo) {
if ($UserName eq $UserAccessToPage{$Key}) {
$Accessing = 1;
$MyKey = $Key
}
$Key++;
}
$Key = 1;
while ($Key < $WhileNo) {
if ($LastUpdateToPage{$Key} ge $LastAccessToPage{$MyKey}) {
$NewFrame{$Key} = 1;
$NewUpdate = 1;
}
else {
$NewFrame{$Key} = 0;
}
$Key++;
}
if ($Accessing == 1) {
$LastAccessToPage{$MyKey} = time;
}
$Key = 1;
while ($Key < $WhileNo) {
if ($LastAccessToPage{$Key} gt 0) {
if ($LastAccessToPage{$Key} < $ExpireTime) {
$CleanKey = $Key;
$UserAccessToPage{$Key} = "vacant";
$LastAccessToPage{$Key} = 0;
$LastUpdateToPage{$Key} = time;
$GifToPage{$Key} = "$ThemeSite$ThemeURL/$ParkName/park/image/vacancy.gif";
&clean_frame;
}
}
$Key++;
}
}
sub print_frame {
if ($NewUpdate == 1) {
$Key = 1;
$UpdateString = "";
while ($Key < $WhileNo) {
if ($NewFrame{$Key} == 1) {
$UpdateString .= "$Key";
$LastKey = $Key;
}
$Key++;
}
chop ($UpdateString);
&print_user;
}
else {
&print_meet;
}
}
sub close_dbm {
dbmclose(%LastAccessToPage);
dbmclose(%UserAccessToPage);
dbmclose(%TextDB);
dbmclose(%Colors);
dbmclose(%ColorName);
}