sub {
my $id = shift;
my ($votes,$rating)=$DB->table('Links')->select({ID=>$id},['Votes','Rating'])->fetchrow_array;
my $reviews = $DB->table('Reviews')->count({Review_LinkID=>$id});
my $total = $votes+$rating+$reviews;
return "Votes: $votes, Rating: $rating, Reviews: $reviews, Total: $total";
}
Call it with <%name_of_global($ID)%>
my $id = shift;
my ($votes,$rating)=$DB->table('Links')->select({ID=>$id},['Votes','Rating'])->fetchrow_array;
my $reviews = $DB->table('Reviews')->count({Review_LinkID=>$id});
my $total = $votes+$rating+$reviews;
return "Votes: $votes, Rating: $rating, Reviews: $reviews, Total: $total";
}
Call it with <%name_of_global($ID)%>