Blog
Developers
Careers
Support
Contact
Gossamer Threads
Solutions
Results
About
Mailing Lists
Resource Centre
Forum
Tools
Home
Who's Online
Tags
Favourites
Login
Forum Search
(
Advanced Search
)
This forum
This category
All forums
for
Home
:
Products
:
Gossamer Links
:
Development, Plugins and Globals
:
Count Votes < 10
Previous Thread
Next Thread
Print Thread
View Threaded
Oct 10, 2003, 1:59 AM
mkoenig
Novice
(47 posts)
Oct 10, 2003, 1:59 AM
Post #1 of 5
Views: 2430
Shortcut
Count Votes < 10
Hi boys
i am looking for a Global to count the links where Votes > 10 in every
category.
Marina
Oct 10, 2003, 2:14 AM
Andy
Veteran
/ Moderator
(18441 posts)
Oct 10, 2003, 2:14 AM
Post #2 of 5
Views: 2358
Shortcut
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
Want to give me something back for my help? Please see my
Amazon Wish List
GLinks ULTRA Package
|
GLinks ULTRA Package PRO
Links SQL Plugins
|
Website Design and SEO
|
UltraNerds
|
ULTRAGLobals Plugin
|
Pre-Made Template Sets
|
FREE GLinks Plugins!
Oct 10, 2003, 3:13 AM
mkoenig
Novice
(47 posts)
Oct 10, 2003, 3:13 AM
Post #3 of 5
Views: 2363
Shortcut
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
Oct 10, 2003, 3:16 AM
Andy
Veteran
/ Moderator
(18441 posts)
Oct 10, 2003, 3:16 AM
Post #4 of 5
Views: 2352
Shortcut
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
Want to give me something back for my help? Please see my
Amazon Wish List
GLinks ULTRA Package
|
GLinks ULTRA Package PRO
Links SQL Plugins
|
Website Design and SEO
|
UltraNerds
|
ULTRAGLobals Plugin
|
Pre-Made Template Sets
|
FREE GLinks Plugins!
Oct 10, 2003, 3:34 AM
mkoenig
Novice
(47 posts)
Oct 10, 2003, 3:34 AM
Post #5 of 5
Views: 2362
Shortcut
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
Previous Thread
Next Thread
Print Thread
View Threaded