Announcement

#1 2017-05-21 14:52:36

OliverB
Member
2017-05-05
29

Precede IPTC Caption with date

Hi,

how can I precede the image description (in the tooltip and/or under the image) with the date of the image?

IOW if the caption is "Me at home" and the image date / time is now, I would like to have a description "2017-05-21: Me at home".

TIA,

Oliver

Piwigo version: 2.9.0

Offline

 

#2 2017-05-28 16:35:33

OliverB
Member
2017-05-05
29

Re: Precede IPTC Caption with date

this seems to be more complicated than I expected.

In the mean, I found the render_element_description trigger but I can't get easily the creation date in the handler. I would need another data base query, correct?

Is there a cleaner way?

Offline

 

#3 2017-05-28 17:56:45

OliverB
Member
2017-05-05
29

Re: Precede IPTC Caption with date

not complicated:

Code:

add_event_handler('picture_pictures_data', 'adddate_picture_pictures_data');
function adddate_picture_pictures_data($picture) {
  $picture['current']['comment'] = substr($picture['current']['date_creation'],0,10) . ': ' . $picture['current']['comment'];
  return $picture;
}

the extraction of the date could be made cleaner, but image.php uses the same.

Oliver

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact