wordpress: photo galleries
Nextgen Gallery Voting
The Nextgen Gallery Voting plugin lets users rate galleries and photos. Like Nextgen Smooth Gallery, it integrates with NextGen photo management. You can either download an edited plugin with graphics that I have improved upon or you can download the original plugin from the WordPress site.
Set the Default Options
Once installed and activated, you'll see a new NGG Voting button in the side bar. Click it to set the default options.
You have the ability to allow voting on both galleries and individual photos. It's important to define your settings immediately because they will be applied only to new galleries. The settings are self-explanitory but in this case, we are only going to allow voting on individual photos because it requires extra work.
Create a new gallery
Create a new Nextgen gallery and call it voting. You'll notice that the same Voting Options have been added to this page and can be edited here. Leave them unchecked to use our defaults.
When that's done, upload some images and put them in the voting gallery.
Next, go to the Manage Gallery area and click on voting to edit it. Notice the voting options are also in the gallery settings and can be changed any time. Now take a look at the images. The image voting options are also available for editing.
Edit the Nextgen Gallery plugin
So here's where it gets a bit tricky. In order for voting on individual photos to work, we have to edit the NextGen plugin. Don't worry, this is pretty easy if you follow the steps.
Open the plugins menu on the sidebar and click the Editor button. You must be an admin and your server permissions must allow this. If you get a blank screen, you will have to edit the file via ftp.
On the top right there is a pulldown menu labeled "Select plugin to edit." Select Nextgen Gallery. A long list of files will show up on the right side of your screen.
Find the file named "nextgen-gallery/view/gallery.php" and click on it to edit. The resulting window should look like this:
Next, copy this line of php code. <?php echo $image->size ?>
Click inside the plugin code and select Edit menu -> Find in your browser, paste the code and search. Once you find it, look for the closing </a> tag that directly follows the php code. Put your cursor right after it and hit return.
Next, copy this bit of php code <?php echo nggv_imageVoteForm($image->pid); ?>
Paste it on the new line that you just created after the </a>. Click Update file and you're done.
Create a new post, call it voting test and save a draft. Add the Nextgen short code [nggallery id=4] then save and preview the post. You should be able to vote on each photo in the gallery.