From bfd6de6d5620942d300a93d3229358c48beaf576 Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 26 May 2003 03:31:28 +0000 Subject: loadTopBlogs, replase <, >, " git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@901 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- blog/blog.pl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/blog/blog.pl b/blog/blog.pl index d4dcc426..135bf63d 100755 --- a/blog/blog.pl +++ b/blog/blog.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: blog.pl,v 1.6 2003/05/26 02:57:15 in2 Exp $ +# $Id: blog.pl,v 1.7 2003/05/26 03:31:28 in2 Exp $ use CGI qw/:standard/; use LocalVars; use DB_File; @@ -108,6 +108,21 @@ sub main } } + # topBlogs + if( $attr{"$fn.loadTopBlogs"} ){ + dodbi(sub { + my($dbh) = @_; + my($sth); + $sth = $dbh->prepare("select k, v from counter order by v desc ". + "limit 0,". $attr{"$fn.loadTopBlogs"}); + $sth->execute(); + while( $_ = $sth->fetchrow_hashref() ){ + push @{$th{topBlogs}}, {brdname => $_->{k}, + counter => $_->{v}}; + } + }); + } + # Counter ---------------------------------------------------------------- if( $attr{"$fn.loadCounter"} ){ my($c); @@ -197,6 +212,9 @@ sub AddArticle($$$) if( $fields =~ /content/i ){ $content = $article{"$s.content"}; if( $config{outputfilter} == 1 ){ + $content =~ s/\/>/gs; + $content =~ s/\"/"/gs; $content =~ s/\n/
\n/gs; } } -- cgit v1.2.3