From 6586626ac878e99b9e3f5f15ac5ec37cd7484831 Mon Sep 17 00:00:00 2001
From: in2
diff --git a/staticweb/banner.html b/staticweb/banner.html
index 4a8d0678..c6b9688b 100644
--- a/staticweb/banner.html
+++ b/staticweb/banner.html
@@ -1,10 +1,10 @@
diff --git a/staticweb/dir.html b/staticweb/dir.html
index 50f5ef63..2a40ae72 100644
--- a/staticweb/dir.html
+++ b/staticweb/dir.html
@@ -5,17 +5,17 @@
-[% IF gb %]看板[% ELSE %]狾[% END %]: [% brdname %]
-[% IF gb %]回上页[% ELSE %][% END %]
+狾: [% brdname %]
+
@@ -9,8 +9,8 @@
-[% IF gb %]回上页[% ELSE %][% END %]
-[% IF gb %]批踢踢实业坊[% ELSE %]у金金龟穨[% END %] (PttWeb)
+
+у金金龟穨 (PttWeb)
-[% IF gb %]网页版精华区首页[% ELSE %]呼弘地跋[% END %]
-[% brdname %][% IF gb %]精华区首页[% ELSE %]弘地跋[% END %]
-[% IF gb %]批踢踢部落格(big5 only)[% ELSE %]у金金场辅[% END %]
+呼弘地跋
+[% brdname %]弘地跋
+у金金场辅(big5 only)
-[% IF gb %]看板名称[% ELSE %]狾嘿[% END %]: [% brdname %]
+狾嘿: [% brdname %]
[% IF !isroot %]
-[% IF gb %]返回上一层[% ELSE %]糷[% END %]
+糷
[% END %]
[% FOREACH x=dat %]
@@ -28,14 +28,14 @@
[% IF !gb %]
[% END %]
-[% IF gb %]制作时间[% ELSE %]籹丁[% END %]: [% buildtime %]
-[% IF gb %]批踢踢实业坊[% ELSE %]у金金龟穨[% END %] (PttWeb)
+籹丁: [% buildtime %]
+у金金龟穨 (PttWeb)
diff --git a/staticweb/header.html b/staticweb/header.html index 9683178b..5dc7161b 100644 --- a/staticweb/header.html +++ b/staticweb/header.html @@ -5,7 +5,7 @@
-
+
diff --git a/staticweb/index.html b/staticweb/index.html index 6ad6e831..e13f7d2d 100644 --- a/staticweb/index.html +++ b/staticweb/index.html @@ -5,7 +5,7 @@
diff --git a/staticweb/index.pl b/staticweb/index.pl index d4c9e14c..87c9b5f5 100755 --- a/staticweb/index.pl +++ b/staticweb/index.pl @@ -42,21 +42,17 @@ sub main foreach( @{$brd{$bid}} ){ next if( $_->[0] == -1 && ! -e "$MANDATA/$_->[1].db" ); - b2g::big5togb($_->[2]) if( $rh{gb} ); push @{$rh{dat}}, $_; } my $path = ''; foreach( $ENV{PATH_INFO} =~ m|(\w+)|g ){ - my $t = $brd{"$_.title"}; - b2g::big5togb($t) if( $rh{gb} ); push @{$rh{class}}, {path => "$path/$_/", - title => $t}; + title => $brd{"$_.title"}}; $path .= "/$_"; } $rh{exttitle} = ($rh{class} ? - $rh{class}[ $#{@{$rh{class}}} ]{title} : - ($rh{gb} ? '首页' : '')); + $rh{class}[ $#{@{$rh{class}}} ]{title} : ''); $tmpl = Template->new({INCLUDE_PATH => '.', ABSOLUTE => 0, @@ -64,8 +60,17 @@ sub main RECURSION => 0, EVAL_PERL => 0, COMPILE_EXT => '.tmpl', - COMPILE_DIR => $MANCACHE}); - $tmpl->process('index.html', \%rh); + COMPILE_DIR => $MANCACHE, + }); + if( !$rh{gb} ){ + $tmpl->process('index.html', \%rh); + } + else{ + my $output; + $tmpl->process('index.html', \%rh, \$output); + b2g::big5togb($output); + print $output; + } } main(); diff --git a/staticweb/man.pl b/staticweb/man.pl index 6afb7410..003f7ebf 100755 --- a/staticweb/man.pl +++ b/staticweb/man.pl @@ -59,7 +59,17 @@ sub main $rh->{lang} = 'zh_TW'; $rh->{charset} = 'big5'; } - $tmpl->process($rh->{tmpl}, $rh); + + if( !$rh->{gb} ){ + $tmpl->process($rh->{tmpl}, $rh); + } + else{ + my $output; + $tmpl->process($rh->{tmpl}, $rh, \$output); + b2g::big5togb($output); + print $output; + } + untie %db; } @@ -71,8 +81,6 @@ sub dirmode compress => 0, ); foreach( @{$serial->deserialize($db{$fpath}) || []} ){ - $_->[1] =~ s/([\xA1-\xF9].)/$b2g{$1}/eg if( $isgb ); - #Encode::from_to($_->[1], 'big5', 'gbk') if( $isgb ); $isdir = (($_->[0] =~ m|/$|) ? 1 : 0); push @{$th{dat}}, {isdir => $isdir, fn => "man.pl/$brdname$_->[0]", @@ -108,8 +116,6 @@ sub articlemode $th{content} =~ s|ptt\.twbbs\.org|ptt.twbbs.org|gs; - $th{content} =~ s/([\xA1-\xF9].)/$b2g{$1}/eg if( $isgb ); - #Encode::from_to($th{content}, 'big5', 'gbk') if( $isgb ); return \%th; } -- cgit v1.2.3