Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Displaying user reviews on static detailed pages ?

Quote Reply
Displaying user reviews on static detailed pages ?
Hello,
in the default templates, is there a way to display user reviews and ratings on detailed pages ? How ?

THanks in advance,
Brakkar
Quote Reply
Re: [brakkar] Displaying user reviews on static detailed pages ? In reply to
 
Here's how i set them up for my Coffee site... which limits the reviews to 3 per link.

Create a Global,

Code:
sub {
#show_reviews
my $ID = shift;
my ($output);
my $table = $DB->table('Reviews') || return $GT::SQL::error;
$table->select_options('ORDER BY Review_Date DESC','LIMIT 3') || return $GT::SQL::error;
my $sth = $table->select( { Review_LinkID => $ID } ) || return $GT::SQL::error;
while (my $hit = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('review_link_show', $hit) || return $GT::SQL::error;
}
return $output;
}

You'll need to modify review_link_show to a custom template that uses the Review tags. eg

<%Review_Subject%>
<%Review_Contents%>

etc.

On your detailed.html template place:

<%if Review_Count%>
<%show_reviews($ID)%>
<%endif%>



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile