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
/
library.cgi
< prev
next >
Wrap
Text File
|
2017-09-21
|
2KB
|
123 lines
#!/usr/local/bin/perl5
$| = 1;
# script for life section of the Theme Kan
# 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 'lists.pl';
$ThisFile = '/stage/htdocs/cgi-bin/Japan/Theme/entry.cgi';
# print "Content-type: text/html\n\n";
&read_in_data;
&init_dbm;
&check_users;
&print_gif;
&close_dbm;
#########################################################################
sub read_in_data {
# read in submitted form data contents into the hash %FormDataHash
&ReadInFormData(\%FormDataHash);
foreach $Key (keys(%FormDataHash)) {
# print "//$Key:$FormDataHash{$Key}//\n";
}
$SecName = $FormDataHash{'section'};
$TypeName = $FormDataHash{'sectype'};
# print "$FormDataHash{'gif'}\n";
# print "$SecName\n";
# print "$TypeName\n";
}
sub init_dbm {
$ListLastPath = "$ThemePath/$SecName/park/dbm/$TypeName/$ListLast";
$ListUsersPath = "$ThemePath/$SecName/park/dbm/$TypeName/$ListUsers";
dbmopen(%LastAccessToPage,$ListLastPath,0666);
dbmopen(%UserAccessToPage,$ListUsersPath,0666);
# $Count = 1;
# while ($Count < $PeopleNo) {
# $UserAccessToPage{$Count} = "none";
# $LastAccessToPage{$Count} = 0;
# $Count++;
# }
}
sub check_users {
$ExpireTime = time - $ExpiryTime;
$Key = 1;
$WhileNo = $PeopleNo + 1;
$People = 0;
while ($Key < $WhileNo) {
if ($LastAccessToPage{$Key} > 0) {
if ($LastAccessToPage{$Key} < $ExpireTime) {
$UserAccessToPage{$Key} = "none";
$LastAccessToPage{$Key} = 0;
}
}
$Key++;
}
$Key = 1;
while ($Key < $WhileNo) {
if ($LastAccessToPage{$Key} > 0) {
$People++;
}
$Key++;
}
}
sub print_gif {
$NumGifPath = "$ThemePath/$SecName";
if ($People < 30) {
open (IMAGE, "$NumGifPath/image/$People.gif");
}
else {
open (IMAGE, "$NumGifPath/image/over.gif");
}
select(STDOUT);
# tell the server that we're sending data back now
print "Content-type: image/gif\n\n";
while (<IMAGE>) {
print $_;
}
close (IMAGE);
}
sub close_dbm {
dbmclose(%LastAccessToPage);
dbmclose(%UserAccessToPage);
}