Avatar

more_smilies_label - is not used (Bugs)

by Auge ⌂, Saturday, June 15, 2013, 17:26 (3961 days ago) @ Micha

Hello Milo

... Instead of

$smarty->configLoad($settings['language_file'], 'general');

I'm adding the if-else from the index.php:

if(isset($_SESSION[$settings['session_prefix'].'usersettings']['language']) && file_exists(LANG_DIR.'/'.$_SESSION[$settings['session_prefix'].'usersettings']['language']))
$language_file = $_SESSION[$settings['session_prefix'].'usersettings']['language'];
else
$language_file = $settings['language_file'];
 
//$smarty->configLoad($settings['language_file'], 'general');
$smarty->configLoad($language_file, 'general');

Now, it works but, is it in any case the right way?

Seems to be logically to look for the users language setting before including the strings, but ...

... I'm wondering about the doubled inclusion of the language strings in the index.php and (now) additionally in another file. I didn't actually took a look into the source code, but should it not be included only once?

[edit]The point is: if the language file is defined once in the index.php with the variable $language_file, this variable should be used directly in the "other" file instead redefining the content of the variable.[/edit]

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!


Complete thread:

 RSS Feed of thread