1 (edited by Enemy 2006-12-04 21:25)

Topic: Add entries to $lang_common

You see, PMS mod is disabled for guests (i.e. not visible), thus in the very beginning it checks whether the user is logged in and tells him to do so if not.

if ($pun_user['is_guest'])
    message($lang_common['Login required']);

But, I've searched and didn't find entry 'Login required' in lang\English\common.php (or anywhere else)
I've updated common.php with this entry and forum failed with blank page (it failed to parse common.php to $lang_common I think)

Is it wrong to add lines to lang files?

Now I'm going to add Login  required entry to mod's lang file (pms.php) and refer to that like $lang_pms['Login required'].

Any suggestions?

Re: Add entries to $lang_common

Enemy wrote:

You see, PMS mod is disabled for guests (i.e. not visible), thus in the very beginning it checks whether the user is logged in and tells him to do so if not.

if ($pun_user['is_guest'])
    message($lang_common['Login required']);

But, I've searched and didn't find entry 'Login required' in lang\English\common.php (or anywhere else)
I've updated common.php with this entry and forum failed with blank page (it failed to parse common.php to $lang_common I think)

Is it wrong to add lines to lang files?

Now I'm going to add Login  required entry to mod's lang file (pms.php) and refer to that like $lang_pms['Login required'].

Any suggestions?

There's no problem adding new entries to the language files, but you need to make sure that the syntax of the array is correct. To take an example, the default lang/English/common.php ends with this:

'Posted'                =>    'Posted'    // The date/time a topic was started

);

Adding a new line at the end of the array will fail unless you put a comma (,) and the end of the line before it. What it should look like after you've added that line of yours is:

'Posted'                =>    'Posted',    // The date/time a topic was started
'Login required'        =>    'Text to display if not logged in'

);