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 10555 Dec 12, 2007, 7:19 AM
Thread Re: [nir] New link Loop
Andy 10067 Dec 13, 2007, 12:21 AM
Thread Re: [Andy] New link Loop
Wychwood 9995 Dec 13, 2007, 2:35 AM
Post Re: [Wychwood] New link Loop
Andy 10042 Dec 13, 2007, 2:49 AM
Thread Re: [Andy] New link Loop
nir 10029 Dec 13, 2007, 4:00 AM
Thread Re: [nir] New link Loop
Andy 10040 Dec 13, 2007, 4:05 AM
Thread Re: [Andy] New link Loop
nir 9975 Dec 20, 2007, 4:30 AM
Thread Re: [nir] New link Loop
Andy 10008 Dec 21, 2007, 2:30 AM
Thread Re: [Andy] New link Loop
nir 9951 Dec 23, 2007, 12:42 AM
Thread Re: [nir] New link Loop
Andy 9995 Dec 23, 2007, 12:48 AM
Thread Re: [Andy] New link Loop
nir 9975 Dec 23, 2007, 1:05 AM
Thread Re: [nir] New link Loop
Andy 9996 Dec 23, 2007, 2:53 AM
Thread Re: [Andy] New link Loop
nir 9955 Dec 23, 2007, 2:57 AM
Thread Re: [nir] New link Loop
Andy 9936 Dec 23, 2007, 3:04 AM
Thread Re: [Andy] New link Loop
nir 9952 Dec 23, 2007, 3:33 AM
Thread Re: [nir] New link Loop
Andy 9943 Dec 23, 2007, 3:45 AM
Thread Re: [Andy] New link Loop
nir 9930 Dec 23, 2007, 5:45 AM
Post Re: [nir] New link Loop
Andy 9891 Dec 23, 2007, 6:32 AM