Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Sort order of files on "Edit Files" screen  (Read 7554 times)

0 Members and 1 Guest are viewing this topic.

phil1011

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 12
Sort order of files on "Edit Files" screen
« on: June 07, 2010, 11:05:33 pm »

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?

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

phil1011

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 12
Re: Sort order of files on "Edit Files" screen
« Reply #2 on: June 08, 2010, 09:19:12 am »

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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Sort order of files on "Edit Files" screen
« Reply #3 on: June 08, 2010, 09:30:35 am »

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
Code: [Select]
   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.
Logged

phil1011

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 12
Re: Sort order of files on "Edit Files" screen
« Reply #4 on: June 08, 2010, 09:48:32 am »

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.
Logged

ThunderBoy

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
    • Photograph
Re: Sort order of files on "Edit Files" screen
« Reply #5 on: October 10, 2010, 04:26:42 pm »

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
Logged
I apologize for my english :)

hobert

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Sort order of files on "Edit Files" screen
« Reply #6 on: October 11, 2010, 08:24:13 pm »

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):
Code: [Select]
    $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*......
Logged

ThunderBoy

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
    • Photograph
Re: Sort order of files on "Edit Files" screen
« Reply #7 on: October 12, 2010, 08:53:27 am »

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
Logged
I apologize for my english :)

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Sort order of files on "Edit Files" screen
« Reply #8 on: October 12, 2010, 01:37:57 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).
Logged

phil1011

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 12
Re: Sort order of files on "Edit Files" screen
« Reply #9 on: October 24, 2010, 07:03:01 pm »

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."
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 19 queries.