Webmastersite.net
Register Log In

custom rating field problem

Comments on custom rating field problem

sertan6
Experienced

Usergroup: Customer
Joined: Feb 22, 2004

Total Topics: 47
Total Comments: 88
sertan6
Posted May 20, 2006 - 11:18 AM:

i am trying to add a custom rating field but the variables which shows the number of stars and votes, are not working.

i added the field:
Add fields -> link field -> myrating(float) -> input box

i replaced in vote.tpl the default "votevalue"->"myrating"

added the following in suggestlink.tpl:
<tr>
<td class="labelscolumn"><span class="labels">myRating:</span></td>
<td class="optionscolumn"><input type="text" name="myrating" size="5" value="{LINKMYRATING}"></td>
</tr>

replaced in displaylinks.tpl, to show "myrating" stats
<IF {SWITCH_RATINGS} and {LINKMYRATING}><br><img src="templates/default/images/stars{LINKMYRATINGSTARS}.gif" alt="{LINKMYRATING} out of {MAXVOTE} stars" title="{LINKMYRATING} out of {MAXVOTE} stars"> ({LINKMYRATINGVOTES} votes)</IF>

now i add a link with "myrating"=3 (suggestlink page).
when i return in displaylinks, i get this html output:

<br><img src="templates/default/images/stars<img src="templates/default/images/stars0.gif" alt="0" border="0">.gif" alt="3 out of 5 stars" title="3 out of 5 stars"> (3 votes)

{LINKMYRATINGSTARS}=0 instead of 3
{LINKMYRATINGVOTES}=3 instead of 1
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted May 23, 2006 - 7:33 AM:

It doesn't go in suggestlink.tpl. Your displaylinks.tpl code is wrong, please copy what the default ratings code uses (namely how {LINKSTARS} it's stuck in among the stuff you have around it).
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.