forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: kamad3 on May 30, 2016, 04:18:57 pm

Title: Add "DateTime Original" below thumbnails
Post by: kamad3 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
Title: Re: Add "DateTime Original" below thumbnails
Post by: Αndré 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?
Title: Re: Add "DateTime Original" below thumbnails
Post by: kamad3 on June 07, 2016, 10:44:46 am
Title or filename would be perfect in that case.
Title: Re: Add "DateTime Original" below thumbnails
Post by: Αndré 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>';
        }
Title: Re: Add "DateTime Original" below thumbnails
Post by: kamad3 on June 07, 2016, 12:37:31 pm
Thank you very much!