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
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work! Want to give me something back for my help? Please see my
Amazon Wish List GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500) Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin |
Pre-Made Template Sets |
FREE GLinks Plugins! Compare our different Plugin packages *new* Free CSS Templates