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

Re: [brakkar] Displaying user reviews on static detailed pages ?

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

Subject Author Views Date
Thread Displaying user reviews on static detailed pages ? brakkar 1793 Jul 3, 2004, 7:32 AM
Post Re: [brakkar] Displaying user reviews on static detailed pages ?
Chas-a 1686 Jul 5, 2004, 1:31 AM