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

Name and link to category

Quote Reply
Name and link to category
Hi everybody

I am using this global;

sub {
my (@output,$sth,$hash,$cond);
my $catid = $_[0];

my $limit = $_[1] || 4;
my $search_db = $DB->table('Links','CatLinks');
$search_db->select_options ("ORDER BY rand()", "LIMIT $limit");
my $all_ids = $DB->table('Category')->children($catid);
push @$all_ids, $catid;
$cond = GT::SQL::Condition->new('isValidated','=','Yes', 'isNew', '=', 'Yes', 'CategoryID', 'IN', $all_ids);
$sth = $search_db->select ($cond);
while ($hash = $sth->fetchrow_hashref) { push @output, $hash;}
return \@output;
}

This global give me a random link of the subcats
how can i get the Name and the path of the category for this link?

MarinaSly
Quote Reply
Re: [mkoenig] Name and link to category In reply to
Please help MarinaSly