Caption below Latest Upload Thumbnails Caption below Latest Upload Thumbnails
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Caption below Latest Upload Thumbnails

Started by roaftech, February 19, 2014, 08:46:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

roaftech

I want to change the default caption below the 'Latest Uploads' thumbnails, to remove the upload date and replace it with the photo taken date and time which I record as the 'user2' optional variable.
I have found a partial answer at
http://forum.coppermine-gallery.net/index.php/topic,74575.msg359032.html
13/Mar/2012
snip ...
Open include/functions.inc.php, find
Code: [Select]
        if ($set_caption) {
            build_caption($rowset, array('ctime'));
        }
        $rowset = CPGPluginAPI::filter('thumb_caption_lastup', $rowset);
and replace with
Code: [Select]
        if ($set_caption) {
            build_caption($rowset);
        }
        $rowset = CPGPluginAPI::filter('thumb_caption_lastup', $rowset);

...snip
which removes the upload date satisfactorily.

I have attempted to substitute 'user2' in place of 'ctime' but nothing appears in the captions.  I have had a look into the sql database tables and confirmed that the field exists, is correctly named and does contain data.  If I use 'mtime' instead I get a date in 1970 (presumably the date zero in the operating system?) and so I conclude that the problem is in the way the 'ctime' is decoded. 
Any advice?
.
Steve Humphreys,
Help, Hope and Co-operation,
Asociatia Neemia, Dorohoi, Romania.
www.roaf.org/gallery

ΑndrĂ©

Please have a closer look at the function build_caption in include/functions.inc.php.

It contains several lines to know how to deal with submitted parameters, e.g.
        if (in_array('ctime', $must_have)) {
            $caption .= '<span class="thumb_caption thumb_caption_ctime">' . localised_date($row['ctime'], $lang_date['lastup']) . '</span>';
        }

so you need to add an additional block like
        if (in_array('user2', $must_have)) {
            $caption .= '<span class="thumb_caption thumb_caption_user2">' . $row['user2'] . '</span>';
        }

roaftech

.
Steve Humphreys,
Help, Hope and Co-operation,
Asociatia Neemia, Dorohoi, Romania.
www.roaf.org/gallery