Gossamer Forum
Quote Reply
Count Votes < 10
Hi boysBlush

i am looking for a Global to count the links where Votes > 10 in every Shockedcategory.

Marina
Quote Reply
Re: [mkoenig] Count Votes < 10 In reply to
Something like this maybe?

Code:
sub {

my $ID = $_[0];

my $sth = $DB->table('Links')->select( GT::SQL::Condition->new('Votes','>=','10') );

my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML->display('links',$hit);
}

return $back;

}

Call it with;

<%global_Name($ID)%>

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Count Votes < 10 In reply to
Hi Andy

i get an error in sitehtml

i want only the count of the votes > 10

marina
Quote Reply
Re: [mkoenig] Count Votes < 10 In reply to
Oh, in that case, try something like;

Code:
sub {

my $ID = $_[0];
my $count = $DB->table('Links')->count( GT::SQL::Condition->new('Votes','>=','10') );
return $count;

}

Call with <%global_name($ID)%>

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Count Votes < 10 In reply to
Hi Andy

This global works fine

but i want to display the count of links in the category in the category page

ex.

cat 1 -->10

cat2 -->2

cat3 -->20

Marina