Forums / Developer / problem with an extension
Eric Tshiunza
Monday 27 April 2009 6:34:47 am
I use an extension StarRating, which makes me the votes, a place I must note that the side I want to give and another place I must have an average rating of all the videos. how to get my problem noted.
Bruce Morrison
Monday 27 April 2009 7:18:13 pm
Hi Eric
StarRating questions are better addressed to the extension forum http://projects.ez.no/index.php//starrating/forum
Once you have access to the content attribute you can access the average via $attribute.content.rounded_average or $attribute.content.average
Retrieving the average across all content classes is a little more difficult. Each rating is stored in the database http://svn.projects.ez.no/starrating/sql/starrating.sql Once you know the attribute id ( contentobject_attribute_id ) of the content object it shouldn't be hard to work out the average.
If I have time I'll look at adding this to the extension.
CheersBruce
My Blog: http://www.stuffandcontent.com/ Follow me on twitter: http://twitter.com/brucemorrison Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish