sort by problem sort by problem
 

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 by problem

Started by maceo123, October 14, 2008, 04:24:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

maceo123

i searched here and in google and didnt find soultion

my gallert is sorting by name but the files name are numbers
the problem is that is sorting only by the first number and i get this order

2567 301 302 302 4500

i want it
301 302 2567 4500

how?

thanks in advance

amitbhalerao

Most commonly, the filenames(or any other names) are "strings" and are stored with datatype VARCHAR in database tables.

So the order you are getting is absolutely correct.

There is no need to change the coppermine code to consider the string as integers if you use numbers for filename.
Instead you should use proper filenames.

maceo123

please i ask for a soultion for my problem
im sure its very easy to change

why i need change names of 30,000 pictures?
and order numbers?
please i just one soultion change pictures name is not a soultion

midas

I have the same problem.

I have thousands of photos to sort (spread over different albums).  Each photo is entitled with a number (which is how they should be) but I have to re-sort my photos everytime I upload a batch.  This wouldn't be too much of a problem except I'm getting repetitive strain syndrome in my index fingers  :D  My questions are:

1, Can I sort them by manually changing the database? And,

2, In the sort field, is there a way to select several photos together so that I can reposition them as a group?

The bit that puzzles me is that my files are numbered something like "album number_photo number".  The album number prefix is constant for an album and the photo number is unique within the album.  When coppermine organizes my photos it seems to totally disregard the photo number.  For example:

100001_1
100001_2
100001_3
100001_4
100001_5

Gets ordered as

100001_1
100001_4
100001_3
100001_5
100001_2

Why does Coppermine ignore the photo number?  Is there hidden meta data in photos that it reads and uses to order them?

Joachim Müller

Come up with a naming scheme for your files that will work then. Computers are stupid folks - they treat file names as strings, not as numbers, simply because they are strings. Hence, a file named 10.jpg will come before a file named 9.jpg. There's only one remedy to this, as I suggested before: rename your files brightly before uploading them - there are many tools (I can recommend 1-4a rename) that allow you to come up with a naming scheme that makes sense: if you plan to add a maximum of 999 pics to an album, coming up with a naming scheme like 001.jpg, 002.jpg will be fine. If you're not sure, start with some more leading zeros - start with 000001.jpg, which will alow you to add nearly a million files to one album (999,999 to be exact). That should be more than enough, as it doesn't make sense to store a million files in one album.

Quote from: midas on October 15, 2008, 02:34:09 AM
When coppermine organizes my photos it seems to totally disregard the photo number.  For example:

100001_1
100001_2
100001_3
100001_4
100001_5

Gets ordered as

100001_1
100001_4
100001_3
100001_5
100001_2

Why does Coppermine ignore the photo number?  Is there hidden meta data in photos that it reads and uses to order them?
It doesn't: you must have applied a custom sorting pattern that get's stored in a cookie and overrides the standard sort. Clear your cookies, then try again. If this doesn't work for you, then post a deep link to an example where you claim that this is happening.

maceo123

you are serious?! you want me to change all file name?
this must be simple soultion to this
chane name of files is chagning the files and not chaning the system
but in this thing! the system isnt working fine and i sure that thare is soultion to this
its not need to be so hard to a programer.

Nibbler

Try this:

include/functions.inc.php, find

'na' => 'filename ASC',

change to

'na' => 'filename + 0 ASC',

midas

Quote from: Nibbler on October 16, 2008, 08:32:43 PM
Try this:

include/functions.inc.php, find

'na' => 'filename ASC',

change to

'na' => 'filename + 0 ASC',


Nibler, thank you but what effect will that change have?  Will it alter the sort positions (or displayed organisation) of those files already arranged as required?

Nibbler

It's only temporary, if it doesn't work you can remove it. I don't think your issue is the same as the original poster's anyway so it probably won't work.

Do as Joachim suggests.

Quote from: Joachim Müller on October 15, 2008, 08:12:40 AM
Clear your cookies, then try again. If this doesn't work for you, then post a deep link to an example where you claim that this is happening.

midas

Quote from: Nibbler on October 16, 2008, 10:42:46 PM
It's only temporary, if it doesn't work you can remove it. I don't think your issue is the same as the original poster's anyway so it probably won't work.

Do as Joachim suggests.


I'm not sure what you mean by "deep link."  But if by "cookies" you mean my browser's cookies then I clean them after every session; and I don't always sort my files the same session I upload them.

I've played with the file sort by settings but they never display as expected by their titles.  If you wish, I'll create a temporary user account with privileges for you to play with the settings (I trust you enough!!!)  My only request is that you don't upset my software or unsettle my already organized files.

Joachim Müller

Quote from: midas on October 17, 2008, 08:08:36 AM
I'm not sure what you mean by "deep link."
What's so hard to understand about that? Post a link to your gallery, for Christ's sake. See http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616

midas

By "deep link" I inferred you required a link to a specific part of my gallery's directory structure.  Had you said "link" (without an adjective) then I might have understood, without the implied ambiguity, that you meant a link to my gallery's main page which is accessible from my website's front (content-restricted-to-over-18's restriction stipulation) page, clicking "Yes" then clicking "gallery" from my forum's menu.  Incidentally, my profile has a little globe image on it, it links to my website's front page.

The direct link to my gallery is: ADULT CONTENT: to click on this link you must be at least 18 years old and legally entitled and personally willing to view and interact with adult themed material (nudity and cursing inclusive).

I always search for solutions before I ask for support.  Had I had an alternative to requesting support from a user forum then I would have near expired that resource first.  It's just coincidence that another Coppermine user has the same problem as me at this time (which I discovered by searching for a solution).

Also, I can't relabel the files because I'm under contract to not do so.

And, your help is appreciated but preferred when polite.