reverse sorting of albums..001.jpg, 002.jpg etc

My pictures are all numbered. The latest additions have larger numbers. However if i sort by filename the photos are being displayed from old to new (001.jpg -> 999.jpg). Is there any way to reverse this? I am sure there is since I found some earlier solutions on this forum (but I don't think they work with the latest version). I have no programming skills myself so I was hpoing someone could help me out here.

Comments

  • Try this:

    Identify the file classes.php in the /zen folder. Find line 579:

    ksort($images);

    Change it to:

    krsort($images);

    Now if you sort by filename or title in the Admin Panel, the largest filename (or title) will be first.
  • Brilliant, works like a charm. Thanks
  • is there also an easy way to order the album the same way
  • There is a small problem , now I use krsort instead of ksort 'prev' en 'next' buttons work the other way around. I guess this is because the order hasn't been changed in the database. Any other way to fix this?
  • @bart

    1. I believe in the same file classes.php there is a ksort($album); which when changed to krsort($album); will reverse the existing order of your album folders. Play with it and see.

    2. Regarding the prev-next issue this has to be solved in the theme. A dirty way to do this for the default theme

    Find the file image.php (/themes/default/image.php).

    In it find the section: <div class="imgnav"> at line 24.

    Within the section replace two lines

    Replace line 26 which reads:
    <div class="imgprevious">" title="Previous Image">« prev</div>

    With:
    <div class="imgnext">" title="Next Image">next »</div>

    Replace line 28 which reads:
    <div class="imgnext">" title="Next Image">next »</div>

    With:
    <div class="imgprevious">" title="Previous Image">« prev</div>

    Don't change anything else and please backup your original files so you can revert easily.
  • @bart USE THIS INSTEAD

    1. I believe in the same file classes.php there is a ksort($album); which when changed to krsort($album); will reverse the existing order of your album folders. Play with it and see.

    2. Regarding the prev-next issue this has to be solved in the theme. A dirty way to do this for the default theme

    Find the file image.php (/themes/default/image.php).

    In it find the section: <div class="imgnav"> at line 24.

    Within the section replace two lines

    Replace line 26 which reads:
    '<div class="imgprevious">" title="Previous Image">« prev</div>'

    With:
    '<div class="imgnext">" title="Next Image">next »</div>'

    Replace line 28 which reads:
    '<div class="imgnext">" title="Next Image">next »</div>'

    With:
    '<div class="imgprevious">" title="Previous Image">« prev</div>'

    Don't change anything else and please backup your original files so you can revert easily.
  • @bart

    I always have trouble posting code on this forum since some characters do not show up. Send me your email and I will mail you the correct version.
  • Basically in the above use:

    &laquo; for &laquo
    &&raquo; for &raquo
  • Just send me the email
  • Thanks for your help jayray999 appreciate it. My email address: anangelheadedhipster at hotmail.com
Sign In or Register to comment.