Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [vacationrentals] Category Drop Down Field

Quote Reply
Re: [vacationrentals] Category Drop Down Field In reply to
Wrong forum Wink (I've moved it for you)

A quick answer, would be something like this;

Code:
my $cond = GT::SQL::Condition->new('Full_Name','LIKE','CategoryName%');
my $sth = $db->select( ['ID','Full_Name','Number_of_Links'], $cond )
|| return $GT::SQL::error;

...which should then grab the category in question, and its sub-categories.

You would also modify it a little bit more... by adding;

Code:
my $category_name = $_[1];

... right below;

Code:
my $show_count = $_[0];

Then, you will need to use;

Code:
my $cond = GT::SQL::Condition->new('Full_Name','LIKE',"$category_name%");
my $sth = $db->select( ['ID','Full_Name','Number_of_Links'], $cond )
|| return $GT::SQL::error;


.. and then call with;

Code:
<%global('1','Category Name')%>

Not tested.. but should work / get you on the right tracks :)

Hope that helps.

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!
Subject Author Views Date
Thread Category Drop Down Field vacationrentals 4055 Sep 28, 2004, 3:44 AM
Thread Re: [vacationrentals] Category Drop Down Field
Andy 3910 Sep 28, 2004, 7:48 AM
Post Re: [Andy] Category Drop Down Field
vacationrentals 3915 Sep 28, 2004, 8:31 AM