Gossamer Forum
Home : Products : Links 2.0 : Customization :

Rate image on Detailed page

Quote Reply
Rate image on Detailed page
Hi,
I have the image ratings mod installed and it works fine on all pages except the Detailed page.

I added in site_html_templates - sub site_html_detailed - rate_img => $rate_img, but the image does not show.

Without the above entry, i get unknown tag error.

Any help please?
Quote Reply
Re: Rate image on Detailed page In reply to
Uh...you have to copy the $rate_img codes that you used in the sub site_html_link routine and paste them to the top of your sub site_html_detailed routine.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: Rate image on Detailed page In reply to
Hmm...how about for adding the reviews link to the details page? I added the routines to the sub site_html_detailed routine but it still does not show up? Here is my full sub site_html_link routine:

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.

my %rec = @_;

#### review mod addition 1 ####
my $reviews = "";

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});

#### review mod addition 2 start ####

$IdFile = "/Reviews/id.txt";

open (IDFILE, "<$IdFile") or &cgierr ("Can't open $IdFile. Reason: $!");
@idfile=<IDFILE>;
close (IDFILE);
$num_rev = 0;
foreach $line (@idfile) {
if ($line=~ /^$rec{'ID'}\|(\d+)/) {
$num_rev = $1 #the number of reviews that have been written
}
}
# Customize the qq~ foo ~ to suit, make sure the link points to your review directory
# This is the link to the review page if there are 1 or more reviews. The number of
# reviews is displayed in parenthesis.
if ($num_rev ge "1") {
# Delete ($num_rev) if you only want a link without the number of reviews (x)
# If your review directory is not Reviews (subdirectory of Links) change the link.
$reviews = qq~<small><A HREF="/Reviews/$rec{'ID'}.html">[Reviews ($num_rev)]</A></small>~;
}
# change/delete the stuff between ~ and ~ if you don't want - Reviews (0) in your description.
else {
$reviews = qq~<small>[Reviews (0)]</A></small>~;
}
### end above review mod addition ####


#### review mod addition 3 #### add "reviews => $reviews," to return &load_template (e.g. below).
return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
reviews => $reviews,
%rec,
%globals
});
}

I've tried adding all of it to some of it, to the sub site_html_detailed routine, but whatever I add doesn't seem to work. Any ideas what part I should add?

Thank You