tags:

views:

323

answers:

1

So I was able to make it work, nothing difficult however I have a small problem. if the tutorial/article has a rating of 5 then 5 stars will be yellow, same if it is a rating of 4 or 3. But when the rating is 0 it will still make the first star yellow instead of making them all grey.

I'm using the plugin found on http://zensoftware.org/archives/483

and here is a link to a text file containing the code -> http://cmstutorials.org/code.txt

I don't think it's because of the plugin because when I remove the attribute selected="selected" all the stars become grey. so I guess it's something with my code

A: 

It might be the ceil function. If the rating is greater than zero but less than one, ceiling will return one, the smallest integer greater than the input. For a rating system I would expect that you would really want to use floor -- the largest integer not greater than the input. That way to get a rating of 5, you'd have to get all 5's.

Having said that, if this is still happening with no ratings whatsoever then what I've said above is moot.

tvanfosson
I've tried that but still the same :) thanks anyway :)
krike
ok, I changed the id to class and it was fixed. weird...
krike
Is the entire block you are showing inside another loop? If so, that would make sense since ids need to be unique.
tvanfosson