summaryrefslogtreecommitdiffstats
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
commit1cb1e2a3524df12b34ef7641b353202dd5619567 (patch)
treea60b4de14c4c1de3245d409e1d79db4f8ab9a818
parentace70671188e651d66c1aa1461cad13789868192 (diff)
downloadpttbbs-1cb1e2a3524df12b34ef7641b353202dd5619567.tar
pttbbs-1cb1e2a3524df12b34ef7641b353202dd5619567.tar.gz
pttbbs-1cb1e2a3524df12b34ef7641b353202dd5619567.tar.bz2
pttbbs-1cb1e2a3524df12b34ef7641b353202dd5619567.tar.lz
pttbbs-1cb1e2a3524df12b34ef7641b353202dd5619567.tar.xz
pttbbs-1cb1e2a3524df12b34ef7641b353202dd5619567.tar.zst
pttbbs-1cb1e2a3524df12b34ef7641b353202dd5619567.zip
loadTopBlogs, replase <, >, "
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@901 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rwxr-xr-xpttbbs/blog/blog.pl20
1 files changed, 19 insertions, 1 deletions
diff --git a/pttbbs/blog/blog.pl b/pttbbs/blog/blog.pl
index d4dcc426..135bf63d 100755
--- a/pttbbs/blog/blog.pl
+++ b/pttbbs/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;
}
}