Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Caption below Latest Upload Thumbnails  (Read 3228 times)

0 Members and 1 Guest are viewing this topic.

roaftech

  • Coppermine novice
  • *
  • Country: ro
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • Romanian Aid Foundation
Caption below Latest Upload Thumbnails
« on: February 19, 2014, 08:46:37 pm »

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?
Logged
.
Steve Humphreys,
Help, Hope and Co-operation,
Asociatia Neemia, Dorohoi, Romania.
www.roaf.org/gallery

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Caption below Latest Upload Thumbnails
« Reply #1 on: February 28, 2014, 12:27:44 pm »

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.
Code: [Select]
        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
Code: [Select]
        if (in_array('user2', $must_have)) {
            $caption .= '<span class="thumb_caption thumb_caption_user2">' . $row['user2'] . '</span>';
        }
Logged

roaftech

  • Coppermine novice
  • *
  • Country: ro
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • Romanian Aid Foundation
Re: Caption below Latest Upload Thumbnails
« Reply #2 on: February 28, 2014, 07:05:42 pm »

Thanks Andre, that resolves it.
Logged
.
Steve Humphreys,
Help, Hope and Co-operation,
Asociatia Neemia, Dorohoi, Romania.
www.roaf.org/gallery
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.