- bug 168 fixed: crash when language file does not exists. Constant

PHPWG_DEFAULT_LANGUAGE added. New function get_language_filepath always
  used to find language files.


git-svn-id: http://piwigo.org/svn/trunk@879 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2005-09-27 21:57:14 +00:00
parent b7b05eafc3
commit 0c0ab6d700
6 changed files with 55 additions and 51 deletions
+2 -23
View File
@@ -166,32 +166,11 @@ while ( $row =mysql_fetch_array( $result ) )
include(PHPWG_ROOT_PATH.'include/user.inc.php');
// language files
$user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language'];
$conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];
include_once(get_language_filepath('common.lang.php'));
if (file_exists($user_langdir.'/common.lang.php'))
{
include_once($user_langdir.'/common.lang.php');
}
else
{
include_once($conf_langdir.'/common.lang.php');
}
// The administration section requires 2 more language files
if (defined('IN_ADMIN') and IN_ADMIN)
{
foreach (array('admin') as $section)
{
if (file_exists($user_langdir.'/'.$section.'.lang.php'))
{
include_once($user_langdir.'/'.$section.'.lang.php');
}
else
{
include_once($conf_langdir.'/'.$section.'.lang.php');
}
}
include_once(get_language_filepath('admin.lang.php'));
}
// only now we can set the localized username of the guest user (and not in