From 174929f085c6a82ce6ac03a0e7f231f09e7e1354 Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 26 May 2003 02:57:15 +0000 Subject: apply outputfilter at short git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@900 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- blog/blog.pl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'blog/blog.pl') diff --git a/blog/blog.pl b/blog/blog.pl index 12d67328..d4dcc426 100755 --- a/blog/blog.pl +++ b/blog/blog.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: blog.pl,v 1.5 2003/05/26 02:30:04 in2 Exp $ +# $Id: blog.pl,v 1.6 2003/05/26 02:57:15 in2 Exp $ use CGI qw/:standard/; use LocalVars; use DB_File; @@ -49,7 +49,7 @@ sub main if( $attr{"$fn.loadBlog"} =~ /article/i ){ AddArticle('blog', $attr{"$fn.loadBlogFields"}, packdate($y, $m, $d)); } - elsif( $attr{"$fn.loadBlog"} =~ /month/i ){ + elsif( $attr{"$fn.loadBlog"} =~ /monthly/i ){ my($s, $y1, $m1, $d1); for( ($y1, $m1, $d1) = ($y, $m, 32) ; $d1 > 0 ; --$d1 ){ AddArticle('blog', $attr{"$fn.loadBlogFields"}, @@ -193,13 +193,19 @@ sub main sub AddArticle($$$) { my($cl, $fields, $s) = @_; - my $content = ''; + my($content, $short) = (); if( $fields =~ /content/i ){ $content = $article{"$s.content"}; if( $config{outputfilter} == 1 ){ $content =~ s/\n/
\n/gs; } } + if( $fields =~ /short/i ){ + $short = $article{"$s.short"}; + if( $config{outputfilter} == 1 ){ + $short =~ s/\n/
\n/gs; + } + } my($y, $m, $d) = unpackdate($s); push @{$th{$cl}}, {year => $y, @@ -213,8 +219,7 @@ sub AddArticle($$$) content=> $content, author => (($fields !~ /author/i) ? '' : $article{"$s.author"}), - short => (($fields !~ /short/i) ? '' : - $article{"$s.short"}), + short => $short, } if( $article{"$s.title"} ); } -- cgit v1.2.3