ebsolutions — 2013-03-04T09:15:53-05:00 — #1
I have a script that works out ratings. Its based on a 1-10 scale with havles, for example 1, 1.5, 2, 2.5 etc.
What I want to do is display "stars" instead of actual numbers.
Is there a way I can do this using an if statement, and also using half stars and only 5 stars?
richardaskew — 2013-03-04T09:57:32-05:00 — #2
Are we talking PHP?
pullo — 2013-03-04T10:01:46-05:00 — #3
I would create a div element, take an image (jpeg or whatever) of five stars, then set that image as the background of the div. Depending on how many stars you want to display, you just have to set the width of the div accordingly.
jimmybrion — 2013-03-07T06:18:24-05:00 — #4
One more but quite length option is that you can make switch cases and set the div or div content.