Support > cpg1.6 miscellaneous

Date added for image files not showing correctly

(1/2) > >>

sharpo:
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.

406man:
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.

sharpo:
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';

406man:

--- Quote from: sharpo on November 02, 2023, 02:47:21 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';

--- End quote ---
These are the old date formats so to fix your display problem they need to either be updated to the new formats or deleted.

sharpo:

--- Quote from: 406man on November 02, 2023, 03:00:27 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.

--- End quote ---

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

Navigation

[0] Message Index

[#] Next page

Go to full version