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.0105
/
meet.cgi
< prev
next >
Wrap
Text File
|
2017-09-21
|
3KB
|
139 lines
#!/usr/local/bin/perl5
$| = 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';
$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 = "$ThemePath/$ParkName/park/dbm/$LastAccess";
$UserPath = "$ThemePath/$ParkName/park/dbm/$UserAccess";
$GifPath = "$ThemePath/$ParkName/park/dbm/$GifNumber";
$TextPath = "$ThemePath/$ParkName/park/dbm/$TextLocation";
$ColorFilePath = "$ThemePath/$ParkName/park/dbm/$ColorFile";
$ColorNamesPath = "$ThemePath/$ParkName/park/dbm/$ColorNames";
dbmopen(%LastAccessToPage,$LastPath,0666);
dbmopen(%UserAccessToPage,$UserPath,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;
while ($Key < $WhileNo) {
if ($UserName eq $UserAccessToPage{$Key}) {
$Accessing = 1;
$LastAccessToPage{$Key} = time;
}
$Key++;
}
$Key = 1;
while ($Key < $WhileNo) {
if ($LastAccessToPage{$Key} gt 0) {
if ($LastAccessToPage{$Key} < $ExpireTime) {
$CleanKey = $Key;
$UserAccessToPage{$Key} = "vacant";
$LastAccessToPage{$Key} = 0;
$GifToPage{$Key} = "$ThemeSite$ThemeURL/$ParkName/park/image/vacancy.gif";
&clean_frame;
}
}
$Key++;
}
}
sub print_frame {
select(STDOUT);
# tell the server that we're sending data back now
print "Content-type: text/html\n\n";
# now send the server some html stuff
print "<HTML>\n\n";
print "<HEAD>\n\n";
print "<META HTTP-EQUIV=REFRESH CONTENT=\"10; URL=$ThemeCgi/meet.cgi?gif=$GifName&username=$UserName&park=$ParkName\">";
print "<TITLE>Frame 1</TITLE>\n";
print "</HEAD>\n\n";
print "<BODY BGCOLOR=\"#000000\">\n\n";
print "<CENTER>\n";
print "<FONT COLOR=\"#cccccc\"><H1>Text Chat</H1></FONT>\n\n";
print "</CENTER>\n";
foreach $Key (sort(keys(%TextDB))) {
print "$TextDB{$Key}\n\n";
print "</FONT>\n\n";
print "<BR>\n\n";
print "<BR>\n\n";
}
print "<P></P>";
print "</BODY>\n\n";
print "</HTML>\n\n";
}
sub close_dbm {
dbmclose(%LastAccessToPage);
dbmclose(%UserAccessToPage);
dbmclose(%TextDB);
dbmclose(%Colors);
dbmclose(%ColorName);
}