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

Re: [klauslovgreen] category Links

Quote Reply
Re: [klauslovgreen] category Links In reply to
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;
}
Subject Author Views Date
Thread category Links klauslovgreen 4590 Apr 26, 2003, 10:05 AM
Thread Re: [klauslovgreen] category Links
afinlr 4460 Apr 27, 2003, 10:12 AM
Thread Re: [afinlr] category Links
klauslovgreen 4439 Apr 27, 2003, 10:36 PM
Thread Re: [klauslovgreen] category Links
afinlr 4440 Apr 28, 2003, 6:04 AM
Thread Re: [afinlr] category Links
klauslovgreen 4429 Apr 28, 2003, 8:34 AM
Thread Re: [klauslovgreen] category Links
afinlr 4410 Apr 28, 2003, 10:21 AM
Post Re: [afinlr] category Links
klauslovgreen 4423 Apr 28, 2003, 10:25 AM
Thread Re: [afinlr] category Links
klauslovgreen 4416 Apr 28, 2003, 10:29 AM
Thread Re: [klauslovgreen] category Links
afinlr 4416 Apr 28, 2003, 10:53 AM
Thread Re: [afinlr] category Links
klauslovgreen 4414 Apr 28, 2003, 10:55 AM
Thread Re: [klauslovgreen] category Links
afinlr 4412 Apr 28, 2003, 10:59 AM
Post Re: [afinlr] category Links
klauslovgreen 4393 Apr 28, 2003, 11:04 AM