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

Author: coryking [Info]

Description:

This is the companion to rss_export. I created this box to encourage people using feeds to stick around and browse the site rather then leech. I figure if they see the story the RSS feed gives them, plus two more stories, they are more likely to check out the rest of the site. If you are using (and you probably are) the extended body, you'll probably want to modify this code. I'd imagine you'd show the entire body, it's comments and below that you'd show the summaries of two more stories. Since I suck, there is probably some photographica specific stylesheet stuff you'll want to pull out as well (like that div crap down there...).

Box Code:

my $content;

my $sid=$S->{CGI}->param('sid');
my $ssid=$S->{DBH}->quote($sid);
return "" unless $sid;

my ($rv, $sth) = $S->db_select({
WHAT=>'*',
FROM=>'stories',
WHERE=>"sid=$ssid",
DEBUG=>0
});

my $story=$sth->fetchrow_hashref();
my $aid = $S->{DBH}->quote($$story{aid});


$content = $S->displaystory($sid, $story);

# clearly you'll want to change this...
$content .= qq(<div class="box_head">Other Photographica Members:</div>);

$sth->finish;
$sth=undef;

($rv, $sth) = $S->db_select({
WHAT=>'*',
FROM=>'stories',
WHERE=>"aid != $aid",
ORDER_BY=>'time DESC',
LIMIT=>'2',
DEBUG=>0
});

while(my $extra_story = $sth->fetchrow_hashref())
{
$content .= $S->story_summary($extra_story);

}

$content .= "<a href='/'>View the rest...</a>";

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

Scoop Site Scroller: Get one yourself!
Scoop::Ads
Almost there...

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