Release Notes

The Fivestar voting plugin adds a clean, attractive voting widget to views in Elgg. Fivestar is built using the jQuery Star Rating widget.



  • jQuery rollover effects and AJAX no-reload voting.
  • Graceful degradation to an HTML rating form when JavaScript is turned off.
  • Configurable options to allow users to cancel or change their votes.
  • Insert the fivestar widget into any view via configuration options (requires an understanding of Elgg views and html) or by manually inserting the view code.

Planned features:

  • Configurable star sets.
  • Easier view configuration.
  • Userpoints integration.


Screenshots -


Blog Post


Tidypic photo:

Fivestar tidypic



Fivestar polls


Adding the widget:

Adding or removing the widget from your views can be done 2 different ways.


The 1st way is done via the Fivestar settings. The text box under 'Add fivestar to a view:' is used to add view configurations. The configuration can be complicated and requires an understanding of Elgg views and html. Firebug can be a big help.


The widget is inserted by intercepting the html that is about to be displayed to the user. The html is then parsed and the widget is inserted into the html at the specified location. A handful of view configurations are included by default. To remove the widget from a view just delete the appropriate config entry.


A sample config looks like:


view=object/blog, tag=div, attribute=class, attribute_value=contentWrapper singleview, before_html=<br />


This a comma delimited list of key/values and breaks down as follows.

  • view: The Elgg view that we want to insert the widget in.
  • tag: The tag we want to insert into. This can be a div, span, etc.
  • attribute: This will usually be id or class and helps to further identify the correct tag.
  • attribute_value: The value of the id or class specified by the attribute.
  • before_html: Additional html that is added before the widget for styling.
  • after_html: Additional html that is added after the widget for styling.


An alternative way to add the fivestar widget is to edit the view code of the plugin you want to vote on and add the following line. Where you add the line will determine where the widget is displayed.


<?php echo elgg_view("fivestar/fivestar", array('entity' => $vars['entity'])); ?>


This approach may be easier for some people but requires updating all your views after an Elgg upgrade.


Update 1.0.4:

  • Fixed bug with saving view configs where the before_html and after_html parameters were being removed by Elgg.


Update 1.0.3:

  • Updated to support manual insertion of the fivestar widget.
  • Removed view config for group comments.
  • Code cleanup.


Update 1.0.2:

  • Updated Fivestar to prevent anonymous voting. Anonymous users can see the current rating but they will not be able to vote.
  • Updated Fivestar settings page to make managing views a little easier.
  • When changing votes is not permitted, users who have voted will not be able to interact with the fivestar widget. Previously they could submit a vote and then get a message back saying they cannot vote again. Now they will not be able to submit a vote.


Update 1.0.1b:

  • Fixes a bug with the default view settings that prevented users from seeing the fivestar widget on any view.


  • @Divagater, Nice plugin. Have updated in my blog's view page using this.

    <?php echo elgg_view("fivestar/fivestar", array('entity' => $vars['entity'])); ?>

    Now the ratings are working fine. but can't able to find how it's getting stored in db, as this rating is for which blog?

    Can you please help me with this?


  • @Anitha

    The view for the blog has access to $vars['entity'] which is the blog entity for the blog currently being viewed. The blog entity is being passed to the fivestar plugin with this view code you added:


    <?php echo elgg_view("fivestar/fivestar", array('entity' => $vars['entity'])); ?>


    So fivestar knows which blog it is workng on. When a vote is cast the vote is stored as an annotation of type fivestar on the blog entity that was passed.


    Does that answer your question?


  • Thanks a lot  for your quick reply!! Got it's on annotations table.

    Thanks Again!!!

  • it is compatible with version 1.5? if it is not as it could work with the version 1.5?

  • @derocox

    That question is answered on the first page. Look for the posts ablut javascript.

  • beautiful plugin :) thank you



  • Hi Divagater,

    Last time i posted one issue with fivestar in my site:Using IE 7.0 and it' s happening in all the places..........

    I am using this plugin with elgg1.5(on Linux centos Operating system) and i updated the jquery .js files (jquery 1.3.2.min.js,jquery-ui-1.7.2.custom.min.js).That time it's not working b'coz of php version problem.Now i upgraded to php5.2.4. It's working fine.

    But again i am getting one more issue with this's effecting the "elgg's" Dash board.

    Suppose if i want edit my "Dash board" page that time whenever i drag and drop a widget from the edit panel it's not working and it' going away and not saving the view also.

    If i remove jquery 1.3.2.min.js,jquery-ui-1.7.2.custom.min.js (Using old jquery files) ,then that it's working fine.

    Can you pls tell me what was the issue .


  • @Divatager, Thanks for this wonderful and useful plugin.  It's been working without a hitch for me.  If you plan to continue to work on this, perhaps this may already be in your wishlist but the ability to have a menu to list entities by rating (highest to lowest, lowest to highest, no rating, etc) would likely be useful to a lot of folks - tidypics, blogs, files, videos, etc.

  • @Divagater - great release. a useful feature would be to add a configuration item to allow only friends to (or users in the same group) to vote so that way you can somehow control the reliability of the vote.

    Another good idea is to add a Top Rated page with different filters (by time, by type (file, blog, etc)).


    Perhaps you should put this plugin in an open environment like SourceForge or Google Code and we can help you push all of these features in.


  • How would I resize the izap thumbnail video on list view.  it's at 40x40 on list view. Is there a way to make the video thumbnails looking like the photo albums thumbnails with ratings at the bottom. many thanks

  • @hellmino

    Upgrade to 1.6+. I am not going to troubleshoot javascript issues with trying to use jquery 1.3.2 on a 1.5 Elgg install.



    So as for permissions I rely in the permissions of the object being voted on. If non friends can see it then non friends can vote. If some one wants only friends to vote then they should set the entity (blog, page, etc) to friends only. A vote is simply an annotation on an entity like a comment. Now if there is a time that non friends can't comment but can vote then that would be something I should look at because that would be wrong. and until I make svn available I would gladly except a patch for added functionality.


    I think you are asking about how to edit izap_videos view code. I am not the author of that plugin but to get you pointed in the right direction have a look at mod/izap_videos/views/default/izap_videos/listing.php







  • Alex Tanchoco

    A lot of people have been asking for ability to list items by rating. I think one user is trying to come up with his own solution as well. I will see what I can come up with.

  • Thanks for your continued efforts on this.  If has this installed, I'll give fivestar a five star (out of five of course)!

  • Hi Divagater excellent plugin. I've installed it and i'm able to see the 0 of 5 stars (0 votes) text line, but for some reason the start and ability to vote are not coming up for me. Was it something I missed or neglected? Any assistance will be greatly appreciated.



  • Hi GemGfx. This plugin will work out of the box on a clean Elgg 1.6 install. If it doesn't work then its a javascript issue and so far all the javascript issues people have seen have been related to using jquery 1.2.6. which ships with 1.5. Elgg 1.6 uses 1.3.2 which I require. I have also seen it break for 1.6 users who install the facebook plugin because it installs its own jquery 1.2.6. Updating jquery to 1.3.2 in either of those cases has been discussed many times.






  • @Divagater, saw your post on listing of ratings based on the votes obtained is being worked by other person. Would like to know whether the votes been stored anywhere in the db. I checked annotations table but it's not there.. Can you please help me, as am badly in need of sorting based on votes.

    Thanks in Advance

  • @Divagater Thanks for your expert direction. I was able to find your discussion on the fbconnect plugin and I changed the code to update the jquery. I can now see the stars. Again excellent work on the plugin and 5 starts out of 5 for your support.



  • @Anitha

    A fivestar rating is an annotation of the entity being rated. Look at the fivestar_vote() method in mod/fivestar/start.php


    In order to do a highest rated list a lot of thought has to be given to how to do it. Simply saying "sum all ratings and group by entity" would probably not perform well on a large site. They way I would do it Instead would be to add a trigger on the annotation calls in fivestar_vote(). Then hook on that trigger and update a metadata property on the entity that stores its current rating.


    That is not hard, just a couple hours work and also a method should be included that can be ran by an admin to update the rate totals for all entities that have already been rated.



  • How can I implement fivestar plugin in kevins form plugin.

  • I don't know what Kevin's plugin means :) But, the way you add fivestar to any plugin is documented in the plugin notes above. You would probably be interested in the part that begins with "An alternative way to add the fivestar widget is to ..." As that approach is a little easier.



  • dont work for me, causes object id errors everywhere it that you can rate!!

  • A question: why when I active fivestar plugin and blog plugin (with one post) in elgg 1.6.1, the homepage is blank? If I active only fivestar plugin or only blog plugin the homepage is ok. But if I active both i've homepage blank. There is any conflict?

    Thanks for your support

  • OK sorry, i've the solution. From fivestar settings remove the line of the view configuration (--object/blog):

    view=object/blog, tag=div, attribute=class, attribute_value=contentWrapper singleview, before_html=<br />

    and now all works!!!


  • The page is blank because fivestar requires the blog in order to vote on a blog. When enabling at the sametime probably fivestar enabled first. Removing the blog as you did means you will not rate blog posts. Just enable blog first, then fivestar and you are fine.

Billy Gunn

Developer @ Arck Interactive


  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 7887
  • Recommendations: 16

Other Projects

View Billy Gunn's plugins