real_illusions Posted November 30, 2006 Share Posted November 30, 2006 Hi, i have a basic script for my gallery in my site (see siggie). However, i dont know php that well, to know how to change the script so the files and folders are listed in name order, and not in when they were last modified on the server as they are now.the script is from here http://winged.info/project/gallerythanks:) Link to comment Share on other sites More sharing options...
justsomeguy Posted November 30, 2006 Share Posted November 30, 2006 Open up the gallery.php file, and find this on line 86:$sorts[] = filemtime($fullpath);Change it to this:$sorts[] = $file; Link to comment Share on other sites More sharing options...
jlhaslip Posted November 30, 2006 Share Posted November 30, 2006 You would need to supply some code in order to get a more detailed answer, but essentially, when the software reads the filenames from the directory, store them in an array and sort the array by filename before it builds the presentation is one solution.*edit * looks like we were cross posting I like the previous answer better than mine. Link to comment Share on other sites More sharing options...
real_illusions Posted November 30, 2006 Author Share Posted November 30, 2006 thanks justsomeguy...but it goes z-a, not a-z Link to comment Share on other sites More sharing options...
justsomeguy Posted November 30, 2006 Share Posted November 30, 2006 OK, find line 90, which is this:array_multisort($sorts, SORT_DESC, $details['files']);And change it to this:array_multisort($sorts, SORT_ASC, $details['files']); Link to comment Share on other sites More sharing options...
real_illusions Posted November 30, 2006 Author Share Posted November 30, 2006 cool..thanks alot:) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now