Random sort order

Hi,

is it possible to do a random sort order for search-pages? Or can i switch the sort order in some way when the page is loaded - like sometimes ordered descending and sometimes ascending?

Maybe you know a way how to do this?

Comments

  • does nobody know how to do this? maybe you have a hint or something?
  • I am looking for the same thing.. This option is still missing from the selection in the backend as a sortorder choice.. It would then require to add 'ORDER BY RAND()' to the SQL used to retrieve the albums/images.

    I really suggest that to be added in later versions..

    However my alternative idea is to shuffle the object array before display.
    for that I use a 2D shuffle function from here:
    http://php.net/manual/en/function.shuffle.php

    $shuffled_subalbum = twodshuffle($_zp_current_album->getSubalbums());

    works fine, but what I would need help with now is how to 'overwrite' the original
    $_zp_current_album[subalbums] with the new array from above in the album object so that
    the next_album loop then displays them

    Can someone help with that ?

    something like :

    $_zp_current_album['subalbums'] = $shuffled_subalbum ???

    Thanks again / breglis
  • There would really be no way to "order by hand" the results of a search since these results do not exist except as the result of the search.

    It would be possible to do two things:

    1. add "random" as a sort order
    2. provide an option that is used for the order of searches. (Currently it uses the gallery default.)

    But, there is a method for making featrue suggestions. Please read the forum posting rules.
Sign In or Register to comment.