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: Updating database Date Fields of When Images are Added  (Read 3059 times)

0 Members and 1 Guest are viewing this topic.

steveski

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Updating database Date Fields of When Images are Added
« on: January 25, 2005, 02:11:46 pm »

I am migrating thousands of images to our CPG installation.  The timestamps on images and albums (when added) is, of course, the current date and time.  Since each album is actually photos from a specific event that took place in the past, I would like the date to reflect when the event occurred.  This will naturally happen for all future events, since the images will be added right after the event.  However, for the import of the past 7 years of images, the date is not as desired.

What table/fields should be changed to correct this, and can I do it via mySQL admin and not cause CPG to get damaged or behave badly?
Logged

Nibbler

  • Guest
Re: Updating database Date Fields of When Images are Added
« Reply #1 on: January 25, 2005, 07:54:04 pm »

You would change the 'ctime' in the pictures table, you'll also need to be able to convert to a unix timestamp for that.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Updating database Date Fields of When Images are Added
« Reply #2 on: January 26, 2005, 09:09:05 am »

I rather recommend using a custom user field to hold the date and time though.

Joachim
Logged

steveski

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Updating database Date Fields of When Images are Added
« Reply #3 on: January 26, 2005, 03:30:19 pm »

If using a custom field, wouldn't that have to be updated manually for each image when batch importing, and then also make mods to the scripts to show the date - where today the ctime is shown?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Updating database Date Fields of When Images are Added
« Reply #4 on: January 26, 2005, 05:07:30 pm »

Yes, when using a custom field the drawback is you manually have to fill it. The disadvantage of using a field that is meant to be used for coppermine's internal purposes is that you risk losing data when updating. The user field can be filled running a query (e.g. in phpMyAdmin) though - works great if all pics you have in a particular album are meant to have the same date (that's the way I use it).
Either way, your choice: both methods will work.

Joachim
Logged

steveski

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Updating database Date Fields of When Images are Added
« Reply #5 on: January 26, 2005, 10:04:26 pm »

Thanks - I'll give it a try on one album and see what happens.  This is only for past events that I've imported, so once complete, I won't have to ever do it again.........
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.