summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-07-11 18:11:24 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-07-11 18:11:24 +0800
commitf738a191377ce86fb030d5049f357e269f22e8f4 (patch)
tree83f6c67132fc8f68da02fde54aa6ec4659436189
parentcab45be10660cb32f5658de2c8d136237ab187f1 (diff)
downloadpttbbs-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
-rw-r--r--staticweb/index.html12
-rwxr-xr-xstaticweb/index.pl23
2 files changed, 26 insertions, 9 deletions
diff --git a/staticweb/index.html b/staticweb/index.html
index 3a62ed51..45372764 100644
--- a/staticweb/index.html
+++ b/staticweb/index.html
@@ -5,11 +5,17 @@
</td></tr>
<tr><td>
-[% IF gb %]批踢踢实业坊之精华区[% ELSE %]у金金龟穨ぇ弘地跋[% END %](experimental)<br />
-[% IF gb %]目前提供下列精华区资料[% ELSE %]ヘ玡矗ㄑ弘地跋戈[% END %]:<br />
+<a href="http://man.ptt.cc[% IF gb %]/?gb=1[% END %]">[% IF gb %]批踢踢实业坊之精华区[% ELSE %]у金金龟穨ぇ弘地跋[% END %](experimental)</a><br />
<br />
[% FOREACH x=dat %]
-<a href="/man.pl/[% x.brdname %]/[% IF gb %]?gb=1[% END %]">[% x.brdname %]</a><br />
+[% IF x.0 == -1 %]
+ <a href="/man.pl/[% x.1 %]/[% IF gb %]?gb=1[% END %]">
+ <img src="http://images.ptt.cc/f.gif" style="border: 0;">
+[% ELSE %]
+ <a href="/index.pl/[% x.0 %]/[% IF gb %]?gb=1[% END %]">
+ <img src="http://images.ptt.cc/folder.gif" style="border: 0;">
+[% END %]
+[% x.2 %]</a><br />
[% END %]
</td></tr>
<tr><td>
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,