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: older_list_box 1.00

Author: Scoop Developers

Description:

This displays the list of older stories on the site. Depending on the page its on, it will show all older stories, just older stories from the section you're viewing, or just older stories from the front page.

Box Code:

my $section = $S->{CGI}->param('section') || 'front';
my $stories = [];

if ($section eq 'front') {
$stories = $S->getstories({-type => 'titlesonly', -displaystatus => '0'});
} elsif ($section eq '__all__') {
$stories = $S->getstories({-type => 'titlesonly', -section => '!Diary'});
} else {
$stories = $S->getstories({-type => 'titlesonly', -section => $section});
}
my $box_content;

my $date = undef;
foreach my $story (@{$stories}) {
if (($story->{ftime} ne $date) || !$date) {
$date = $story->{ftime};
$box_content .= qq|
<P>
<B>$story->{ftime}</B>|;
}
$box_content .= qq|
<BR>%%dot%% <A CLASS="light" HREF="%%rootdir%%/story/$story->{sid}">$story->{title}</A> ($story->{commentcount} comments)|;

if ($S->have_perm('story_list')) {
$box_content .= qq| [<A CLASS="light" HREF="%%rootdir%%/admin/story/$story->{sid}">edit</A>]|;
}
}

my $offset = $S->{UI}->{VARS}->{maxstories} + $#{$stories};
my $search_url = qq{%%rootdir%%/?op=search;offset=$offset};
$search_url .= ';section='.$section if ($section ne 'front');

$box_content .= qq|
<P>
<A CLASS="light" HREF="$search_url">Older Stories...</A>
</P>|;
my $return = {content => "%%smallfont%%$box_content%%smallfont_end%%"};
if ($section ne 'front' && $section ne '__all__') {
$return->{title} = $S->{SECTION_DATA}->{$section}->{title};
} elsif ($section eq '__all__') {
$return->{title} = 'All Stories';
}

return $return;
Display: Sort:
Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Scoop Site Scroller: Get one yourself!
Kuro5hin.org
Cooler than Adequacy.org

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