Add "DateTime Original" below thumbnails Add "DateTime Original" below thumbnails
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Add "DateTime Original" below thumbnails

Started by kamad3, May 30, 2016, 04:18:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kamad3

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

Αndré

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?

kamad3

Title or filename would be perfect in that case.

Αndré

Open include/functions.inc.php, find
        if (!empty($row['title'])) {
            $caption .= '<span class="thumb_title thumb_title_title">' . $row['title'] . '</span>';
        }

and replace with
        $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>';
        }

kamad3