开发者 | shauno |
---|---|
更新时间 | 2023年4月23日 15:48 |
捐献地址: | 去捐款 |
PHP版本: | 2.9.1 及以上 |
WordPress版本: | 4.0.1 |
wp-content/plugins/
directoryThis plugin adds options that can allow your users to vote on (more like rate) your Galleries and Images. There are options to limit which Gallery/Image to allow voting on, if the user needs to be registered and logged in, if they can vote more that once, and if they can see the current results.
You need to add a small tag to the gallery display template.
For image voting:
For image voting, add the following tag: <?php echo nggv_imageVoteForm($image->pid); ?>
, to the gallery display template.
For gallery voting:
For gallery voting, add the following tag: <?php echo nggv_galleryVoteForm($displayed_gallery, $gallery); ?>
, to the gallery display template.
For NGG 1.x, you can find the gallery templates in the /plugins/nextgen-gallery/view/
directory. For the default shortcode, [nggallery id=x]
, you
add the tag to the gallery.php
file. If you add the template
attribute to your shortcode, you need to alter the appropriate template. eg:
If you use the [nggallery id=x template="caption"]
, you need to add the tag to the gallery-caption.php
template.
For NGG version 2.x, you need to add the tag to the /nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php
template. This will only work for galleries inserted WITHOUT selectiong a template from the gallery display options.
NGG v2.x templating system can be confusing for some users. Please see this page for more info on which templates are used.
Please be aware, for image voting, the form needs to be placed inside the foreach()
loop in those templates, as that loop is outputting each image.
I find the best place to put the tag is AFTER the <div class="ngg-gallery-thumbnail">
is CLOSED.
For gallery voting, be sure to place the tag outside of the foreach, or it will show more than once on the page.
Absolutely. This plugin intentionally adds very little styling to the voting forms, but it does provide plenty of ids and classes allowing you to style it to fit in with your site.
Under the Gallery or Image options, the current average vote show along with how many votes have been cast. Click on the number of votes cast to view more info on those votes. You can also see more information on the voting results under the 'Top Voted' menu option.
[nggtags]
shortcode now, as well as with NGG option "The gallery will open the ImageBrowser instead the effect." on.get_bloginfo('url')
to get_admin_url()
for URLs in the backend, to help with WordPress installs in sub directories.