From 0cdbb36aff2faa2e6392814cfa2c4a5b6ae1c23f Mon Sep 17 00:00:00 2001 From: in2 Date: Fri, 11 Jul 2003 10:11:24 +0000 Subject: use boardlist git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@1048 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/staticweb/index.html | 12 +++++++++--- pttbbs/staticweb/index.pl | 23 +++++++++++++++++------ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/pttbbs/staticweb/index.html b/pttbbs/staticweb/index.html index 3a62ed51..45372764 100644 --- a/pttbbs/staticweb/index.html +++ b/pttbbs/staticweb/index.html @@ -5,11 +5,17 @@ -[% IF gb %]批踢踢实业坊之精华区[% ELSE %]у金金龟穨ぇ弘地跋[% END %](experimental)
-[% IF gb %]目前提供下列精华区资料[% ELSE %]ヘ玡矗ㄑ弘地跋戈[% END %]:
+[% IF gb %]批踢踢实业坊之精华区[% ELSE %]у金金龟穨ぇ弘地跋[% END %](experimental)

[% FOREACH x=dat %] -[% x.brdname %]
+[% IF x.0 == -1 %] + + +[% ELSE %] + + +[% END %] +[% x.2 %]
[% END %] diff --git a/pttbbs/staticweb/index.pl b/pttbbs/staticweb/index.pl index 71ad6117..6280ebd5 100755 --- a/pttbbs/staticweb/index.pl +++ b/pttbbs/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( ){ - 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, -- cgit v1.2.3