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

New links by main category

Quote Reply
New links by main category
Hi, this is my current new link global to get the number of new links for a category and all categories under it. Its not working, not sure why, and also how do i make it so it only displays on main category pages?

sub {
my $catid = shift;
my ($output,$link);
my $all_ids = $DB->table('Category')->children($catid);
push @$all_ids, $catid;

my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Date DESC,Timestmp DESC,Title Limit 10');
my $cond = GT::SQL::Condition->new('CategoryID', 'IN', $all_ids,'isValidated', '=', 'Yes');
my $sth = $table->select($cond);

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

return $output;
}
Subject Author Views Date
Thread New links by main category kzap 2563 Oct 3, 2003, 11:22 PM
Post Re: [kzap] New links by main category
Andy 2478 Oct 4, 2003, 4:46 AM
Thread Re: [kzap] New links by main category
afinlr 2502 Oct 4, 2003, 7:38 AM
Thread Re: [afinlr] New links by main category
kzap 2470 Oct 4, 2003, 11:21 AM
Thread Re: [kzap] New links by main category
afinlr 2465 Oct 4, 2003, 11:24 AM
Thread Re: [afinlr] New links by main category
kzap 2452 Oct 4, 2003, 11:58 PM
Post Re: [kzap] New links by main category
mick31 2333 Sep 20, 2004, 9:52 AM