forum.coppermine-gallery.net

Support => cpg1.6.x Support => cpg1.6 miscellaneous => Topic started by: sharpo on November 01, 2023, 07:19:09 pm

Title: Date added for image files not showing correctly
Post by: sharpo on November 01, 2023, 07:19:09 pm
I've searched and found a topic which referred to a problem with Spanish language but mine has always been english GB.

Date added:   %037 %05, %2008 format showing in file information

Above is how the date appears. I've not done anything to try and change it from original settings, not sure when the format changed as it is an old gallery which I stopped updating years ago. It is running 1.6.22 and php is 7.4

Gallery is:- http://www.sharpos-world.co.uk/kc/

Thanks for any help to solve the problem.
Title: Re: Date added for image files not showing correctly
Post by: 406man on November 02, 2023, 01:18:49 pm
I ran into the same problem in my gallery which also uses English GB. Coppermine displayed date formats are defined in the language files in the \lang directory.  The formats changed in PHP relatively recently and potentially need an accompanying change in the language file.

My guess is that your english_gb.php file contains date formats that look like:
$lang_date['album'] = '%B %d, %Y';

Due to the PHP change they should be:
$lang_date['album'] = 'F d, Y';

You could update the definitions in your english_gb.php but, unless you’ve customised yours, I think it’s better to delete them as Coppermine will then pick up the definitions supplied in the english.php file as part of the standard distribution.

Goes without saying that if you update your english_gb.php file keep a backup copy in case the editing goes wrong.
Title: Re: Date added for image files not showing correctly
Post by: sharpo on November 02, 2023, 02:47:21 pm
Thanks for reply 406man.

I've checked the gallery with the problem, and another that displays the date correctly, but all parameters appear to be the same.

The problem one is as below:-


if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// info about translators and translated language
$lang_translation_info['lang_name_english'] = 'English (British)';
$lang_translation_info['lang_name_native'] = 'English (British)';
$lang_translation_info['lang_country_code'] = 'en_gb';
$lang_translation_info['trans_name'] = 'Nibbler';
$lang_translation_info['trans_email'] = 'nibbler@coppermine-gallery.net';
$lang_translation_info['trans_website'] = 'http://coppermine-gallery.net/';
$lang_translation_info['trans_date'] = '2009-07-11';

// The various date formats
// See http://www.php.net/manual/en/function.strftime.php to define the variable below
$lang_date['album'] = '%B %d, %Y';
$lang_date['lastcom'] = '%m/%d/%y at %H:%M';
$lang_date['lastup'] = '%B %d, %Y';
$lang_date['register'] = '%B %d, %Y';
$lang_date['lasthit'] = '%B %d, %Y at %I:%M %p';
$lang_date['comment'] = '%B %d, %Y at %I:%M %p';
$lang_date['log'] = '%B %d, %Y at %I:%M %p';
Title: Re: Date added for image files not showing correctly
Post by: 406man on November 02, 2023, 03:00:27 pm
The problem one is as below:-


// The various date formats
// See http://www.php.net/manual/en/function.strftime.php to define the variable below
$lang_date['album'] = '%B %d, %Y';
$lang_date['lastcom'] = '%m/%d/%y at %H:%M';
$lang_date['lastup'] = '%B %d, %Y';
$lang_date['register'] = '%B %d, %Y';
$lang_date['lasthit'] = '%B %d, %Y at %I:%M %p';
$lang_date['comment'] = '%B %d, %Y at %I:%M %p';
$lang_date['log'] = '%B %d, %Y at %I:%M %p';

These are the old date formats so to fix your display problem they need to either be updated to the new formats or deleted.
Title: Re: Date added for image files not showing correctly
Post by: sharpo on November 02, 2023, 04:07:45 pm
These are the old date formats so to fix your display problem they need to either be updated to the new formats or deleted.

I'll admit to being confused now as the date formats appear to be the same in both galleries, but one displays the date correctly, the other doesn't.

Last uploads on the one that has a problem:-
http://www.sharpos-world.co.uk/kc/thumbnails.php?album=lastup&cat=0

Last uploads on the one that works as expected:-
http://www.sharpos-world.co.uk/cpg/thumbnails.php?album=lastup&cat=0
Title: Re: Date added for image files not showing correctly
Post by: sharpo on November 02, 2023, 04:17:48 pm
Just realised the one that worked correctly was an earlier version of 1.6 and I just updated it to 1.6.25 and it now DOES have the same date problem.

I'll have a look at the smaller gallery & try editing as you suggested to see if it solves the problem.
Title: Re: Date added for image files not showing correctly
Post by: sharpo on November 02, 2023, 04:27:38 pm
GREAT, that has fixed it!!!

Thanks very much. All showing correctly on this one:- http://www.sharpos-world.co.uk/kc/thumbnails.php?album=lastup&cat=0

Will correct the other later.