WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery Voting
[resolved] sort order (12 posts)

  1. fmonserrate
    Member
    Posted 1 year ago #

    Hello,

    There is any way to get a link / dropdown to sort "most voted" and/or "latest images"?

    Best Regards

    http://wordpress.org/extend/plugins/nextgen-gallery-voting/

  2. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    Hi fmonserrate

    Are you talking about the widget, or the just the normal gallery view?

  3. fmonserrate
    Member
    Posted 1 year ago #

    Hello Shauno,

    Thanks for your reply

    I talk about normal gallery view.

    Best Regards

  4. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    You can use the call <?php nggv_orderImages($images); ?> call at the top of the gallery template to order the image if you are using the Premium add-on.
    See my site for more info on the options you can set.

  5. fmonserrate
    Member
    Posted 1 year ago #

    Hi Shauno,

    I try insert the call but i canĀ“t put that working well.
    If i put the call on top like this:
    <a href="<?php nggv_orderImages($images); ?>">Most Voted</a>
    All pictures always will be sorted by "most voted" criterion. (not need click in link).

    I need pictures sorted by default with "most recent" and 2 links with "Most Voted" and "less Voted"

    There are any way to get this ?

    Best regards

  6. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    That is a little outside of the scope of what the plugin does, but I've hacked some code up for you that should work. Add this at the top of the gallery.php file:

    <div class="order-links">
    	<?php
    	if($_GET['nggv-order'] == 'desc') {
    		nggv_orderImages($images, 'desc', 'last');
    	}else if($_GET['nggv-order'] == 'asc') {
    		nggv_orderImages($images, 'asc', 'first');
    	}
    	$pageUrl = get_permalink($ID);
    	if(strpos($pageUrl, '?') !== false) {
    		$pageUrl .= '&';
    	}else{
    		$pageUrl .= '?';
    	}
    	?>
    	<a href="<?php echo $pageUrl ?>">Default</a>
    	<a href="<?php echo $pageUrl ?>nggv-order=desc">Hightest Rated</a>
    	<a href="<?php echo $pageUrl ?>nggv-order=asc">Lowest Rated</a>
    </div>

    The 'Default' ordering can be tweaked using custom fields. You can read up on how NGG uses those on their site here.

  7. fmonserrate
    Member
    Posted 1 year ago #

    Hi shauno!

    You are a amazing! :)

    It was really what I needed!THANK YOU!

    and Thanks for this GREAT SUPPORT!

  8. fmonserrate
    Member
    Posted 1 year ago #

    I think "default" option = "Most Recent Images", right?
    Is it possible get "Oldest Images" too?

    I mean sort by Date.

    Only missing link for "Oldest Images", because "default" already get "Most Recent"
    This is possible?

    Best Regards

  9. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    The default just shows the list as it normally would. You can alter the order of that list with the custom fields I linked to in my last post, but I don't know how to make that dynamic and changeable with a link, sorry.

  10. fmonserrate
    Member
    Posted 1 year ago #

    Hello,

    I saw now, there is a new version (2.4). If I do the update I will lose all the changes I've made?

    Best Regards

  11. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    Hi fmonserrate

    You won't lose this change if you update NGG Voting, as this file is part of NGG. You will lose it if you update NGG though.

    If you want, you can move all the templates inside NGG's 'view' directory, to a new directory named 'nggallery' inside your theme. NGG will then load them from there, and they won't be overwritten when you do need to update NGG.

    Let me know if there are any more question :)

  12. fmonserrate
    Member
    Posted 1 year ago #

    Hello!

    Thank's for your reply.

    As usual a great support here...:)

    Best Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.