Sort order of files on "Edit Files" screen Sort order of files on "Edit Files" screen
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Sort order of files on "Edit Files" screen

Started by phil1011, June 07, 2010, 11:05:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

phil1011

Hello,

I'm using 1.5.4. When I click on the "Edit Files" button on the album or thumbnail page, the order of the images appearing on the Edit Files screen does not seem to be in any strict order. At first glance, it looks like descending order according the file name. But it's not. It jumps back and forth.

For example, my file names could be 001-IMG_4500.jpg, 002-IMG_4510.jpg, 003-IMG_4513.jpg, 004-IMG_4520.jpg.

But on the Edit Files screen, they appear from top to bottom something like in this order: 004-IMG_4520.jpg, 003-IMG_4513.jpg, 001-IMG_4500.jpg, 002-IMG_4510.jpg.

Weird. With 1.4x, they always appeared in ascending order according to file name from top to bottom. This is what I want. Any fix for this?


Joachim Müller


phil1011

This is my site:
http://photoguide.jp/pix/index.php?cat=50

To the user, it looks fine. The images are in ascending order in the albums.

But it's a mess on the Edit Files form where I want to enter the title/description in ascending order.

Joachim Müller

The sort order is by PID (picture ID), i.e. it is sorted in the order your files were added to the album you're in. I'm not sure that this differs from cpg1.4.x in that aspect. If I remember it correctly, the foreach loop    foreach ($pid_array as $pid) {in editpics.php is the one you need to change if this bother you. You'll have to re-sort the array $pid_array to accomplish what you're up to if I remember this correctly from the back of my head.
You should upgrade btw, as cpg1.5.6 has been released.

phil1011

I always upload my images via FTP and use Batch Add. I don't use Coppermine's Upload function. I did this with 1.4x and the files on the Edit Files form was always in ascending order according to the file name, exactly the same order they appear in the album.

I usually upload anywhere from 30 to 250 images in one batch to a single album.

ThunderBoy

I have the same problem!

Also need to give me all the files in a directory advise ascending, not by pid.  >:(

Files must be in ascending order, because all the names i have written in Excel by numbers picture. When you insert the names of the gallery, so i always look pretty, so i assign them properly, which made me terribly resides.

Can this be changed somehow?  :P
I apologize for my english :)

hobert

Found it!!!

This has bothered me too.  If you'll look in your editpics.php file, you will see the following code toward the bottom (search for p.pid DESC):
    $sql = "SELECT p.*,a.category FROM {$CONFIG['TABLE_PICTURES']} as p " .
            " INNER JOIN {$CONFIG['TABLE_ALBUMS']} as a " .
            " ON a.aid = p.aid " .
            " WHERE p.aid = '$album_id' $owner_str" .
            " ORDER BY p.pid DESC LIMIT $start, $count";


Change "p.pid DESC" to "p.filename" should sort your edit pics into your desired order (as 1.4 used to sort).  If you would like your pics in another order when editing, this would be where you  set that.

I can see where having the newest files appearing first would make sense -- older ones would have most likely already been "fixed" if needed.  I just know finding a file (or several) to edit is easier if they are in some type of order.  Of course, if someday there was some type of sort order mechanism like thumbnail views had, that would be *wonderful*......

ThunderBoy

Hey, that code for a long time ago i watched and tried to change but it ranks as by pid, the changes do not help.

Sorting by pid is not good. If it was a few files, so i do not mind, but when they are thousands, so it is something terrible when writing names.  :-\
Super would be to shift the files could be set somewhere.
In short, when i want to edit some files in the album by any means, so i must sort them by serial numbers file.  :D
I apologize for my english :)

Αndré

Quote from: hobert on October 11, 2010, 08:24:13 PM
if someday there was some type of sort order mechanism like thumbnail views had, that would be *wonderful*......
Please post your suggestion on the feature requests board (with a link to this topic).

phil1011

It works! Thank you hobert for the code. For those of us who write a lot of captions especially in a photo essay style, it really helps when the images are in a predictable order on the Edit files screen.

Thanks a lot. This topic should marked as "Resolved."