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: Trouble with change language as admin in config  (Read 7283 times)

0 Members and 1 Guest are viewing this topic.

andrez1

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
    • Hedmarksmuseets fotoarkiv - Museum archive
Trouble with change language as admin in config
« on: November 29, 2005, 05:07:20 pm »

Tread marked as fixed:

http://forum.coppermine-gallery.net/index.php?topic=24075.0

I guess its kind of parked and not read. So i assume the right thing is to post a new topic. Here it goes:

Whatever can be set and stored in cookies as language preference based on list-box on frontside: Works OK. With or without nibblers fix.

But changing, as admin, in 'configuration'-menu, language: Does not work properly. 

The place to check is wether the 'cpg140_config' -table change the 'name' "lang" to 'value' "english" (or whatever chosen) or not when requested.

I would like to set language to norwegian and remove listbox and language-flags on frontpage. And i can not do that from config meny as long as the database not gets the message  'name' "lang" to 'value' "norwegian"

That is with the fix in place.

I have looked more  into it. 

If display language is lets say 'english' chosen from listbox (and stored in cookie i guess), the admins' config menu on language present 'english' as the choice, other languages can be chosen, and will get updated   in cpg140_config if chosen.

but:

If display language is changed to lets say 'norwegian' chosen from listbox (and stored in cookie i guess), the admins' config menu on language present 'norwegian' as the choice, on update it _will_ _not_ update the cpg140_config

Other languages can be chosen, and _will_ get updated   in cpg140_config if chosen.


So:

It seems like the rule is that if admin chose a language as a personal preference, it will stop him/her from setting and updating the same language as  system default.

But:

Admin can chose lets say .. 'catalan' as language (personal setting from listbox on frontpage) and from that position set 'norwegian' as  system default, then switch back to norwegian (from listbok on frontpage) for him/her-self, go back to config and remove the listbox on frontpage; And the system is locked to norwegian and the key trown away.

 
(Hey, I'm not complaining, I'm not like that. Great work!)



Mvh Andrez1
« Last Edit: November 30, 2005, 08:56:13 am by GauGau »
Logged

Nibbler

  • Guest
Re: Trouble with change language as admin in config
« Reply #1 on: November 29, 2005, 05:24:53 pm »

I think I know why this is. Look in admin.php and comment out this line:

Code: [Select]
if ($CONFIG[$element[1]] !== stripslashes($value))
Logged

andrez1

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
    • Hedmarksmuseets fotoarkiv - Museum archive
Re: Trouble with change language as admin in config
« Reply #2 on: November 29, 2005, 06:38:05 pm »

I think I know why this is. Look in admin.php and comment out this line:

Code: [Select]
if ($CONFIG[$element[1]] !== stripslashes($value))


Thanks. That fixed the problem.



Mvh Andrez1
Logged

marcnyc

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: Trouble with change language as admin in config
« Reply #3 on: December 02, 2005, 11:35:55 pm »

When you say comment out, you mean comment the whole entire IF statement from the first { bracket to the last one } (basically what I posted) or JUST THAT ONE LINE?
I ask becuase it seems like if you comment that line alone then then the stuff between {} will be applied to the previous IF line  ( if ($element[1] == 'ecards_more_pic_target' && substr($value, -1, 1) != '/') $value .= '/'; )... Is that cool? I am just checking to make sure...

Code: [Select]
                if ($element[1] == 'ecards_more_pic_target' && substr($value, -1, 1) != '/') $value .= '/';
                if ($CONFIG[$element[1]] !== stripslashes($value))
                     {
                        cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '$value' WHERE name = '{$element[1]}'");
                                                if ($element[1]=='enable_encrypted_passwords' && $value) {
                                                        cpg_db_query("update {$CONFIG['TABLE_USERS']} set user_password=md5(user_password);");
                                                }
                        if ($CONFIG['log_mode'] == CPG_LOG_ALL) {
                                log_write('CONFIG UPDATE SQL: '.
                                          "UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '$value' WHERE name = '{$element[1]}'\n".
                                          'TIME: '.date("F j, Y, g:i a")."\n".
                                          'USER: '.$USER_DATA['user_name'],
                                          CPG_DATABASE_LOG
                                          );
                        }
                }
Logged

odie3

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 41
  • Ghost Dogs Admin
    • Ghost Dogs HQ
Re: Trouble with change language as admin in config
« Reply #4 on: December 02, 2005, 11:47:19 pm »

BTW, I think the same thing happens with Themes Admin Config Drop down box.

Should I apply the same fix?
Logged
Odie3

Nibbler

  • Guest
Re: Trouble with change language as admin in config
« Reply #5 on: December 03, 2005, 12:15:19 am »

You just comment out that one line. It will fix themes too.
Logged

marcnyc

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: Trouble with change language as admin in config
« Reply #6 on: December 03, 2005, 12:31:47 am »

I commented that line and nothing happened!!! how come???
Logged

Nibbler

  • Guest
Re: Trouble with change language as admin in config
« Reply #7 on: December 03, 2005, 12:46:02 am »

Maybe you have a different issue.
Logged

marcnyc

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: Trouble with change language as admin in config
« Reply #8 on: December 03, 2005, 07:41:57 am »

that is what I thought initially, which is why I hadn't tried commenting the line... basically in my case the language will not switch! I don't wanna add non-relevant info to this post, so instead of repeating the problem I'll post a link to my relevant post:

http://forum.coppermine-gallery.net/index.php?topic=24555.msg112985#msg112985
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Trouble with change language as admin in config
« Reply #9 on: January 31, 2006, 08:10:51 pm »

Hi guys,

i ran into this problem as wel.

- downloaded cpg143
- installed it onto a brand new server
- logged in as administrator

And then i went to the config menu to change the language to dutch. I choose the language and hit the save new configuration button.
CPG then says it has been saved.. but does not implement the change. When i check the language sheet in the config menu it still says
English.

I read the other posts like this one but no solution came to my rescue. This is a fresh installation, no mods or plugins installed yet, any ideas what i can check ?

Thanks
Hein
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.