summaryrefslogtreecommitdiffstats
path: root/blog
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-26 11:31:28 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-26 11:31:28 +0800
commitbfd6de6d5620942d300a93d3229358c48beaf576 (patch)
tree649599e44a1a8b5e7ae1f157b6b219868b36f92b /blog
parent174929f085c6a82ce6ac03a0e7f231f09e7e1354 (diff)
downloadpttbbs-bfd6de6d5620942d300a93d3229358c48beaf576.tar
pttbbs-bfd6de6d5620942d300a93d3229358c48beaf576.tar.gz
pttbbs-bfd6de6d5620942d300a93d3229358c48beaf576.tar.bz2
pttbbs-bfd6de6d5620942d300a93d3229358c48beaf576.tar.lz
pttbbs-bfd6de6d5620942d300a93d3229358c48beaf576.tar.xz
pttbbs-bfd6de6d5620942d300a93d3229358c48beaf576.tar.zst
pttbbs-bfd6de6d5620942d300a93d3229358c48beaf576.zip
loadTopBlogs, replase <, >, "
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@901 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'blog')
-rwxr-xr-xblog/blog.pl20
1 files changed, 19 insertions, 1 deletions
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/\</&lt;/gs;
+ $content =~ s/\>/&gt;/gs;
+ $content =~ s/\"/&quot;/gs;
$content =~ s/\n/<br \/>\n/gs;
}
}