summaryrefslogtreecommitdiffstats
path: root/staticweb/index.pl
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 14:51:38 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 14:51:38 +0800
commit6586626ac878e99b9e3f5f15ac5ec37cd7484831 (patch)
treefca68420fa85ce89d84f723354d2feacd99e60e4 /staticweb/index.pl
parentd9a7b30d990e2bab67413fe11acb2d9f7096a61a (diff)
downloadpttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.gz
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.bz2
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.lz
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.xz
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.zst
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.zip
better big5=>gb2312 implementation
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1415 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'staticweb/index.pl')
-rwxr-xr-xstaticweb/index.pl21
1 files changed, 13 insertions, 8 deletions
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();