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

Release Notes


  • Fixed error in activate.php,
  • Updated simple_html_dom.php library.
  • was able to add to user profile but what is the code for adding it to the members list, hopefully beside the avatar

  • @ansheng: You could try it with adding the view

    elggx_fivestar_view=user/default, tag=div, attribute=class, attribute_value=elgg-subtext, before_html=<br />

    This adds the rating widget at least on the members' listing pages. But I have not checked if this will add the rating widget to listings of user entities on other pages, too - it would be added everywhere the "user/default" view is used. If you don't like the position the rating widget gets added you should look at the html source code of the members' listing page in your browser to identify possible alternative positions. You would have to look at the css class names used on this page within the listing of a single user and then select one as alternative to "elgg-subtext".

  • When use this plugin I get the following error:  "Uncaught SyntaxError: Unexpected end of input"

    As a Consquence some of my jquery code is stumbling on that error causing the page not being loaded correctly.

    I tried to find the cause, but haven't found it yet. 

  • @Gerard: I haven't got this error so far. Do you have the jquery code included in some published plugin? Then I could try to reproduce the problem.

  • The jquery is very new code, but it is not published yet. Anyway, since it was new code, it  also was my first suspect. But it wasn't, I disabled it and the error was still showing but did not interfere with the page look anymore. It looks that it only appears with tidypics (while viewing a picture), so that plugin could also be the cause of the problem. I currently exclude fivestar rating from pics.

    You should be able to reproduce the problem, enable five star rating and open some pics (not listings).

    I used Chrome devTools to find the error. It will immediately show as error on the top bar.

  • @Gerad: I'm sorry but I can't reproduce. I've tried it with Elggx Fivestar v1.8.6 and Tidypics v1.8.1beta12 on Elgg 1.8.18 with the Tidypics-specific rating views

    elggx_fivestar_view=object/album, tag=div, attribute=class, attribute_value=elgg-subtext, before_html=<br>
    elggx_fivestar_view=object/image, tag=div, attribute=class, attribute_value=elgg-subtext, before_html=<br>

    but there was no "Uncaught SyntaxError: Unexpected end of input" error in the debug logs - actually no error at all.

    If the error would be due to the Fivestar plugin I would also be a bit perplexed if the error would only occur on the Tidypics' image pages as the handling of the ratings on images is not really any different from rating other types of entities. I can only guess that maybe yet another 3rd party plugin is involved and that this other plugin together with the Fivestar plugin (and/or with Tidypics) results in the issue. But I have no idea what other plugin could be involved. I got reports that the bad word filter plugin installed makes Tidypics unuseable (errors on uploads) and I think I remember someone saying that there's an issue with an ajaxed comments or ajaxed live notifications plugin and image tagging of Tidypics images (I don't remember at the moment which plugin caused this issue. Could be an "hype" plugin but I'm not sure).

    Could you test if the error with rating on Tidypics' images also occurs with no other 3rd party plugins enabled - and using the latest releases of Fivestar and Tidpics with the default rating views for Tidypics? If you could narrow down the circumstances involved it might make searching for a solution easier.

  • I am not sure we are on the same page. I use the instructed code to include, well what I understood from it, which is:

    if (elgg_is_active_plugin('elggx_fivestar')) {
            $subtitle .= elgg_view('elggx_fivestar/voting', array('entity'=> $vars['entity'], 'min' => true));
            $subtitle .=  "  ";


    I us a little bit older version of tidypics 1.8.1 beta7 on Elgg 1.8.17

    What do you suggest I change ?

  • @Gerard: I think I understand now the problem. The code of the Tidypics plugin you posted is commented out by default. It's an alternative way to display the rating widget on image pages. I had added these lines of code before implementing a default rating view for Tidypics' images in the Fivestar plugin. After I had added the default view I commented out these lines in the code of Tidypics and added the comment line telling about this being another way to get the rating widget to be added to the image pages.

    You have now both the default rating view added to the images pages plus the alternative code. While each method works without problems when used as the only method it fails to work correctly when both methods are used at the same time. I never thought anyone would try that... Well, I will remove these lines of code for the next release of Tidypics.

    You should now either comment out these lines of code again in the code of the Tidypics widget or you should remove the "object/image" default view from the list of views the rating widget is added to in the Elggx Fivestar plugin settings. I would suggest to comment out the code as the default view will add the rating widget to the images on the same location on the page it's also added to the other types of entities like blogs and files. Btw. I would suggest to upgrade Tidypics to the latest release because there are a number of other issues fixed in the meantime. It should be without risk to upgrade as you are on Elgg 1.8.17 already. And ugrading to Elgg 1.8.18, too, would fix the problem with some notifications not being sent (a bug introduced with Elgg 1.8.17).

  • Ah that works indeed. I use that code on videos too, should I do that differently ?

    About 1.8.18, I solved the notificiation issue before that update was there. So no need to update for now.

    There is also another little strange thing with fivestar. When scrolling down on a list, new content is loaded with jquery but in that new loaded list the fivestar rating show in a different format.

    If you check for instance this page https://www.centillien.com/videos/mostviewed and scrol down you can see what I mean.



  • @Gerard: the point is to use only one method at a time for displaying the rating widget on a view. To be honest I've not yet tested the fivestar voting for videos. But it should work both ways, i.e. either by adding a view in the Fivestar plugin settings or by including the voting view directly in the code of the videos plugin.

    The problem with the jquery loading of list entries seems to be caused by the Fivestar css not being loaded for the additional list entries that are displayed only when scrolling down. I haven't tested the Fivestar plugin with any plugin that adds additional entries on demand only yet. May I ask which plugin you are using to be able to test this myself?

    Maybe it will help if you load the Fivestar css and js library already in start.php of the Fivestar plugin instead of only within views/default/elggx_fivestar/voting.php. But without knowing which plugin you use on your site to add more list entries via jquery I can't test this myself.

  • @Gerard: I've tested it with the infinite scroll plugin and also with the watch my pages plugin. The problem is that the Fivestar css does not get loaded (not even when extending the Elgg css view in start.php of the Fivestar plugin with the Fivestar css). The js library of the Fivestar plugin gets loaded though so voting on the additonally loaded list entries works. I don't know why the css file of Fivestar is not loaded while loading the js library works obviously. Unfortunately, it's beyond my knowledge to fix this - I don't even know why it's not working. Maybe it would help for you to ask on the infinite scroll or watch my pages plugin pages if the developers of these plugins have an idea why it's not working and can suggest a way to fix it (either by modification of the Fivestar plugin or modifying their plugins).

  • @Gerard: it seems the problem of the css style of the Fivestar plugin not being loaded via ajax is a problem of Elgg 1.8. This problem seems to not occur on the upcoming Elgg 1.9 anymore. I've tested it with the watch my pages plugin and the layout of the rating widget was okay also for list items loaded via ajax. Though the watch my pages plugin will require some updates on its own to be fully compatible with Elgg 1.9 (due to use of deprecated functions). The infinite scroll plugin might work without changes on Elgg 1.9. Though it has a problem of its own when used on sites that are installed in a subdirectory.

  • Thanks, I have a 1.9 version running for dev and testing. Many plugins have issues there still and most developers are waiting for a final release before fixing it. I'll live with it for now :-)

  • @Michele: right now it might rather be read as "Allow users to change their votes?" only. The canceling of votes is not fully implemented. I see in the code that the canceling of votes is at least partly implemented but there's at least a "cancel" option that would show up on the rating widget missing. I don't know at the moment if this had never been implemented in the original version of the rating plugin (for Elgg versions < 1.8) or if I might have removed the cancel / delete vote link when porting the plugin to Elgg 1.8. But I surely did forget to sort this out in some way.

  • @Michele: I can't say how difficult or trivial the implementation would be. I don't know if it would make much sense to simply listing all different kind of content in a single list anyway. So, part of the difficulties would also be the "presentation" of the results.

    I'll keep the idea in mind but I can already say now that I won't have time to experiment with this feature in the foreseeable future.

  • Just installed this update and it works great, 1 query though if i may?? How can i add star ratings to Market posts?

  • @Vextah For the market plugin you can add ratings by adding the following lines in Elggx Fivestar's start.php in the function elggx_fivestar_defaults():

    elggx_fivestar_view=object/market, tag=div, attribute=class, attribute_value=elgg-content, before_html=<br />
    elggx_fivestar_view=object/market, tag=div, attribute=class, attribute_value=market elgg-content, before_html=<br />

    The other option would be to add these lines as new views via the Fivestar plugin settings page.

    (I had tried out these lines on Fivestar version 1.8.1 when this question had been already asked but I hope they still work without any changes necessary)


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

Other Projects

View iionly's plugins