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

Re: [kzap] Prevent additions to main categories

Quote Reply
Re: [kzap] Prevent additions to main categories In reply to
Hi. Try this. It should list cateogires where the father ID is greater than 0 (i.e not root categories)....

Code:
sub {

my $table = $DB->table('Category');
my $return_cats;

$table->select_options ('ORDER BY Name ASC');
my $cond = GT::SQL::Condition->new('FatherID','>','0');
my $sth = $table->select( $cond );

while (my $hit = $sth->fetchrow_hashref) {
$return_cats .= "<option value=\"" . $hit->{ID} . "\">" . $hit->{Full_Name} . "</option>";
}

return $return_cats;
}

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 Prevent additions to main categories kzap 2901 Sep 14, 2003, 8:33 PM
Post Re: [kzap] Prevent additions to main categories
goman 2830 Sep 14, 2003, 9:28 PM
Thread Re: [kzap] Prevent additions to main categories
kzap 2812 Sep 14, 2003, 10:21 PM
Thread Re: [kzap] Prevent additions to main categories
Andy 2809 Sep 15, 2003, 1:17 AM
Thread Re: [Andy] Prevent additions to main categories
kzap 2792 Sep 15, 2003, 12:20 PM
Thread Re: [kzap] Prevent additions to main categories
Andy 2796 Sep 15, 2003, 12:23 PM
Post Re: [Andy] Prevent additions to main categories
kzap 2792 Sep 15, 2003, 12:32 PM