[Elgg 1.8-1.12 & 2.X & 3.X: Elggx Fivestar] v1.8.0

Release Notes

Initial release for Elgg 1.8. In case of problems, please tell me.

There are some default views defined where the voting widget will appear on your Elgg site. If you want to change the configuration, remove the voting widget from certain views or add it to others, please read the README.txt for instructions how to proceed.

  • As someone told me via PM (and as I have verified in the meantime) adding views on the settings page in the admin section seems buggy, i.e. new views added are not saved. I'm almost sure I had it tested and it worked at some point. Though I might have introduced this bug later due to some renaming in the views handling necessary for the plugin to work in Elgg 1.8. I need some time to find the root of this bug. In the meantime you still can add new views by adding them to the default views in start.php. The method of adding the rating widget code directly into plugin code should also work - any feedback on this?

  • Thanks for the plugin ! I have a question, how can admin change the votes? I couldn't see any setting on admin panel. Which changes should be done in database? Thanks...

  • Super recommended................

  • @Onur: maybe I explained it not clearly enough. The admin can't change the votes directly, but you can configure in the admin section in the settings of Elggx Fivestar, if your users should be allowed to change their own votes (re-vote) or if they should only be allowed to vote once and not be able to change their votes later. In case you allow re-voting, the number of total votes won't change, i.e. each user has only 1 vote.

  • Hi iionly

    great plugin, appreciate it muchly.

    I'm a little stuck on how to add the rating to other views. I've tried it in the admin panel but it doesn't seem to save...   I tried adding the above code in your descripyion to view/s but with no effect.  I know this will be a stupid question to someone as experienced as you but...   do I have to place the code inbetween opening/closing div and/or php tags?

    any help would be great

    thanks in advance


  • @Stumpy:

    Sorry, that adding the rating widget to additional views (btw removing too) doesn't work via the admin panel currently. I was already aware about that (see my posting above).

    I just found the reason why it fails and already have found a workaround. The reason why it fails is rather annoying actually. The "Save" button is added automatically by Elgg core on the plugin setting pages and somehow this save button ignores the array necessary for the views to be saved. My current workaround is to move the fivestar plugin settings to the Administer - Utilities section, because I can add my own "Save" button there. Actually, I had placed the settings there first and tested the views handling. Therefore, I was rather surprised that is don't work anymore when moving the settings to the other section in the admin panel.

    I'll release a new version asap. I just want to do some more testing, so it might take a day or until the weekend at the latest until I'm done.

    Sorry, for the bad explanation when adding the elgg_view code snippet to add the rating widget via plugins' code. You need to add the code between <?php ?> tags. In the simplest form you need to add something like this:

    <?php echo elgg_view("elggx_fivestar/voting", array('entity' => $entity_guid)); ?>

    The variable $entity_guid contains the GUID of the Elgg entity you want to assign the rating widget to. You need to assign the correct GUID to the variable before this line. The other parameters are used to enable some layout configurations. You can add some CSS options for specific views to the css file of the Elggx Fivestar plugin (basic.php in views/default/css). If you don't include any specific parameters in the elgg_view call, the default widget layout of the rating widget is used.

  • @iionly

    Thanks the help on this. 

    If i'm honest I should have thought to use php tags, but i'm only a learner.

    Thanks again




  • Hi, Can I add vote to river posts? (comments) ,. If Yes, how to do?

    Thanks and great plugin ! Congratulations !

  • @junirhallak: it should be possible to add the voting option to river posts with the exception of voting on comments. The reason it will not work for comments (not only in the river but anywhere on the site) is due to the data model of Elgg (up to version 1.8) where comments are saved as annotations and not as entities. The rating is only possible on entities though. With Elgg 1.9 comments will be handled as separate entities which will allow for rating on them, too. But I will have to look into this when Elgg 1.9 is available (or at least the comments saved as entities is implemented) to upgrade the Fivestar plugin accordingly.

    How to add the rating to river posts (which are based on entities) is someting I would have to find out in detail for myself, too, before being able to tell you. I had decided against implementing it to not make the river posts containing too much info. I would say it should be possible to add the rating to river posts by including the corresponding view to the array of $elggx_fivestar_view in start.php. You would also need to define the location based on html tags where the rating widget should appear. Another possibility could be to extend the river views with a rating view.

  • IIonly i used this tag <?php echo elgg_view("elggx_fivestar/voting", array('entity' => $entity_guid)); ?>

    but i am getting only javascript .... rating is not appearing on the static page.

  • What entity are you trying to vote on?

  • And it's also the an entity and not the entity guid you have to provide.

  • i just creating a review page . i dont know which entity to give can u specify it


  • now i can find the entity its object entity


  • The Fivestar plugin can only be used to vote on an existing entity. It does not create its own entity that is voted on. Therefore, you would need to provide an object, user or group entity that is suitable to be voted on. In your case: what is to be reviewed? Is there some content on your site or a user or group that is represented by an entity that you want to get rated on this static page? Then you would need to provide this entity in the 'entity' parameter in the elgg_view call. If there's no such entity that can be voted on, then you can't use the Fivestar plugin in its present form.

    Another issue that I just noticed (and can't give a working solution right now) is that the Elgg CSS classes (plus the additional Fivestar CSS classes) are not automatically available if you simply use elgg_view("elggx_fivestar/voting", array('entity' => $entity_guid)) on a static page (I've made a test with using the Anypage plugin). This will result in the Fivestar rating widget to show up with the radio buttons defined in html instead of the star graphics. I've never used (or tested) the Fivestar plugin outside the Elgg pageshell so far. Therefore, I can't say right now how you would get the correct CSS definitions to be used without adding the whole code of the voting view in your static page plugin defining the CSS classes again on your own instead of simple using elgg_view().

  • thanks for ur comment iionly i created my own rating plugin .


  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2020-8-23
  • Downloads: 10826
  • Recommendations: 31

Other Projects

View iionly's plugins