Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Date added for image files not showing correctly  (Read 2516 times)

0 Members and 1 Guest are viewing this topic.

sharpo

  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 332
Date added for image files not showing correctly
« 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.
Logged
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

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 46
Re: Date added for image files not showing correctly
« Reply #1 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.
Logged

sharpo

  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 332
Re: Date added for image files not showing correctly
« Reply #2 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';
Logged
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

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 46
Re: Date added for image files not showing correctly
« Reply #3 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.
« Last Edit: November 02, 2023, 03:07:21 pm by 406man »
Logged

sharpo

  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 332
Re: Date added for image files not showing correctly
« Reply #4 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
Logged
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

  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 332
Re: Date added for image files not showing correctly
« Reply #5 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.
Logged
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

  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 332
Re: Date added for image files not showing correctly
« Reply #6 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.
Logged
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
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.