Hi,
I have this global to diplay the latest links that have a new review. The only issue is a link that has more than one review is duplicated on the output thus:
Good Food - Peter
Good Food - Harry
Best Computers - John
I really wanted:
Good Food - Peter
Best Computers - John
as peter was the latest review added.
Any help really appreciated!
sub {
my (@links,$sth,$link);
my $search_db = $DB->table('Links','Reviews');
$search_db->select_options ("ORDER BY Review_Date DESC","LIMIT $_[0]");
$sth = $search_db->select ( { Review_Validated => 'Yes' });
while (my $link = $sth->fetchrow_hashref()) {
if (length $link->{Title} > 50) {
$link->{Title} = substr($link->{Title}, 0, 50) . '...'; }
$link = Links::SiteHTML::tags('link', $link);
push@links, $link;
}
return {LatestRevs=>\@links};
}
<%Latest_Revs(15)%>
<%loop LatestRevs%>
<a href="<%detailed_url%>"><%Title%></a> - <%Review_GuestName%><br/>
<%endloop%>
--------------------------------
Privacy Software
I have this global to diplay the latest links that have a new review. The only issue is a link that has more than one review is duplicated on the output thus:
Good Food - Peter
Good Food - Harry
Best Computers - John
I really wanted:
Good Food - Peter
Best Computers - John
as peter was the latest review added.
Any help really appreciated!
sub {
my (@links,$sth,$link);
my $search_db = $DB->table('Links','Reviews');
$search_db->select_options ("ORDER BY Review_Date DESC","LIMIT $_[0]");
$sth = $search_db->select ( { Review_Validated => 'Yes' });
while (my $link = $sth->fetchrow_hashref()) {
if (length $link->{Title} > 50) {
$link->{Title} = substr($link->{Title}, 0, 50) . '...'; }
$link = Links::SiteHTML::tags('link', $link);
push@links, $link;
}
return {LatestRevs=>\@links};
}
<%Latest_Revs(15)%>
<%loop LatestRevs%>
<a href="<%detailed_url%>"><%Title%></a> - <%Review_GuestName%><br/>
<%endloop%>
--------------------------------
Privacy Software