Date added for image files not showing correctly Date added for image files not showing correctly
 

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]

Main Menu

Date added for image files not showing correctly

Started by sharpo, November 01, 2023, 07:19:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

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.
Sharpo (not an expert, just a Coppermine user)
3 live galleries, first started in 2006.
http://www.sharpos-world.co.uk/BB3cpg/ with over 8,000 images.
http://www.sharpos-world.co.uk/cpg/ with over 25,000 images. 1.6.25
http://www.sharpos-world.co.uk/kc/ with over 300 images. 1.6.25

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';
Sharpo (not an expert, just a Coppermine user)
3 live galleries, first started in 2006.
http://www.sharpos-world.co.uk/BB3cpg/ with over 8,000 images.
http://www.sharpos-world.co.uk/cpg/ with over 25,000 images. 1.6.25
http://www.sharpos-world.co.uk/kc/ with over 300 images. 1.6.25

406man

#3
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';

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.

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
Sharpo (not an expert, just a Coppermine user)
3 live galleries, first started in 2006.
http://www.sharpos-world.co.uk/BB3cpg/ with over 8,000 images.
http://www.sharpos-world.co.uk/cpg/ with over 25,000 images. 1.6.25
http://www.sharpos-world.co.uk/kc/ with over 300 images. 1.6.25

sharpo

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.
Sharpo (not an expert, just a Coppermine user)
3 live galleries, first started in 2006.
http://www.sharpos-world.co.uk/BB3cpg/ with over 8,000 images.
http://www.sharpos-world.co.uk/cpg/ with over 25,000 images. 1.6.25
http://www.sharpos-world.co.uk/kc/ with over 300 images. 1.6.25

sharpo

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.
Sharpo (not an expert, just a Coppermine user)
3 live galleries, first started in 2006.
http://www.sharpos-world.co.uk/BB3cpg/ with over 8,000 images.
http://www.sharpos-world.co.uk/cpg/ with over 25,000 images. 1.6.25
http://www.sharpos-world.co.uk/kc/ with over 300 images. 1.6.25