We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    http://winged.info/project/gallery

    The file gallery.php in the download is what I need someone to look at. There’s one issue I’ve noticed with the script: When listing files & folders, it sorts them by the last upload. So let’s say I add images to an old folder --- it’ll now make that one the first in the list. I need to have it sort alphabetically.

    I don’t have money at the moment, but I will give permanent credit to the person in the "Credits" area on the website & the Gallery (to the right of the Symphonic Heaven copyright notice for the design).

    I don’t think this will be that bad of a "hack", since it’s only one file (AFAIK) that controls this.
      My Snippets
      -> PopUpChunk v1.0
      • 4310
      • 2,310 Posts
      I’ll look at it tomorrow if no-one else does in the meantime.
      I downloaded it the other day and had a quick test for one of my sites.
        • 33372
        • 1,611 Posts
        Just looking at it quickly (and not testing it or anything like that), I think you could just replace

        $sorts[] = filemtime($fullpath);
        with
        $sorts[] = $fullpath;

        to make it sort by the file name/directory instead of the created date, and if you want them to show A to Z instead of Z-A you’d also want to change

        array_multisort($sorts, SORT_DESC, $details[’files’]);
        to
        array_multisort($sorts, SORT_ASC, $details[’files’]);

        More info here.
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 28033
          • 925 Posts
          Quote from: ZAP at Mar 23, 2008, 08:46 PM

          Just looking at it quickly (and not testing it or anything like that), I think you could just replace

          $sorts[] = filemtime($fullpath);
          with
          $sorts[] = $fullpath;

          to make it sort by the file name/directory instead of the created date, and if you want them to show A to Z instead of Z-A you’d also want to change

          array_multisort($sorts, SORT_DESC, $details[’files’]);
          to
          array_multisort($sorts, SORT_ASC, $details[’files’]);

          More info here.

          ^.^ That worked perfectly, as far as I can see through some quick testing. And as promised, you were credited for fixing that (only Gallery ATM, till the next time I edit my website).

          BTW, bunk58, I figured out my own a few days ago how to remove the ellipses that occur w/ a folder/filename that is longer than 11 characters. Go to Line 73, and replace the line with this...

          $details['files'][$count]['THUMB'] = $file;
            My Snippets
            -> PopUpChunk v1.0
            • 33372
            • 1,611 Posts
            Thanks for the credit, but you didn’t have to do that. You’ve helped others out, and I’m more than happy to help you out whenever possible. I may have a question that you know the answer to next week!
              "Things are not what they appear to be; nor are they otherwise." - Buddha

              "Well, gee, Buddha - that wasn't very helpful..." - ZAP

              Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
              • 28033
              • 925 Posts
              Quote from: ZAP at Mar 24, 2008, 10:36 AM

              Thanks for the credit, but you didn’t have to do that. You’ve helped others out, and I’m more than happy to help you out whenever possible. I may have a question that you know the answer to next week!

              I wanted to. smiley It really helped me out. ^.^
                My Snippets
                -> PopUpChunk v1.0