#!/usr/bin/perl -w use CGI qw(param); print "Content-type: text/html","\n","\n"; my $action = param("action"); my $page = param("page"); if ( $action ) { print(qx!cat header.html!); if ( ( $ENV{'HTTP_USER_AGENT'} =~ /MSIE/ ) || ( $ENV{'HTTP_USER_AGENT'} =~ /Opera/ ) || ( $ENV{'HTTP_USER_AGENT'} =~ /5.0/ ) ) { print(qx!cat mid.html!); } else { print(qx!cat mid-ns.html!); } if ( $action eq "archived" ) { if ( !$page ) { print(qx!cat archived.html!); } else { print(qx!cat archived/$page.html!); } } elsif ( $action eq "players" ) { if ( !$page ) { print(qx!cat players.html!); } else { print(qx!cat players/$page.html!); } } elsif ( $action eq "nostalg" ) { if ( !$page ) { print(qx!cat nostalg.html!); } elsif ( $page eq "doomtrick" ) { print(qx!cat nostalg/doomtrick.html!); } elsif ( $page eq "doom2trick" ) { print(qx!cat nostalg/doom2trick.html!); } elsif ( $page eq "graphs" ) { print(qx!cat nostalg/graphs.html!); } elsif ( $page =~ /e[0-9]m[0-9]/ ) { print(qx!cat nostalg/doom/$page.html!); } elsif ( $page =~ /map[0-9][0-9]/ ) { print(qx!cat nostalg/doom2/$page.html!); } } elsif ( $action eq "incoming" ) { print(qx!cat incomheader.html!); print "Orig. game demos
"; print "Total of"; print(qx!ls -t mirror | grep -v cgi | grep -v log | grep -v pwads | grep -v index | wc -l!); print " demos:
"; @orig = qx!ls -t mirror | grep -v cgi | grep -v log | grep -v pwads | grep -v index!; foreach $i ( @orig ) { chomp $i; print "[$i] "; } print "
PWAD demos
"; print "Total of"; print(qx!ls -t mirror/pwads/ | grep -v log | grep -v index | wc -l!); print " demos:
";
@pwad = qx!ls -t mirror/pwads/ | grep -v cgi | grep -v log | grep -v pwads | grep -v index!;
foreach $i ( @pwad )
{
chomp $i;
print "[$i] ";
}
print(qx!cat incomfooter.html!);
}
elsif ( $action eq "about" )
{
print(qx!cat about.html!);
}
elsif ( $action eq "contest" )
{
print(qx!cat contest.html!);
}
elsif ( $action eq "coop" )
{
print(qx!cat $page.html!);
}
elsif ( $action eq "database" )
{
print(qx!cat database.html!);
}
elsif ( $action eq "faq" )
{
print(qx!cat faq.html!);
}
elsif ( $action eq "links" )
{
print(qx!cat links.html!);
}
elsif ( $action eq "pwads" )
{
if ( !$page )
{
print(qx!cat pwads.html!);
}
else
{
print(qx!cat $page.html!);
}
}
elsif ( $action eq "trivia" )
{
if ( !$page )
{
print(qx!cat trivia/egy.html!);
}
else
{
print(qx!cat trivia/$page.html!);
}
}
elsif ( $action eq "rules" )
{
print(qx!cat rules.html!);
}
elsif ( $action eq "stats" )
{
print(qx!cat stats.html!);
}
print(qx!cat footer.html!);
}
else
{
print(qx!cat header.html!);
open(COUNTFILE,"< count") || die("Cannot open file for reading\n");
$j =
","\n";
close(COUNTFILE);
open(COUNTFILE,"> count") || die("Cannot open file for writing\n");
print COUNTFILE $j;
close(COUNTFILE);
$now = localtime(time);
open(LOGFILE,">> log") || die("Cannot open file for writing\n");
print LOGFILE $now;
print LOGFILE "\n";
print LOGFILE $j;
print LOGFILE "\n";
print LOGFILE $ENV{'REMOTE_HOST'};
print LOGFILE "\n";
print LOGFILE $ENV{'REMOTE_ADDR'};
print LOGFILE "\n";
print LOGFILE $ENV{'HTTP_USER_AGENT'};
print LOGFILE "\n\n";
close(LOGFILE);
if ( ( $ENV{'HTTP_USER_AGENT'} =~ /MSIE/ ) || ( $ENV{'HTTP_USER_AGENT'} =~ /5.0/ ) )
{
print(qx!cat mid.html!);
}
else
{
print(qx!cat mid-ns.html!);
}
print(qx!cat main.html!);
print(qx!cat footer2.html!);
}
exit 0;