Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Rating Image Problem

Quote Reply
Rating Image Problem
I have followed every steps of Rating Image Mods
(http://gossamer-threads.com/scripts/resources/Attach/791-rateimage.html)
but I get this error :
00Error: Unable to compile function: rate_img. Reason: syntax error at (eval 25) line 9, near "} eg " syntax error at (eval 25) line 11, near "} elsif" Global symbol "$rec" requires explicit package name at (eval 25) line 11.

You can take a look at it here :
http://buyanythingathome.com/catalog/Books/French/index.shtml
I have set up the path right as well uploaging all images.

Anyone can help me?
Shahed

Quote Reply
Re: Rating Image Problem In reply to
Making the code web accessible would help.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Rating Image Problem In reply to
I made a new templete on User template:
Uploaded all images on right path also


rate_img

Code here>>>


sub {

#Rating as Images

my $rec = shift;

my $image = shift;

if ($rec->{'Rating'} eg '0.00') { return ; }

elsif ($rec->{'Votes'} < '10') { $image = 'rating1.gif'; }

elsif ($rec->{'Rating'} le '1.50') { $image = 'rating1.gif'; }

elsif ($rec->{'Rating'} le '2.50') { $image = 'rating2.gif'; }

elsif ($rec->{'Rating'} le '3.50') { $image = 'rating3.gif'; }

elsif ($rec->{'Rating'} le '4.50') { $image = 'rating4.gif'; }

elsif ($rec->{'Rating'} le '5.50') { $image = 'rating5.gif'; }

elsif ($rec->{'Rating'} le '6.50') { $image = 'rating6.gif'; }

elsif ($rec->{'Rating'} le '7.50') { $image = 'rating7.gif'; }

elsif ($rec->{'Rating'} le '8.50') { $image = 'rating8.gif'; }

elsif ($rec->{'Rating'} le '9.50') { $image = 'rating9.gif'; }

elsif ($rec->{'Rating'} le '10.00') { $image = 'rating10.gif'; }

else { $image = 'rating1.gif'; }

return qq|<a href="$Links::CFG->{db_cgi_url}/rate.cgi?ID=$rec->{'ID'}">

<img src="$Links::CFG->{build_images_url}/$image" border="0" alt="Rate It!" align="absmiddle"></a>|;

}






Quote Reply
Re: Rating Image Problem In reply to
New template?

You make a global with it.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Rating Image Problem In reply to
Here is What I did :
build>Template Globals and chose Snap(Since my Template is Snap)
and than I create
rate_img : I have created it by just following the instruction. I can't figure this out.
For further info I PM u the info