Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 03:43 pm EST
Geeklog Forums
Language Modification
Anonymous
Anonymous
I'm trying to modify a portion of code in usersettings.php for my french version of GL.
Here's what I did:
I added a table named gl_cookiecodes_f using this:
#
# Table structure for table `gl_cookiecodes_f`
#
CREATE TABLE gl_cookiecodes_f (
cc_value int(8) unsigned NOT NULL default '0',
cc_descr varchar(20) NOT NULL default '',
PRIMARY KEY (cc_value)
) TYPE=MyISAM;
INSERT INTO gl_cookiecodes_f VALUES (3600,'1 Heure');
INSERT INTO gl_cookiecodes_f VALUES (7200,'2 Heures');
INSERT INTO gl_cookiecodes_f VALUES (10800,'3 Heures');
INSERT INTO gl_cookiecodes_f VALUES (28800,'8 Heures');
INSERT INTO gl_cookiecodes_f VALUES (86400,'1 Jour');
INSERT INTO gl_cookiecodes_f VALUES (604800,'1 Semaine');
INSERT INTO gl_cookiecodes_f VALUES (2678400,'1 Mois');
INSERT INTO gl_cookiecodes_f VALUES (31536000,'1 Année');
It's exactly the same as gl_cookiecodes but with french words in the data field.
Here are the modifications I made to usersettings.php at line 78:
. '<td><select name="cooktime">' ;
if ($_CONF['language'] == 'french') {
$retval .= COM_optionList($_TABLES['cookiecodes_f'],'cc_value,cc_descr',$A['cookietimeout'],0);
} else {
$retval .= COM_optionList($_TABLES['cookiecodes'],'cc_value,cc_descr',$A['cookietimeout'],0);
}
$retval .= '</select></td>' . LB
Now when I run it I get the following error message:
1064: You have an error in your SQL syntax near 'ORDER BY cc_value' at line 1
I had a look at function COM_optionList in lib-common.php, but I'm really not good with PHP.
I can't find out what's wrong.
I thought it would be easy !
Thank you
Alain
7
4
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
I would assume you forgot to add the name of your new table to the list in lib-database.php. Without that, $_TABLES['cookiecodes_f'] would be an empty string and that is probably what causes the error (have a look at logs/error.log for the full error message).
bye, Dirk
6
7
Quote
Anonymous
Anonymous
As usual you are right !
It now works perfectly.
Will GL2 be easier on other languages, I mean nothing hardcoded or in database (like the one I modified) ?
Thank you
Alain
6
8
Quote
All times are EST. The time is now 03:43 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content