Try this (untested)
get_links_from_last_48_hours
Code:
sub {
my $today = GT::Date::date_get();
my $yesterday = GT::Date::date_sub($today,1);
my $sth = $DB->table('Links')->select( GT::SQL::Condition->new('Add_Date','>=',$yesterday) ) || die $GT::SQL::error;
my @links;
while (my $hit = $sth->fetchrow_hashref) {
if ($CFG->{build_detailed}) { $hit->{detailed_url} = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} ); }
if ($hit->{isNew} eq "Yes") { $hit->{isNew} = 1; } else { $hit->{isNew} = 0; }
if ($hit->{isPopular} eq "Yes") { $hit->{isPopular} = 1; } else { $hit->{isPopular} = 0; }
if ($hit->{isChanged} eq "Yes") { $hit->{isChanged} = 1; } else { $hit->{isChanged} = 0; }
push @links, $hit;
}
return { last_48_hour_loop => \@links }
}
..and call with:
Code:
<%get_links_from_last_48_hours%>
<%if last_48_hour_loop.length%>
<%loop last_48_hour_loop%>
<%include link.html%>
<%endif%>
<%endif%>
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my
Amazon Wish List GLinks ULTRA Package | GLinks ULTRA Package PRO Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin |
Pre-Made Template Sets |
FREE GLinks Plugins!