Gossamer Forum
Quote Reply
reviews
is there a way to see the list of all reviews posted?
or a list of all reviews per category?
Quote Reply
Re: [theguy] reviews In reply to
No, you'll have to write a global or plugin to do that.

Adrian

Last edited by:

brewt: Nov 17, 2006, 3:57 PM
Quote Reply
Re: [theguy] reviews In reply to
I use this global that shows the latest X reviews. Maybe you could remove the limit count to display all.

Code:
Global: ( Title: Latest_Revs )

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};
}


Tag:

<%Latest_Revs(20)%>
<%loop LatestRevs%>
<a href="<%config.db_cgi_url%>/review.cgi?ID=<%ID%>"><%Title%></a>
<%if Review_GuestName%><%Review_GuestName%><%else%><%Review_Owner%><%endif%>
<img src="<%Links::Utils::image_url("stars-5-${Review_Rating}.gif")%>" align="middle" title="<%Review_Rating%> out of 5" /><%Review_Rating%>
<%endloop%>