From ecb281f1ee77bbc3d1c99a9354a92b2d33ae614e Mon Sep 17 00:00:00 2001 From: in2 Date: Tue, 15 Jul 2003 09:07:27 +0000 Subject: class hierarchy support git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1052 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- staticweb/index.html | 42 +++++++++++++++++++++++++++++++----------- staticweb/index.pl | 15 +++++++++++++-- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/staticweb/index.html b/staticweb/index.html index 45372764..6ad6e831 100644 --- a/staticweb/index.html +++ b/staticweb/index.html @@ -5,18 +5,38 @@ -[% IF gb %]批踢踢实业坊之精华区[% ELSE %]у金金龟穨ぇ弘地跋[% END %](experimental)
-
-[% FOREACH x=dat %] -[% IF x.0 == -1 %] - - -[% ELSE %] - - -[% END %] -[% x.2 %]
+[% IF gb %]批踢踢实业坊之精华区[% ELSE %]у金金龟穨ぇ弘地跋[% END %] +[% FOREACH x=class %] +»[% x.title %] [% END %] +
+
+ + [% IF !isroot %] + + + + + + [% END %] + [% FOREACH x=dat %] + + + + + + [% END %] +
+ + + + 糷 +
+ + [% x.1 %] + [% IF x.0 == -1 %][% ELSE %][% END %] + [% x.2 %] +

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, -- cgit v1.2.3