diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-11 18:11:24 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-11 18:11:24 +0800 |
commit | f738a191377ce86fb030d5049f357e269f22e8f4 (patch) | |
tree | 83f6c67132fc8f68da02fde54aa6ec4659436189 /staticweb/index.pl | |
parent | cab45be10660cb32f5658de2c8d136237ab187f1 (diff) | |
download | pttbbs-f738a191377ce86fb030d5049f357e269f22e8f4.tar pttbbs-f738a191377ce86fb030d5049f357e269f22e8f4.tar.gz pttbbs-f738a191377ce86fb030d5049f357e269f22e8f4.tar.bz2 pttbbs-f738a191377ce86fb030d5049f357e269f22e8f4.tar.lz pttbbs-f738a191377ce86fb030d5049f357e269f22e8f4.tar.xz pttbbs-f738a191377ce86fb030d5049f357e269f22e8f4.tar.zst pttbbs-f738a191377ce86fb030d5049f357e269f22e8f4.zip |
use boardlist
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1048 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'staticweb/index.pl')
-rwxr-xr-x | staticweb/index.pl | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/staticweb/index.pl b/staticweb/index.pl index 71ad6117..6280ebd5 100755 --- a/staticweb/index.pl +++ b/staticweb/index.pl @@ -1,14 +1,16 @@ #!/usr/bin/perl -# $Id: index.pl,v 1.3 2003/07/05 05:19:18 in2 Exp $ +# $Id: index.pl,v 1.4 2003/07/11 10:11:24 in2 Exp $ use lib qw/./; use LocalVars; use CGI qw/:standard/; use strict; use Template; +use boardlist; +use b2g; sub main { - my($tmpl, %rh); + my($tmpl, %rh, $bid); if( param('gb') ){ $rh{gb} = 1; @@ -26,11 +28,20 @@ sub main charset(''); print header(); - foreach( </home/web/man/data/*.db> ){ - s/.*\///; - s/\.db//; - push @{$rh{dat}}, {brdname => $_}; + ($bid) = $ENV{PATH_INFO} =~ m|^/(\d+)/$|; + $bid ||= 0; + + if( !$brd{$bid} ){ + print "sorry, this bid $bid not found :("; + return ; + } + + foreach( @{$brd{$bid}} ){ + next if( $_->[0] == -1 && ! -e "$MANDATA/$_->[1].db" ); + $_->[2] =~ s/([\xA1-\xF9].)/$b2g{$1}/eg if( $rh{gb} ); + push @{$rh{dat}}, $_; } + $tmpl = Template->new({INCLUDE_PATH => '.', ABSOLUTE => 0, RELATIVE => 0, |