Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

ezstarrating: star ratings for content

This page is for site builders who let visitors rate content. ezstarrating adds a Star Rating datatype (ezsrrating). Add the attribute to a content class, and visitors can rate objects of that class from 1 to 5 stars.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/features/6.0/extensions/ezstarrating.md

On this page

ezstarrating: star ratings for content

This page is for site builders who let visitors rate content. ezstarrating adds a Star Rating datatype (ezsrrating). Add the attribute to a content class, and visitors can rate objects of that class from 1 to 5 stars.

  • Each user may vote once per session.
  • Ratings are stored in the table ezstarrating_data and recalculated into a per-object average.
  • Templates can show the rating, and the extended attribute filter ezsrRatingFilter sorts and fetches by rating.
  • It depends on ezjscore: the rating call is the ezjscore function ezstarrating_rate, with ezstarrating_user_has_rated.

Set it up

  1. Activate the extension (ActiveExtensions[]=ezstarrating) and regenerate autoloads: php bin/php/ezpgenerateautoloads.php -e.
  2. Create the rating table from extension/ezstarrating/sql/<engine>/ (mysql, postgresql, oracle; a SQLite schema was added in 6.0.3).
  3. Grant the roles that may vote the policy module ezjscore, function call, limitation ezstarrating_rate.
  4. Add a Star Rating attribute to the class to be rated.
  5. Clear the caches and open an object of that class: the stars appear.

What changed in the Exponential 6 releases

VersionDateChange
6.0.327 September 2026See below. A SQLite schema for the rating tables was added.
6.0.4The description names Exponential.
6.0.51 October 2026The star rating uses jQuery 4 (.on() and .off() instead of the click shorthand and .unbind()).
6.0.62 October 2026The YUI 3 rating script is removed. ezsrrating.tpl loads ezstarrating_jquery.js whatever ezjscore.ini [...] PreferredLibrary says, and ezstarrating_yui3.js is gone. See YUI removal.
6.0.7, 6.0.8Copyright notices; English and German translations for every string the admin showed untranslated.

About 6.0.3:

  • The rating classes declared protected constructors over the public constructor of eZPersistentObject, which PHP 8 refuses when the class is loaded. They are public again; ezsrRatingObjectTreeNode calls the persistent object constructor, and the empty PHP 4 style constructors are gone.
  • ezsrRatingObject::stats() kept its cache in a function static, which a persistent worker (Velocity) carries from one request to the next. It now lives in a static class property, so it stays bounded, shows new votes and never crosses databases.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x