Right, the first thing I've spotted is that I obviously didn't explain the condition replacement clearly enough - you have a strange use statement (which is also missing a semicolon) for the condition instead of replacing the actual condition in the select statement. Does this work?
sub {
my $cat = shift;
my $output;
my $sth;
my $link;
my $all_ids = $DB->table('Category')->children($cat);
push @$all_ids, $cat;
use GT::SQL::Condition;
my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Time DESC Limit 2');
$sth = $search_db->select (['Links.ID', 'Links.Description', 'Links.Title', 'Links.Add_Date', 'Links.isNew', 'Links.Image', 'Links.Story', 'Links.Add_Time', 'Links.Country', 'Category.Full_Name', 'Category.Name'], GT::SQL::Condition->new(['CategoryID', 'IN', $all_ids], ['isValidated', '=', 'Yes']) );
my $output = qq~<br><hr>~;
while ($link = $sth->fetchrow_hashref)
{
# Set the category url
my $category_url = $CFG->{build_root_url}."/".$link->{'Full_Name'}."/";
# Set the detailed_url
my $detailed_url = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
sub {
my $cat = shift;
my $output;
my $sth;
my $link;
my $all_ids = $DB->table('Category')->children($cat);
push @$all_ids, $cat;
use GT::SQL::Condition;
my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Time DESC Limit 2');
$sth = $search_db->select (['Links.ID', 'Links.Description', 'Links.Title', 'Links.Add_Date', 'Links.isNew', 'Links.Image', 'Links.Story', 'Links.Add_Time', 'Links.Country', 'Category.Full_Name', 'Category.Name'], GT::SQL::Condition->new(['CategoryID', 'IN', $all_ids], ['isValidated', '=', 'Yes']) );
my $output = qq~<br><hr>~;
while ($link = $sth->fetchrow_hashref)
{
# Set the category url
my $category_url = $CFG->{build_root_url}."/".$link->{'Full_Name'}."/";
# Set the detailed_url
my $detailed_url = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}