Reverse Gallery order

currently i have all of my images names in the following manner: 00001.jpg, 00002.jpg etc

the lower the number, the older the image.

in an effort to make newer images load at the top of the gallery, i need to reverse the order display order of the directory.

any idea how to automate this? have over 1400 photos in multiple galleries.. so manually doing it is out of the question right now.

thanks for the help guys.

Comments

  • Figured it out after pulling out some hair..

    for future reference. reversing sort order can be resolved easily by end users..

    back up your Classes.php file.
    open classes
    search for:

    // Store the result so we don't have to traverse the dir again.

    comment out the following data by adding // to the beginning of each affected line:

    // Sort the images array
    $images = $this->sortImageArray($images, $this->getSortType());
    // Store the result so we don't have to traverse the dir again.
    $this->images = $images;

    below commented information add the following lines:

    //This will reverse images sorting order
    $images = array_reverse($images);
    $this->images = $images;

    you can do the same thing with albums by changing $images to $albums and replacing the appropriate lines in your classes.php

    THANKS!

    (anyone know if the Wiki will be fixed soon?)
  • I solved it another way:

    1. in admin.php replace the line
    `$sortby = array('Filename', 'Title', 'Manual');

    by

    ``$sortby = array('Filename', 'Title', 'Manual', 'Reverse-Filename' );`

    2. in classes.php in the function sortImageArray, add this code:
    `if ($key == "Reverse-Filename") {

    $newImageArray = array_reverse($newImageArray);

    }

    `
    this must be placed after this line:
    `uksort($newImageArray, "strnatcasecmp");`

    I recently started using ZenPhoto and I really like it. A few things I miss though: show exif data, sort by exif date, reverse sorting for every sorting method, and view count, but I guess these are things which are being worked on.

    And automatic resizing during upload would be nice (I don't have enough webspace for 2mb jpegs, would be cool if zenphoto could downsize them automatically)
    cheers
    -lev
  • hi, on the zenPhoto 1.0.8.2 (Beta) this code find at line 124 (function getImages) in class-album.php.
    Sorry my english came from Jujuy-Argentina :(
Sign In or Register to comment.