NextGEN Gallery Voting Premium

You can now get the Premium add-on to the free NextGEN Gallery Voting. The add-on is packaged as a separate WordPress plugin, that when installed with NextGEN Gallery Voting, adds many useful new features.


This add-on extends the functionality of the FREE WordPress plugin NextGEN Gallery Voting. Please be sure you have at least version 2.3.2 of NextGEN Gallery Voting installed and working on your WordPress site before installing this premium add-on.
If you need any help or support getting the free plugin working, you can post on the support forum here.

Here are the new features this add-on will give you:

New ‘Like’ voting type:

After installing the add-on, you will now be able to select a new voting type for your galleries and images. This ‘Like’ voting type works in the same say as free ‘Like/Dislike’, but without the ‘Dislike’ option. This allows you to offer Facebook style ‘liking’ of images.
You can also change the image used to perform the ‘like’, from the settings screen.


Show Voting in Image Popup:

This plugin adds an option to each image that allows you to show the the voting form in the image popup in the default gallery view.
Please note, this only works with the “Shutter” effect in NGG 1.9.x for now. More effects to be added in the future, including better support for NGG v2 and NGG v2 Pro.


New Settings:

Under NextGEN Gallery Voting’s settings screen, you will now see a few more options.

  • You can update your gallery and image settings across all NextGEN Galleries and Images with one click.
  • You can delete all gallery and image votes with one click.
  • You can upload a custom image that will be shown as the ‘Like’ button, if you have selected the ‘like’ voting type.


Enforce Single Vote with Cookies:

If you have the ‘Number of Votes’ set to ‘One per image’ or the ‘One per gallery image is in’ for an image, the plugin stores the user’s IP when they vote, and won’t let anyone with that IP vote again. That can cause problems for when there are multiple users sharing a single IP address. After anyone of them votes, all the other users cannot.
You can now set the ‘Use Cookies to enforce single vote’ option for images. This will store a cookie on the users device with the details of their vote*. This will then be checked if they try vote again, instead of their IP, and give them a message that they have voted already**.


* The cookie is set to expire in 20 years in the future

** Please Note: It is possible for users to delete cookies from their devices. If they do this, they will be able to vote again. There is no fool proof way to stop users voting more than once.

Allow Daily/Weekly/Yearly Voting:

Version 1.5 introduces a new feature, allowing your users to vote repeatedly on your images if you want. You can allow user to vote once per day, once per week, or once per year. This option obviously only becomes available if you have either ‘Allow 1 vote per person for this image’ or the ‘Only allow 1 vote per person for this gallery’ option selected.
This feature will also work with the ‘Use cookies to enfore single vote’ option on or off.


Manually Add or Delete Votes:

From the ‘Manage Gallery’ screen in NGG, you can click on the ‘[num] votes cast’ link for each image to see more information about all the votes for that image.
This plugin now adds the ability to delete individual votes, permanently removing form the database.

You can also manually add votes for the image. This can be useful if you take an offline poll using good ‘ol pen and paper for example, and want to represent those votes on the site.
Only the ‘vote’ field is required to be captured. If you don’t choose a date, the current date will be assumed.


Edit Messages:

The add-on adds a new menu item under the “NGG Voting” admin section, labeled “Edit Messages”.


This option allows you to edit the messages your users see during the voting process. For instace, in the screenshot below, I have changed the ‘Like’ terminology to represent ‘Votes’ instead.


Voting Criteria:

The new ‘voting criteria’ feature allows you to split up the voting for your images, allowing you to get votes on multiple ‘criteria’. You first need to add the voting criteria you wish your users to vote on. Take note of each criteria’s ‘id’ when adding them, as you will need it later when outputting the criteria to your users.



Once you have added the criteria you want, you will see the voting options in NextGEN Gallery’s ‘Manage Gallery’ screen are tabbed, with the criteria you have setup. You can click between the tabs, setting the voting options completely independently of each other. The ‘Overall’ tab is the default criteria.


Once you have set which images you want to enable the specific criteria on, you need to alter the call that displays the voting form in the NextGEN Gallery template. When you originally installed the voting plugin, you would have added a simple ‘tag’ to a display template. See the FAQ for a reminder if you need.
You now need to include a tag for each criteria. So assuming you added ‘Color’ and ‘Composition’ criteria, with the IDs 1 and 2, as your criteria, you would now add the following in the display template:

Rate the following:<br />
Color: <?php echo nggv_imageVoteForm($image->pid, 1); ?><br /> <!-- Notice criteria ID: 1 -->
Composition: <?php echo nggv_imageVoteForm($image->pid, 2); ?><br /><!-- Notice criteria ID: 2 -->
Overall: <?php echo nggv_imageVoteForm($image->pid); ?><!-- No criteria ID needed for 'Overall' -->

Order Images by Results:

Please note: This feature does not work as expected if your images are not on a single page. Do not use this feature for paginated galleries.

If you want to order the images in the template by the voting results, you can call the nggv_orderImages() function. You need to add this tag to the top of the display template, before the images are ‘foreach’ looped through and outputted.

The default call to the function will re-order the images from hightest rated, to lowest rated, using the ‘overall’ criteria. :
<?php nggv_orderImages($images); ?>

You can change the order to lowest-to-highest (‘asc’), or highest-to-lowest (‘desc’), by adding a second argument, like this:
<?php nggv_orderImages($images, 'asc'); ?>

Images that have NO votes, will always show at the end of the list, regardless of the ordering you have specified. You can alter this functionality to show un-voted images ‘first’, or ‘last’, by adding a third argument:
<?php nggv_orderImages($images, 'asc', 'first'); ?>

Finally, all of the following ordering has been done with the default ‘Overall’ voting criteria. If you want to use a different criteria, you can specify its ID as the fourth argument, like this:
<?php nggv_orderImages($images, 'desc', 'last', 2); ?> <!-- Where 2 is the criteria ID you want to order by -->

To summarize, this is a list of the function arguments and defaults:

  1. $images – The array of images from NGG to order. Required!
  2. $order – string ‘asc’ or ‘desc’. The order to display the images in. Default ‘desc’
  3. $blank – string ‘last’ or ‘first’. Where to display images with NO votes. Default ‘last’
  4. $criteriaId – integer. The criteria ID to use when ordering result. Default 0.

Export Voting Results:

You can export all voting results in a CSV file, directly from the ‘Top Voted’ screen. The ‘Export’ button will export the list of voting results that match the filter options selected.

From version 1.5, you can not only export the image averages, but the actual individual votes that make up that average. You just need to select the ‘Individual Votes’ radio button before clicking the ‘Export’ button.


For ‘Averages’, the following fields will get exported

  • pid – The image ID in NextGEN Gallery
  • Criteria – The name of the Criteria
  • Gallery Name – The name of the gallery the image is in
  • Filename – The filename of the image
  • Avg / 10 – The average vote the image received out of 10. ‘Likes’ are represented by 100, ‘Dislikes’ by 0
  • Max / 10 – The maximum vote given to the image
  • Min / 10 – The minium vote given to the image
  • Number Votes – The number of votes the image received
  • Image URL – The full URL to the image

For ‘Individual Votes’, the following fields will get exported

  • pid – The image ID in NextGEN Gallery
  • Criteria – The name of the Criteria
  • Gallery Name – The name of the gallery the image is in
  • Filename – The filename of the image
  • Date – The date and time of the vote, in the format YYYY-MM-DD HH:MM:SS (eg 2013-06-09 11:04:24)
  • Username – The WP username of the person who cast the vote (if they were logged in at the time)
  • IP – The IP of the person when they cast the vote
  • Vote / 10 – The actual vote
  • Image URL – The full URL to the image


Top Voted Images Widget

As of version 1.3, there is a Widget that can show your highest or lowest voted images. Based closely on NextGEN Gallery’s own widget, you can choose how many images to show, if you want to use the cropped thumbnails or original dimension images, what galleries to pull the images from, and if you want the actual voting results to show with the images in the widget