e2interactive forums » Sample of (E)2 Photo Gallery

Search:

How to reverse image order?

(5 posts)

  1. corell
    Member

    Hi,

    I want to modify the script a little bit. It should display images in reverse order. I've got files named by numbers (001.jpg, 002.jpg, 003.jpg etc.) and want to display 003.jpg as first, instead of 001.jpg as it is now.

    Ayone?

    Posted 8 months ago #
  2. Do you want the images to show up in the order you uploaded them, latest first? or by file name?

    Posted 8 months ago #
  3. corell
    Member

    by file name

    Posted 8 months ago #
  4. Open up the getfolders.php file and find the following lines: 28, 93, 128

    sort($fileNames,SORT_STRING);

    and change it to:

    arsort($fileNames, SORT_NUMERIC);

    This will make it sort in reverse order numerically.

    Posted 8 months ago #
  5. corell
    Member

    strictly:

    array_multisort($fileNames,SORT_NUMERIC,SORT_DESC);

    but BIG thx for the tip. i just needed to find the place where to change it. oh, btw - great script!

    Posted 8 months ago #

RSS feed for this topic

Reply

You must log in to post.