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

Author: Scoop Developers

Description:

This is the box that displays the statistics of who voted what for each story.

Box Code:

my $sid = $ARGS[0];
$sid = $S->{CGI}->param('sid') unless $sid;
return unless $sid;

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

my ($rv, $t_sth) = $S->db_select({
WHAT => 'displaystatus',
FROM => 'stories',
WHERE => qq{sid = $q_sid}});

my $disp = $t_sth->fetchrow();

return unless ($disp == '-2');

my ($stat, $trash) = $S->_mod_or_show($sid);
return '' unless ($stat eq 'show');

my ($totalvotes, $score) = $S->_get_total_votes($sid);
my $sth = $S->_get_story_mods($sid);

my $head = $S->{UI}->{BLOCKS}->{moderate_head};

$head =~ s/%%votes%%/$totalvotes/g;
$head =~ s/%%score%%/$score/g;

my ($this_row, $user);

my $for = qq{<FORM NAME="mod_stat_show" ACTION="%%rootdir%%/" METHOD="get">
<INPUT TYPE="hidden" NAME="op" VALUE="user">
<INPUT TYPE="hidden" NAME="tool" VALUE="info">};
my $against = qq{<FORM NAME="mod_stat_show" ACTION="%%rootdir%%/" METHOD="get">
<INPUT TYPE="hidden" NAME="op" VALUE="user">
<INPUT TYPE="hidden" NAME="tool" VALUE="info">};
my $neutral = qq{<FORM NAME="mod_stat_show" ACTION="%%rootdir%%/" METHOD="get">
<INPUT TYPE="hidden" NAME="op" VALUE="user">
<INPUT TYPE="hidden" NAME="tool" VALUE="info">};
#'
my $f = 0;
my $a = 0;
my $n = 0;

$for .= qq{<small>
<SELECT NAME="uid" SIZE=1>
<OPTION VALUE="">Voted for: (%%for%%)};
$against .= qq{<small>
<SELECT NAME="uid" SIZE=1>
<OPTION VALUE="">Voted against: (%%against%%)};
$neutral .= qq{<small>
<SELECT NAME="uid" SIZE=1>
<OPTION VALUE="">Didn't care: (%%neutral%%)};

while (my $mod_rec = $sth->fetchrow_hashref) {
my $nick = $S->get_nick($mod_rec->{uid});
$nick =~ s/^(.{0,20})/$1/;
my $link = qq{
<OPTION VALUE="$mod_rec->{uid}">$nick};
if ($mod_rec->{vote} == 1) {
$for .= qq|
$link|;
$f++;
} elsif ($mod_rec->{vote} == 0) {
$neutral .= qq|
$link|;
$n++;
} elsif ($mod_rec->{vote} == -1) {
$against .= qq|
$link|;
$a++;
}
}
$sth->finish;

$for .= qq{</SELECT> <INPUT TYPE="submit" NAME="get" VALUE="Get User Info"></small></FORM>};
$against .= qq{</SELECT> <INPUT TYPE="submit" NAME="get" VALUE="Get User Info"></small></FORM>};
$neutral .= qq{</SELECT> <INPUT TYPE="submit" NAME="get" VALUE="Get User Info"></small></FORM>};

$for =~ s/%%for%%/$f/;
$against =~ s/%%against%%/$a/;
$neutral =~ s/%%neutral%%/$n/;

my $content = $head.'%%smallfont%%'.$for.$against.$neutral.'%%smallfont_end%%';

return { content => $content };
Display: Sort:
Micro (none / 0) (#1)
by MichaelHoward on Tue Apr 10, 2018 at 10:04:39 AM PST

Excellent! only Microsoft can do this as their every software is just suitable and user-friendly like this one too. Thanks to the developer of Microsoft Azure for offering the essay writing service uk reviews amazing structures.



gcu student portal login (none / 0) (#2)
by hinofevav on Wed Apr 18, 2018 at 12:48:35 PM PST

New users or new students can found gcu student portal login difficult and for such people, we have provided the complete login procedure in detail. Check the further information in the below section.



great (none / 0) (#3)
by heenacruzl on Sat Dec 14, 2019 at 01:43:49 AM PST

I think I have the same opinion as you. This is probably a coincidence. return man 3



GOOD (none / 0) (#4)
by mahamkhan on Mon Sep 28, 2020 at 09:25:27 AM PST

On the off chance that you need to change over your PDF archives to different configurations or the other way around, visit altopngtopdf.com presently. You'll discover various arrangement changing over there and it'll assist you with your work.



GOOD (none / 0) (#5)
by mahamkhan on Thu Oct 08, 2020 at 02:58:42 AM PST

Many students have applied previous year for new admissions and Renewal of Student Scholarship in Epass only. This year to eradicate improper use jnanabhumi scholarship and ... Pre-matric scholarship · Applicant must belong to SC/ ST/ BC/ Disabled community · Annual income should not exceed Rs. 2 Lakh per annum.



GOOD (none / 0) (#6)
by mahamkhan on Wed Oct 21, 2020 at 05:53:10 AM PST

HP Board 12th Model Papers 2021 - Students should solve the subject-wise HPBOSE Class 12th sample papers to understand the exam pattern and difficulty level in a better way. Himachal Pradesh Board (HPBOSE) has uploaded the HP Board 12th model papers on its official HP 12th Blueprint 2021website, hpbose.org. HP Board Class 12th sample papers are created on the basis of final question papers. Hence, students appearing for HP Board 12th exams 2021 should download and solve the HP Board 12th model papers to prepare better and in the right direction. Also, solving the HP Board 12th model papers 2021 helps students to learn the time management during the final exams to be conducted in March 2021.



jimm (none / 0) (#8)
by jackclark on Tue Feb 02, 2021 at 09:10:22 AM PST

The web site is lovingly serviced and saved as much as date. So it should be, thanks for sharing this with us. https://aestheticfillers.com/product/mesoline-refresh-10x5ml-vials/



jimm (none / 0) (#9)
by jackclark on Sat Feb 06, 2021 at 07:45:55 AM PST

https://kushjacanna.com/index.php/product-tag/fake-plug-and-play-pods/ Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have.



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