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: Date added + sorting the pictures problem  (Read 5640 times)

0 Members and 1 Guest are viewing this topic.

mietp

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Date added + sorting the pictures problem
« on: September 21, 2004, 10:41:15 pm »

Hi,

This seems to be very noobish question, but I really dont know how to fix this. I have tried to search and read + read all the documents. Im loosing my nerves, because I have tried all tricks for several hours. Please some one help me.

I am trying to set up a new gallery with 4 albums in it. I have taken pictures with my camera for past two years and I would like them to show in the gallery by the shoot day. I have changed both mtime and ctime in the db to correspond the shooting date. By doing this I can make ' Date added'  to print exactly the way I want.

The problem, however, is that when I try to sort the pictures by date, the album shows first the picture that is taken 24 th of aug, second the picture that is taken 21th of sep, 3rd the picture that is taken 24 th of aug and 4th the picture that is taken 21th sep. Why is this happening? Please see this link to my album, to get the idea:  http://www.pisara.net/cpg1.2.0final/thumbnails.php?album=4

What is the right way to make a new gallery with old pictures and change the date added times so that they print right and the sorting works, too? All the files are uploaded to the server today. But db shows the right shooting days both in mtime and in ctime.

Sorry for my bad English.
« Last Edit: September 22, 2004, 08:02:23 pm by TranzNDance »
Logged

Nibbler

  • Guest
Re: Date added + sorting the pictures problem
« Reply #1 on: September 21, 2004, 10:53:40 pm »

Sorting by date ascending is actually implemented by sorting by the 'pid' ascending, so it is in fact going to be ordered by upload date. Try this:

functions.inc.php

Code: [Select]
$sort_array = array('na' => 'filename ASC', 'nd' => 'filename DESC', 'ta'=>'title ASC', 'td'=>'title DESC', 'da' => 'pid ASC', 'dd' => 'pid DESC');
       

switch to

Code: [Select]
$sort_array = array('na' => 'filename ASC', 'nd' => 'filename DESC', 'ta'=>'title ASC', 'td'=>'title DESC', 'da' => 'ctime ASC', 'dd' => 'ctime' DESC');
       

I haven't tested it though.
Logged

mietp

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Date added + sorting the pictures problem
« Reply #2 on: September 21, 2004, 10:59:04 pm »

Sorting by date ascending is actually implemented by sorting by the 'pid' ascending, so it is in fact going to be ordered by upload date. Try this:

Thanks for the quick reply.

Do you mean that the date is goming from the file (ftp) server, not from the db? If its so, is there a way to change files timestamp at the unix shell instead of changing the code?
Logged

mietp

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Date added + sorting the pictures problem
« Reply #3 on: September 21, 2004, 11:00:58 pm »

Sorry. Now I see what you meant. Theres a 'pid' value in the db. I try to change the code as you told.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Date added + sorting the pictures problem
« Reply #4 on: September 21, 2004, 11:10:27 pm »

You are using a very out of date version of coppermine.  I suggest you update to version 1.3.2.

There are many reasons to do this, many improvements and bug fixes, but another one for you, if your pictures have exif info, is that there is a mod to sort by exif date.

Updating is very easy, just download the zip file from the downloads section, unzip it, then replace all the files on your server with the new ones.  Simple as that.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

mietp

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Date added + sorting the pictures problem
« Reply #5 on: September 21, 2004, 11:54:29 pm »

You are using a very out of date version of coppermine.  I suggest you update to version 1.3.2.

There are many reasons to do this, many improvements and bug fixes, but another one for you, if your pictures have exif info, is that there is a mod to sort by exif date.

Updating is very easy, just download the zip file from the downloads section, unzip it, then replace all the files on your server with the new ones.  Simple as that.

Well.. I updated it and I couldnt access my site anymore. Its not lots of work to do, because I havent done that many changes yet. Now its the newest version then. Batch add files seems not to work? It just says that I have to choose a folder, but theres no way to choose any... Is this a bug or Im I missing some setting here?

Ill have to look that mod out.

Thanks
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Date added + sorting the pictures problem
« Reply #6 on: September 21, 2004, 11:59:33 pm »

The problem is that you put the photos in userpics. Before v1.3, users were able to get away with it, but 1.3 enforces the rule by preventing the folder from showing up in the batch upload listing. Upload photos in to folders in albums, but not in userpics.
Logged

mietp

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Date added + sorting the pictures problem
« Reply #7 on: September 22, 2004, 12:07:53 am »

The problem is that you put the photos in userpics. Before v1.3, users were able to get away with it, but 1.3 enforces the rule by preventing the folder from showing up in the batch upload listing. Upload photos in to folders in albums, but not in userpics.

WoW! It did the trick. Now it works. Have you any good tips how I could sort the pictures with date coming from the exif data?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Date added + sorting the pictures problem
« Reply #8 on: September 22, 2004, 12:15:45 am »

I'm glad that part worked.

As Casper had written, there is a mod to sort by EXIF date. Please do a search.
Logged

mietp

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Date added + sorting the pictures problem
« Reply #9 on: September 22, 2004, 07:28:05 pm »

Thanks for the all advices I have gotten this far. You are great!

I did as Nibbler told me and now my albums works very smootly and just the way I want to. Great advice.

So, I did change all the ctimes on the DB and now ' Date added'  shows the right date and because of the script editing, sorting by date works too.

Theres only one problem left. Main pages ' Last Additions' shows wrong pictures. Where can I change to sort these pictures by ctime?
Logged

Nibbler

  • Guest
Re: Date added + sorting the pictures problem
« Reply #10 on: September 22, 2004, 07:45:57 pm »

Similar idea, functions.inc.php

Code: [Select]
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY pid DESC $limit");
change the ORDER BY from pid DESC to ctime DESC
Logged

mietp

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Date added + sorting the pictures problem
« Reply #11 on: September 22, 2004, 07:59:07 pm »

WoW  ;D

Thank you VEEEERY much. Im so happy that it finally works. Thanks for helping me out. I knew that the line was somewhere, but it had taken ages for me to find the right one.

This case is solved and the thread can be locked.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 18 queries.