Hi.
Using following global for listing latest_n_by_cat (category downwards) called on category.html (courtsey afinlr)
sub {
my $tags=shift;
my $back;
my $cat_id = $tags->{ID};
my $all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids,$cat_id;
my $link_db = $DB->table('Links','CatLinks');
$link_db->select_options('ORDER BY Add_Date DESC','LIMIT 25');
my $condition = GT::SQL::Condition->new( 'isValidated','=','Yes','CategoryID', 'IN', $all_ids);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('newlink_cat',$link);
}
return $back;
}
Problem:
A Link may be listed under n sub-ctegories of a category...
This causes the lsiting to appear "n" number of times.
How can "Distinct" be enforced ?
TIA
Thanks
HyTC
==================================
Mail Me If Contacting Privately Is That Necessary.
==================================
Using following global for listing latest_n_by_cat (category downwards) called on category.html (courtsey afinlr)
sub {
my $tags=shift;
my $back;
my $cat_id = $tags->{ID};
my $all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids,$cat_id;
my $link_db = $DB->table('Links','CatLinks');
$link_db->select_options('ORDER BY Add_Date DESC','LIMIT 25');
my $condition = GT::SQL::Condition->new( 'isValidated','=','Yes','CategoryID', 'IN', $all_ids);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('newlink_cat',$link);
}
return $back;
}
Problem:
A Link may be listed under n sub-ctegories of a category...
This causes the lsiting to appear "n" number of times.
How can "Distinct" be enforced ?
TIA
Thanks
HyTC
==================================
Mail Me If Contacting Privately Is That Necessary.
==================================