Star rating/voting plugin Star rating/voting plugin
 

News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

Star rating/voting plugin

Started by ron4mac, March 31, 2026, 08:32:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ron4mac

This plugin provides for a bit of improved user interface when voting/rating a gallery item. It uses a small, configurable selector popup to make it easier to make your selection, especially with touch devices.

Please provide feedback for any issues or make suggestions.

406man

Thanks for creating the plugin. I've tried it in one of my galleries and here are some comments.

As installed the new voting stars are much bigger than the standard ones and I like the configuration option in the plugin to set their type and size. Bigger ones mean it's easier to position the cursor suitably when voting which is an advantage. The heart icon looks really good and I can see it being popular. 

I think it would help the individual stars to visually stand out if there was a border between them as currently they merge together. The hearts are fine as they already have a border.

CPG potentially will display the voting stars in three different places:
1.   Below the thumbnail in the thumbnail display, if enabled.
2.   Below the image in the image view where you vote
3.   In the image view if an image has received any votes the Rating will be displayed.

In standard CPG all three places display the same star icon. With the rating plugin the voting star icon changes in 2 above but 1 and 3 remain as before. For visual consistency I think it would be better to use the same voting/rating icon in all three places if that's possible. As it is, when hearts are selected the "Select to rate" below the image on the Image View screen has hearts but the Rating in the File Information section below still has stars which is confusing.

ron4mac

Thanks for the feedback. I'll work at resolving these things for version 1. Not sure how I missed those other spots that ratings get displayed :-[  I also hope to have more shape selections (6point star, 5point star, 4point star, heart, diamond and circle) and an option for color.

ron4mac

#3
Well ... it turns out that rating display is done separately from 4 different pieces of code! (crazy!)
I am in no way going to try to deal with that. And I've sworn off from doing any more work with CPG releases other than required maintenance work. So I'm going to fall back to just the original goal with this plugin, which was to provide an improved UI to select a rating - especially involving touch devices. Replacement version (1.0), above, does just that.

406man

There is an alternative with limited functionality which just modifies the voting icons by, for example, making them bigger and more brightly coloured. It's possible to replace the icons used in the rating by modifying your theme.

Create some new icons named:
rate_full.png      Used when displaying the votes that an image has. Make it coloured.
rate_empty.png      Used when displaying the votes that an image has. Make it grey, for example.
rate_new.png      Used when actually voting to show the stars you've included in your vote. Make it coloured and should be different colour to rate_full.png

If an image has been rated as having, for example, one star out of five, it will be displayed with one rate_full.png and four rate_empty.png

Put them into the following directory:

https://yourgallerydomain/your_gallery_directory/themes/your_theme_name/images

Add this definition to your theme.php file:

define('THEME_HAS_RATING_GRAPHICS', 1);