Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Add "DateTime Original" below thumbnails  (Read 1595 times)

0 Members and 1 Guest are viewing this topic.

kamad3

  • Coppermine newbie
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 10
Add "DateTime Original" below thumbnails
« on: May 30, 2016, 04:18:57 PM »

Hi!

I have a problem which I couldn't solve and I haven't find any solution in the forum. I just want to display the "DateTime Original" EXIF value below the thumbnails instead of the filename. It would be a plus feature, if I could sort them based on that time.

Thanks in advance,
Adam
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15384
Re: Add "DateTime Original" below thumbnails
« Reply #1 on: June 07, 2016, 10:42:18 AM »

What do you want to display if there's no EXIF timestamp (for whatever reason)? Nothing? Or should the title be displayed in that case?
Logged

kamad3

  • Coppermine newbie
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 10
Re: Add "DateTime Original" below thumbnails
« Reply #2 on: June 07, 2016, 10:44:46 AM »

Title or filename would be perfect in that case.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15384
Re: Add "DateTime Original" below thumbnails
« Reply #3 on: June 07, 2016, 12:25:11 PM »

Open include/functions.inc.php, find
Code: [Select]
        if (!empty($row['title'])) {
            $caption .= '<span class="thumb_title thumb_title_title">' . $row['title'] . '</span>';
        }
and replace with
Code: [Select]
        $exif = array();
        $exif = unserialize(cpg_db_result(cpg_db_query("SELECT exifData FROM {$CONFIG['TABLE_EXIF']} WHERE pid = {$row['pid']}")));
        if ($exif['DateTimeOriginal']) {
            $caption .= '<span class="thumb_title thumb_title_title">' . $exif['DateTimeOriginal'] . '</span>';
        } elseif (!empty($row['title'])) {
            $caption .= '<span class="thumb_title thumb_title_title">' . $row['title'] . '</span>';
        }
Logged

kamad3

  • Coppermine newbie
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 10
Re: Add "DateTime Original" below thumbnails
« Reply #4 on: June 07, 2016, 12:37:31 PM »

Thank you very much!
Logged
Pages: [1]   Go Up
 

Page created in 0.066 seconds with 20 queries.