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

Re: [nir] Same level category

Quote Reply
Re: [nir] Same level category In reply to
This one might work

Code:
sub {

my $cid=shift;

my $csth = $DB->table('Category')->select({ID => $cid});
my $crec = $csth->fetchrow_hashref();

my $db = $DB->table ('Category');
$db->select_options('ORDER BY Name DESC');
my $sth = $db->select ( { FatherID => $crec->{FatherID} });

my @cats;

while (my $cat = $sth->fetchrow_array)
{
unless ($cat->{ID} == $cid)
{
push @cats, $cat;
}
}

return {more_cats_loop=>\@cats};

}


Sacrifice is not about what you lose,
it is about what you gain in the process.
Subject Author Views Date
Thread Same level category nir 7728 Sep 29, 2009, 4:05 AM
Thread Re: [nir] Same level category
Andy 7640 Sep 29, 2009, 5:14 AM
Thread Re: [Andy] Same level category
nir 7619 Sep 29, 2009, 5:55 AM
Thread Re: [nir] Same level category
Andy 7597 Sep 29, 2009, 6:31 AM
Post Re: [Andy] Same level category
nir 7590 Sep 29, 2009, 6:47 AM
Thread Re: [nir] Same level category
EZFrag 7604 Sep 29, 2009, 6:48 AM
Thread Re: [EZFrag] Same level category
nir 7624 Sep 29, 2009, 7:03 AM
Thread Re: [nir] Same level category
Andy 7639 Sep 29, 2009, 7:08 AM
Thread Re: [Andy] Same level category
EZFrag 7601 Sep 29, 2009, 7:17 AM
Thread Re: [EZFrag] Same level category
Andy 7600 Sep 29, 2009, 7:18 AM
Post Re: [Andy] Same level category
nir 7573 Sep 29, 2009, 7:22 AM