summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-20 20:44:44 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-20 20:44:44 +0800
commit7571b2c04bf5df4c4937dea135ecc0e076af990f (patch)
tree4e3e2061ea92e60fcb5b972157eda1d76f8cc224
parentf15c260b2d6669d042830890f3e076384653e4ae (diff)
downloadpttbbs-7571b2c04bf5df4c4937dea135ecc0e076af990f.tar
pttbbs-7571b2c04bf5df4c4937dea135ecc0e076af990f.tar.gz
pttbbs-7571b2c04bf5df4c4937dea135ecc0e076af990f.tar.bz2
pttbbs-7571b2c04bf5df4c4937dea135ecc0e076af990f.tar.lz
pttbbs-7571b2c04bf5df4c4937dea135ecc0e076af990f.tar.xz
pttbbs-7571b2c04bf5df4c4937dea135ecc0e076af990f.tar.zst
pttbbs-7571b2c04bf5df4c4937dea135ecc0e076af990f.zip
add board title to html titlepttbbs-beforefav4@1354
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1354 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--staticweb/b2g.pm5
-rw-r--r--staticweb/header.html4
-rwxr-xr-xstaticweb/index.pl11
-rwxr-xr-xstaticweb/man.pl2
4 files changed, 16 insertions, 6 deletions
diff --git a/staticweb/b2g.pm b/staticweb/b2g.pm
index c7cf318d..7b3b8ddf 100644
--- a/staticweb/b2g.pm
+++ b/staticweb/b2g.pm
@@ -13982,4 +13982,9 @@ our(@ISA, @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(%b2g);
+sub big5togb
+{
+ $_[0] =~ s/([\xA1-\xF9].)/$b2g{$1}/eg;
+}
+
1;
diff --git a/staticweb/header.html b/staticweb/header.html
index 7f33ab66..9683178b 100644
--- a/staticweb/header.html
+++ b/staticweb/header.html
@@ -5,11 +5,11 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="[% lang %]" lang="[% lang %]">
<head>
- <title>[% IF gb %]批踢踢实业坊[% ELSE %]у金金龟穨[% END %]</title>
+ <title>[% IF gb %]批踢踢实业坊[% ELSE %]у金金龟穨[% END %][% IF exttitle %] - [% exttitle %][% END %]</title>
<meta http-equiv="Content-Type"
content="text/html; charset=[% charset %]">
<meta name="generator" content="pttMan" />
<meta name="robots" content="all" />
- <link rel="stylesheet" href="/styles.css" type="text/css" />
+ <link rel="stylesheet" href="http://pttx.ptt.cc:4099/ptt.man/styles.css" type="text/css" />
</head>
<body>
diff --git a/staticweb/index.pl b/staticweb/index.pl
index cb475725..d4c9e14c 100755
--- a/staticweb/index.pl
+++ b/staticweb/index.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id: index.pl,v 1.5 2003/07/15 09:07:27 in2 Exp $
+# $Id$
use lib qw/./;
use LocalVars;
use CGI qw/:standard/;
@@ -42,16 +42,21 @@ sub main
foreach( @{$brd{$bid}} ){
next if( $_->[0] == -1 && ! -e "$MANDATA/$_->[1].db" );
- $_->[2] =~ s/([\xA1-\xF9].)/$b2g{$1}/eg if( $rh{gb} );
+ 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 => $brd{"$_.title"}};
+ title => $t};
$path .= "/$_";
}
+ $rh{exttitle} = ($rh{class} ?
+ $rh{class}[ $#{@{$rh{class}}} ]{title} :
+ ($rh{gb} ? '首页' : ''));
$tmpl = Template->new({INCLUDE_PATH => '.',
ABSOLUTE => 0,
diff --git a/staticweb/man.pl b/staticweb/man.pl
index 8ade7d6c..4e9c2ed3 100755
--- a/staticweb/man.pl
+++ b/staticweb/man.pl
@@ -69,7 +69,7 @@ sub dirmode
digester => 'MD5',
compress => 0,
);
- foreach( @{$serial->deserialize($db{$fpath})} ){
+ 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);