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?
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>';
}
Thanks Andre, that resolves it.