I’ve just been looking into how easy it would be to integrate a rating script with EE. Looks like both Ryan and Robin are working towards the same thing with a similar starting point. (Have y’all seen the second tutorial on the komodo’s site? Adds nice fraction star ratings and a 3rd rollover state (http://komodomedia.com/blog/index.php/2006/01/09/css-star-rating-part-deux/) )
Maybe a collaboration is in order? 😊
Robin - hope you see this thread.
I’m using EZ Rate for a client’s ridiculous demands - working very well.
Problem is, I need to pass values between -1 to 1 for their ratings calculations. So, ratings can be -1, -0.6, 0, 0.1, 0.5 etc… I’m entering these via an awful Ajax-y slider which works well, and all teh averages work out perfectly if you add positive ratings.
However, it doesn’t seem to like my negative ratings.
For example, if I starty a new article with a rating of 0, and then rate it ‘1’, I get an average of ‘1’. Add another rating of ‘1’ and my average remains at ‘1’ of course.
So, my first problem is: How can I simply add or subtract the ratings? If four people rate it an item with ‘1’ I want them all to be added up, so the rating is ‘4’, not an average of ‘1’.
Second problem: How can a rating of ‘-1’ or ‘-0.3’ be subtracted from the rating. Can negative values not be used?
Sorry about this. Awful client I’m afraid…
Scrap that. Not using negatives any more. But is it possible for me to add each rating rather than create an average?
So, if two people rate as ‘5’, the rating would be ‘10’.
Edit: Um, sorry about this. I do need to pass negative values as ratings. Oh I hate this. If I set up a new item and it is ‘0’, I then try to add a rating of ‘-5’ but the average stays at 0. Eek.
I just need to add and subtract ratings from an ongoing total.
Edit again: If I’ve rated an item as ‘-5” and the avearge shows as ‘0’, but then rate it again as ‘5’, the average is correct: ‘2.5’, so is it just a case of the stats tags not showing the right value when the average is less than zero?
mdesign,
You rating script rocks. If you are able to adapt it to EE, I will gladly be your first customer…
Also looking at this for a rating system on a current project… don’t know if it’s still of interest to Erskine, but negative rating values could be set by modifying the table schema in the Module’s Control Panel file.
It’s set up to store the rating as an unsigned integer, so changing it to a signed value would preserve the negative values.
You’d just need to modify the table create query in mcp.ez_rate.php, and then re-install the module.
$sql[] = "CREATE TABLE exp_ez_rate_stats (
rate_id int(10) unsigned NOT NULL auto_increment,
rating smallint(4) signed NOT NULL default '0',
...
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.