nextgen-gallery-voting
-
Hello everybody,
I’m usin the nextgen-gallery-voting plug in on the website http://www.megakiddo.com
I created a gallery, and enabled voting for images. I don´t understand where the voting should show up. Can anybody tell me what i´m doing wrong / or what to do.
Thank you
-
FAQ, 3rd question down. You need to add a tag to the gallery template.
Thanks for your answer, but i can’t find where to do this. Do I need to edit nextgen-gallery-voting/ngg-voting.php ? I don’t understand what you mean with the gallery template
/views/gallery.php in the nextgen plugin folder by default
Appreciate the help Shauno, but really don’t even know where to look for that folder
Dude, seriously?
/wp-content/plugins/nextgen-gallery/view/Sorry, I’m not familiar with building websites, but need to for my boss you know :). I was looking in the vote plugin folder. Now i’ve opened the file. I’ve put the code in it. I get this error: Parse error: syntax error, unexpected ‘<‘ in /home/megakidd/public_html/wp-content/plugins/nextgen-gallery/view/gallery.php on line 38.
This is how it looks like:
<?php /** Template Page for the gallery overview Follow variables are useable : $gallery : Contain all about the gallery $images : Contain all images, path, title $pagination : Contain the pagination content You can check the content when you insert the tag <?php var_dump($variable) ?> If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?> **/ ?> <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?> <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>"> <?php if ($gallery->show_slideshow) { ?> <!-- Slideshow link --> <div class="slideshowlink"> <a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>"> <?php echo $gallery->slideshow_link_text ?> </a> </div> <?php } ?> <?php if ($gallery->show_piclens) { ?> <!-- Piclense link --> <div class="piclenselink"> <a class="piclenselink" href="<?php echo $gallery->piclens_link ?>"> <?php _e('[View with PicLens]','nggallery'); ?> </a> </div> <?php } ?> <?php echo nggv_imageVoteForm($image->pid); 131> <!-- Thumbnails --> <?php foreach ( $images as $image ) : ?> <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> > <div class="ngg-gallery-thumbnail" > <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> > <?php if ( !$image->hidden ) { ?> <img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> /> <?php } ?> </a> </div> </div> <?php if ( $image->hidden ) continue; ?> <?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?> <br style="clear: both" /> <?php } ?> <?php endforeach; ?> <!-- Pagination --> <?php echo $pagination ?> </div> <?php endif; ?>Can you please react to this last thing only please?
Firstly, you have pasted
<?php echo nggv_imageVoteForm($image->pid); 131>. That should be<?php echo nggv_imageVoteForm($image->pid); ?>. Note the last cople characters.Secondly, it needs to be INSIDE the foreach loop to display for each image.
Shauno, thanks for your patience, it finally works!
Hi Shauno,
I’m using the latest WordPress (3.4.1) and NextGEN (1.9.5) and this solution doesn’t seem to work. No matter where I add the line of code I still only get a voting form on the thumbnail page and not with each image.
Would appreciate if you could help.Adding the tag to the template will only show the voting on the thumbnails. The images popup by default in a dynamically rendered part of the DOM. I can’t inject the voting into there without changing core files in WP, and/or NGG.
Thanks but even with the thumbnails I only get one voting form. Should I reduce the number of thumbnails (I have 7) to make space for voting forms?
Pity about not being able to add to the popup but I can live with it working on thumbnails if I can get it right.What shortcode are you using to display the gallery, and what template are you adding the vote form tag to?
Sorry I’m not very good with code so I’m not total sure about the ‘template’. I’m using a theme called “Adventure” by Eric Schwarz and I have added your line of code into ‘view/gallery.php’ here
‘<?php if ($gallery->show_piclens) { ?>
<!– Piclense link –>
<div class=”piclenselink”>
piclens_link ?>”>
<?php _e(‘[View with PicLens]’,’nggallery’); ?>
</div>
<?php echo nggv_imageVoteForm($image->pid); ?>
<?php } ?>’Gallery shortcode is [nggallery ID =1] I will have 6 different galleries when finished.
Draft website is ‘barbet.web-sa.co.za’
You need to put the vote form tag in the loop that outputs the images. That loop starts on line 38, and ends on line 58 of gallery.php. Make sure to not put it in the
<a>tag (line 42 to 46).
I would suggest putting it after the.ngg-gallery-thumbnail-boxdiv closes (line 49).I have said pretty much this all already in this thread…
The topic ‘nextgen-gallery-voting’ is closed to new replies.