View iionly's plugins
This is an updated version of Divagater's Fivestar voting plugin (http://community.elgg.org/pg/plugins/project/385091/developer/divagater/fivestar) to work with Elgg 1.8 (version 1.8.X) and Elgg 1.9 (version 1.9.X).
This plugin will add a voting widget to certain views on your site, for example blogs, pages, bookmarks, files and group discussions. By default the voting widget will display 5 stars but you can configure the number of stars to show. You can also configure if your members should be allowed to change their vote or not.
(0. If you have installed a previous version of the Elggx Fivestar plugin disable the plugin in the admin section of your site and then remove the elggx_fivestar folder from the mod directory of your Elgg installation,)
Which version of the plugin to use on which version of Elgg?
If not stated otherwise the first two numbers of the plugin version will indicate the compatible Elgg version, i.e.
The third number in the plugin version will indicate the actual plugin version, i.e. two plugin versions numbered for example "1.8.1" and "1.9.1" (or "1.8.2" and "1.9.2" etc.) should basically have the same features but only differ in API code that is specific to the Elgg version the plugin is compatible to.
If there's ever a fourth number in the plugin version, this version will only include fixes in the plugin necessary for the corresponding Elgg version, i.e. a plugin version "220.127.116.11" would fix some Elgg 1.9 specific issues of version "1.9.1" while such fixes would not be necessary for example for the corresponding version of the plugin for Elgg 1.8 (so there would be not release "18.104.22.168" necessary).
How to customize it:
To include the rating widget on your site after enabling the Elggx Fivestar plugin for the first time (or after upgrading from a version of Elggx Fivestar < 1.8.0) you need to set the default views on Elggx Fivestar's plugin settings page in the admin section of your site ("Administer" - "Utilities" - "Elggx Fivestar"). Click on "Set / Reset default views" and save the settings. There are already some default views defined in start.php where the rating widget will be included on your site, for example on blogs, pages and group discussions.
You can also configure on your own where the rating widget should appear. Either you can define additional views to include the widget on other pages or remove the rating widget from certain pages. If you are not happy with any of the default views and want to remove it you can do this in the plugin's setting page by removing the corresponding view. Or you can adjust the default views defined in start.php of Elggx Fivestar (function elggx_fivestar_defaults() starting at line 260) and then resetting the views on the settings page.
If you want to add the rating widget to a view you can also do this either via adding the view directly via the settings page or again by adjusting the default views in start.php. You will need to have some knowledge about the php/html code of the view you want to add the rating widget to be able able to define the correct position. The already defined default view should give you an idea how it works.
If you want to add a new view via the settings page the code to be included has to start with
followed by the parameters to identify the view.
The method for adding the rating widget to a view as used by the defined default views or any other views you define via the settings page / start.php requires a distinct html or css tag to define the position the rating widget will be included on the corresponding page, either before or after this tag. Sometimes, this method might not be appropriate to define the exact position desired for the rating widget. There's also a second way to add the rating widget to a view that allows exact positioning. You need to modify the code of the view for this method to work.
Simply add the following at the appropriate place in your plugin code and adjust the parameters accordingly:
echo elgg_view("elggx_fivestar/voting", array( 'entity' => $entity, 'min' => true, 'subclass' => 'fivestar_subclass', 'outerId' => 'fivestar_rating_list', 'ratingTextClass' => 'fivestar_rating_text'));
The above code snippet includes all possible options to configure the voting widget. These are:
The simpliest way to include the voting widget in the plugin code is by only giving the entity to be voted on as parameter:
echo elgg_view("elggx_fivestar/voting", array('entity' => $entity));
In this case the default css layout of the voting widget is used. Still, you must assign the correct entity to the variable $entity in any case.