Gossamer Forum
Quote Reply
New link Loop
I use this Global to show new link of category
sub {
my $cat = $_[0];
my ($output,$sth,$link);
my $all_ids = $DB->table('Category')->children($cat);
push @$all_ids, $cat;
my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 10');
$sth = $search_db->select (['Links.*'], GT::SQL::Condition->new(['CategoryID', 'IN', $all_ids], ['isValidated', '=', 'Yes', 'isNew', '=', 'Yes']) );
my $seen;
my $output;
while ($link = $sth->fetchrow_hashref)
{
if ($seen->{$link->{$id}}) { next }
my $category_url = $CFG->{build_root_url}."/".$link->{'Full_Name'}."/";
my $detailed_url = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display('sortlink', $link);
$seen->{$link->{$id}} = 1;
}
return $output;
}

Can I make the output send in a Loop - something like
<%loop new_link%>
-----------------
<%endloop%>
Subject Author Views Date
Thread New link Loop nir 10560 Dec 12, 2007, 7:19 AM
Thread Re: [nir] New link Loop
Andy 10071 Dec 13, 2007, 12:21 AM
Thread Re: [Andy] New link Loop
Wychwood 9999 Dec 13, 2007, 2:35 AM
Post Re: [Wychwood] New link Loop
Andy 10046 Dec 13, 2007, 2:49 AM
Thread Re: [Andy] New link Loop
nir 10033 Dec 13, 2007, 4:00 AM
Thread Re: [nir] New link Loop
Andy 10044 Dec 13, 2007, 4:05 AM
Thread Re: [Andy] New link Loop
nir 9979 Dec 20, 2007, 4:30 AM
Thread Re: [nir] New link Loop
Andy 10012 Dec 21, 2007, 2:30 AM
Thread Re: [Andy] New link Loop
nir 9955 Dec 23, 2007, 12:42 AM
Thread Re: [nir] New link Loop
Andy 9999 Dec 23, 2007, 12:48 AM
Thread Re: [Andy] New link Loop
nir 9979 Dec 23, 2007, 1:05 AM
Thread Re: [nir] New link Loop
Andy 10000 Dec 23, 2007, 2:53 AM
Thread Re: [Andy] New link Loop
nir 9959 Dec 23, 2007, 2:57 AM
Thread Re: [nir] New link Loop
Andy 9940 Dec 23, 2007, 3:04 AM
Thread Re: [Andy] New link Loop
nir 9956 Dec 23, 2007, 3:33 AM
Thread Re: [nir] New link Loop
Andy 9947 Dec 23, 2007, 3:45 AM
Thread Re: [Andy] New link Loop
nir 9934 Dec 23, 2007, 5:45 AM
Post Re: [nir] New link Loop
Andy 9895 Dec 23, 2007, 6:32 AM