Description:
This is the new section stories box on kuro5hin as of 2002-02-02. It shows the last 6 section stories, and the new diaries. Import this from the admin box editor.
Box Code:
my $content = qq{
<b><a href="|rootdir|/special/browse/">Browse all the newest headlines by section >></a></b><p>};
my ($rv, $sth) = $S->db_select({
WHAT => 'sid, title, aid, section, tid',
FROM => 'stories',
WHERE => "displaystatus = 1 AND section != 'Diary'",
ORDER_BY => 'time desc',
LIMIT => '7'});
my $stories = $sth->fetchall_arrayref();
$sth->finish();
foreach my $story (@{$stories}) {
my $urlnick = $S->urlify($story->[2]);
$story->[2] =~ s/(\S{20})/$1- /g;
$story->[1] =~ s/(\S{20})/$1 /g;
$content .= qq{
<b><a href="|rootdir|/story/$story->[0]">$story->[1]</a></b><br>
<font size="-2">by <a href="|rootdir|/user/$urlnick">$story->[2]</a><br>
<a href="|rootdir|/section/$story->[3]">$S->{SECTION_DATA}->{$story->[3]}->{title}</a>::<a href="|rootdir|/search/?topic=$story->[4]">$S->{TOPIC_DATA}->{$story->[4]}->{alttext}</a></font>
<p>};
}
return {content => $content};
|