diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-15 17:07:27 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-15 17:07:27 +0800 |
commit | ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e (patch) | |
tree | 5d00ed306cec8ec03c67ca96e14060e857e9b6cc /staticweb/index.pl | |
parent | fc131475724f43f18f7f442b9d2f2a3ed3a21046 (diff) | |
download | pttbbs-ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e.tar pttbbs-ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e.tar.gz pttbbs-ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e.tar.bz2 pttbbs-ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e.tar.lz pttbbs-ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e.tar.xz pttbbs-ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e.tar.zst pttbbs-ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e.zip |
class hierarchy support
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1052 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
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, |