Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [blakeb] New & Updated By Category

Quote Reply
Re: [blakeb] New & Updated By Category In reply to
You need an or condition to show links which are either new or updated. Something like this

sub {
my $tags = shift;
my $cat = $tags->{'ID'};
my $all_ids = $DB->table('Category')->children($cat);
push @$all_ids, $cat;
my $output;
my $sth;
my $link;
use GT::SQL::Condition;

my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 5');
my $cond = GT::SQL::Condition->new( ['isNew', '=', 'Yes'], ['isValidated', '=', 'Yes']); $cond->bool('or');
$sth = $search_db->select (['Links.ID', 'Links.Description', 'Links.Title', 'Links.Add_Date', 'Category.Full_Name', 'Category.Name'], GT::SQL::Condition->new(['CategoryID', 'IN', \@$all_ids], $cond));

while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link1', $link);
}

return $output;

}
Subject Author Views Date
Thread New & Updated By Category blakeb 2063 Apr 9, 2003, 6:34 PM
Thread Re: [blakeb] New & Updated By Category
klauslovgreen 2001 Apr 9, 2003, 8:29 PM
Thread Re: [klauslovgreen] New & Updated By Category
blakeb 2001 Apr 9, 2003, 8:47 PM
Post Re: [blakeb] New & Updated By Category
klauslovgreen 1997 Apr 9, 2003, 8:50 PM
Thread Re: [blakeb] New & Updated By Category
afinlr 1984 Apr 10, 2003, 6:00 AM
Thread Re: [afinlr] New & Updated By Category
klauslovgreen 1974 Apr 10, 2003, 7:13 AM
Thread Re: [klauslovgreen] New & Updated By Category
afinlr 1970 Apr 10, 2003, 7:29 AM
Post Re: [afinlr] New & Updated By Category
blakeb 1959 Apr 15, 2003, 9:57 PM