forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: andrez1 on November 29, 2005, 05:07:20 pm

Title: Trouble with change language as admin in config
Post by: andrez1 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
Title: Re: Trouble with change language as admin in config
Post by: Nibbler 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))
Title: Re: Trouble with change language as admin in config
Post by: andrez1 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
Title: Re: Trouble with change language as admin in config
Post by: marcnyc 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
                                          );
                        }
                }
Title: Re: Trouble with change language as admin in config
Post by: odie3 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?
Title: Re: Trouble with change language as admin in config
Post by: Nibbler on December 03, 2005, 12:15:19 am
You just comment out that one line. It will fix themes too.
Title: Re: Trouble with change language as admin in config
Post by: marcnyc on December 03, 2005, 12:31:47 am
I commented that line and nothing happened!!! how come???
Title: Re: Trouble with change language as admin in config
Post by: Nibbler on December 03, 2005, 12:46:02 am
Maybe you have a different issue.
Title: Re: Trouble with change language as admin in config
Post by: marcnyc 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
Title: Re: Trouble with change language as admin in config
Post by: Hein Traag 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