Gossamer Forum
Quote Reply
newlinks in tables
Hi everybody

i use the newlink global:

sub {
my $tags = shift;
my ($all_ids,@list,$output);
my $cat_id = $tags->{'ID'};
$all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids, $cat_id;
my $link_db = $DB->table('Links','CatLinks','Category');
$link_db->select_options ("ORDER BY Add_Date DESC LIMIT 8");
my $condition = GT::SQL::Condition->new( 'isValidated','=','Yes','isNew','=','Yes','CategoryID', 'IN', \@$all_ids);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
push @list, $link;
}

my $root = $DB->table('Category')->count({ID => $cat_id, FatherID => 0});
if ((@list) and ($root > 0) ) {
$output = qq~<b>The newest Links in this category and the following subcategories:</b>~;
foreach my $link (@list) {
# Set the category url
my $url = $DB->table('Category')->as_url($link->{'Full_Name'});
# Set the detailed_url
my $detailed_url = "$CFG->{build_detail_url}/$link->{'LinkID'}$CFG->{build_extension}";
$output .= qq~<li><a href="$CFG->{build_root_url}/$url/">$link->{'Name'}</a> | $link->{'Add_Date'}<br><a href="$detailed_url">$link->{'Title'}</a></li>~;
}
}
return $output;

}


--------------------

This global show me max. 8 new links

i want to display the result in a table with 2 rows

each field one link

please help

Marina