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

Author: hurstdog [Info]

Description:

This displays the number of users that have viewed a particular story.

Box Code:

# story_hit_box
# NOTE: you might want to add an index to your
# viewed_stories table to make this run quite
# a bit faster, especially if your site is more
# than just a little busy
# mysql> create index sid_idx on viewed_stories (sid);
# ALSO, this doesn't cache yet, it will in the future.
# Shouldn't be a problem for small sites.
my $sid = $S->{CGI}->param('sid');

$sid = $S->{DBH}->quote($sid);

my ($rv,$sth) = $S->db_select({
FROM => 'viewed_stories',
WHAT => 'count(uid) as c',
WHERE => "sid = $sid"
});

my $count = 0;
if( $rv ) {
my $r = $sth->fetchrow_hashref;
$count = $r->{c};
}
$sth->finish();

my $content = qq[
  %%norm_font%%<b>$count</b> Scoop users have viewed this story.%%norm_font_end%%
];

return { content => $content };
Display: Sort:
great (none / 0) (#1)
by cofakabel on Mon Apr 01, 2019 at 06:47:55 AM PST

This code lets the people know how to implement the moral things in the real life.There are many places to visit in and around Goa. First of all you should make plan about which places you want to visit. Beach, heritage and temple all make the Goa more interesting and wonderful to the visitors. I found many things to share about Goa and would like to share this https://www.rushmypapers.me/ so that the interested group of people may have accurate information to get the best one.



hi (none / 0) (#2)
by Nisha Knapp on Sat Sep 11, 2021 at 03:17:21 PM PST

Thanks heaps again for the tips, I always come in your website looking for updates and new post. We as working in Search engine optimization it helps us a lot that your`re giving us so many opportunity in our line. And it gave us knowledge and points at the same time. I hope you leads in the right path. Thanks Again 먹튀 검증 사이트



das (none / 0) (#3)
by alexsmith2569 on Sat Jul 27, 2024 at 04:32:52 PM PST

This time around Stu is getting married to a young Asian beauty named Lauren (Jamie Chung), who's father completely disapproves of him. Explore further You created some decent points there. I looked online with the issue and located most individuals goes in addition to using your site.



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