diff options
Diffstat (limited to 'staticweb/index.pl')
-rwxr-xr-x | staticweb/index.pl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/staticweb/index.pl b/staticweb/index.pl index 6280ebd5..cb475725 100755 --- a/staticweb/index.pl +++ b/staticweb/index.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: index.pl,v 1.4 2003/07/11 10:11:24 in2 Exp $ +# $Id: index.pl,v 1.5 2003/07/15 09:07:27 in2 Exp $ use lib qw/./; use LocalVars; use CGI qw/:standard/; @@ -25,11 +25,15 @@ sub main $rh{charset} = 'big5'; } + return redirect('/index.pl/'.($rh{gb}?'?gb=1':'')) + if( $ENV{REQUEST_URI} eq '/' ); + charset(''); print header(); - ($bid) = $ENV{PATH_INFO} =~ m|^/(\d+)/$|; + ($bid) = $ENV{PATH_INFO} =~ m|.*/(\d+)/$|; $bid ||= 0; + $rh{isroot} = ($bid == 0); if( !$brd{$bid} ){ print "sorry, this bid $bid not found :("; @@ -42,6 +46,13 @@ sub main push @{$rh{dat}}, $_; } + my $path = ''; + foreach( $ENV{PATH_INFO} =~ m|(\w+)|g ){ + push @{$rh{class}}, {path => "$path/$_/", + title => $brd{"$_.title"}}; + $path .= "/$_"; + } + $tmpl = Template->new({INCLUDE_PATH => '.', ABSOLUTE => 0, RELATIVE => 0, |