Advanced search  

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]

Pages: [1]   Go Down

Author Topic: sort by problem  (Read 3696 times)

0 Members and 1 Guest are viewing this topic.

maceo123

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
sort by problem
« on: October 14, 2008, 04:24:57 pm »

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
Logged

amitbhalerao

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: sort by problem
« Reply #1 on: October 14, 2008, 09:43:05 pm »

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

maceo123

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: sort by problem
« Reply #2 on: October 14, 2008, 11:07:51 pm »

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
Logged

midas

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
    • FantasyXtra.Com
Re: sort by problem
« Reply #3 on: October 15, 2008, 02:34:09 am »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: sort by problem
« Reply #4 on: October 15, 2008, 08:12:40 am »

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.

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

maceo123

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: sort by problem
« Reply #5 on: October 16, 2008, 08:29:29 pm »

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

Nibbler

  • Guest
Re: sort by problem
« Reply #6 on: October 16, 2008, 08:32:43 pm »

Try this:

include/functions.inc.php, find

Code: [Select]
'na' => 'filename ASC',
change to

Code: [Select]
'na' => 'filename + 0 ASC',
Logged

midas

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
    • FantasyXtra.Com
Re: sort by problem
« Reply #7 on: October 16, 2008, 10:40:18 pm »

Try this:

include/functions.inc.php, find

Code: [Select]
'na' => 'filename ASC',
change to

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

Nibbler

  • Guest
Re: sort by problem
« Reply #8 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.

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

midas

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
    • FantasyXtra.Com
Re: sort by problem
« Reply #9 on: October 17, 2008, 08:08:36 am »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: sort by problem
« Reply #10 on: October 17, 2008, 10:00:28 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
Logged

midas

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
    • FantasyXtra.Com
Re: sort by problem
« Reply #11 on: October 17, 2008, 12:09:28 pm »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.