Hi Andy,
I'm using this global. Don't know why, but it seems to work for me. Cause it shows only four new reviews.
Code:
sub {
my (@links,$sth,$link);
my $search_db = $DB->table('Links','Reviews');
$search_db->select_options ("ORDER BY Review_Date DESC", "LIMIT 10");
$sth = $search_db->select ( { isValidated => "Yes" } , { isNew => "Yes" } , { Review_Validated => 'Yes' });
while (my $link = $sth->fetchrow_hashref()) {
if (length $link->{Title} > 70) {
$link->{Title} = substr($link->{Title}, 0, 50) . '...';}
$link = Links::SiteHTML::tags('link', $link);
$link->{detailed_url} = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
if (length $link->{Review_Contents} > 500) {
$link->{Review_Contents} = substr($link->{Review_Contents}, 0, 500) . '...';}
push@links, $link;
}
return {All_new_Reviews=>\@links};
}
Now I just want a global like this
Code:
sub { $DB->table('Reviews')->count( { isNew => 'Yes', isValidated => 'Yes' } ) }
to show how many new reviews are there...
Thanks
Matthias
gpaed.de