Scoop -- the swiss army chainsaw of content management
Front Page Everything News Code Help! Wishlist Project Scoop Sites Dev Notes Latest CVS changes Development Activities
Scoop Box Exchange - Show Box: recent_comments 1.00

Author: theantix [Info]

Description:

Simply returns a list of the recent comments, useful for sites with low traffic. Based on recent_diaries by Steve Linberg.

Box Code:

my $content;
my $num_comments = 10;
my $trim_length = 45;

# Get the last $num_comments comments
my ($rv, $sth) = $S->db_select({
WHAT => 'U.nickname, C.subject, C.cid, C.sid',
FROM => 'comments C, users U',
WHERE => 'U.uid=C.uid',
ORDER_BY => 'date DESC',
LIMIT => $num_comments});

my $table = $sth->fetchall_arrayref;

my ($nickname, $subject, $cid, $sid);
for (@$table) {
($nickname, $subject, $cid, $sid) = @$_;

# trim the subject line if it is too long
if (length $subject > $trim_length) {
$title = substr($subject, 0, $trim_length);
$title =~ s/\s+\S+$//;
$title .= '...';
}

$content .= qq{
|dot| <A HREF="|rootdir|/comments/$sid/$cid#$cid">$subject</a> ($nickname)<BR>
};
}

# And return the content, like normal.
return $content;
Display: Sort:
Write (none / 0) (#1)
by Ellis374 on Tue Jul 30, 2019 at 09:44:52 AM PST

我正在研究我的新研究论文A 292;其中涵盖了重要的事情。该 英语论文代写 帮助我解决语法错误。



good (none / 0) (#2)
by AnaMattice on Fri Feb 21, 2020 at 02:17:59 AM PST

नवोदय विद्यालय समिति द्वारा क्लास 6 एंट्रेंस एग्जाम का परीक्षा परिणाम नवोदय विद्यालय कक्षा 6वीं परिणाम 2020 घोषित कर दिया गया है! आप निचे दिए गये लिंक पर क्लिक कर के अपना परिणाम देख सकते है! यदि आप अपना परिणाम नहीं देख पा रहे है तो नीचे दिए गये कमेंट बॉक्स में रोल नंबर डालकर भी पूछ सकते है|



good (none / 0) (#3)
by AnaMattice on Sat Mar 14, 2020 at 03:42:33 AM PST

I am satisfied that I can peruse your article today. This article has got all the information that I have to finish my es.altoconvertpdftoword.com task, and I'll do that at the earliest opportunity. Wish me karma, however.



Menu
create account
faq
search
report bugs
Scoop Administrators Guide
Scoop Box Exchange

Scoop Site Scroller: Get one yourself!
Smokedot
It's 4:19... do you know where your bong is?

Login
Make a new account
Username:
Password:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest 1999 The Management

create account | faq | search