Updating database Date Fields of When Images are Added Updating database Date Fields of When Images are Added
 

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

Updating database Date Fields of When Images are Added

Started by steveski, January 25, 2005, 02:11:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

steveski

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?

Nibbler

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

Joachim Müller

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

Joachim

steveski

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?

Joachim Müller

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

steveski

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