salve a tutti ho due file
uno language/en/main.php
<?
$lang["powered_by"] = "Powered by";
?>
e uno pippo.php
<?
$phpEx = 'php';
$default_language = 'en';
$phpms_root_path = './';
function inc_lang($filename)
{
global $phpms_root_path, $module_root_path, $default_language, $phpEx;
//
//Check for language file into module folder
//
if( file_exists($module_root_path . 'language/' . $user["lang"] . '/' . $filename . '.' . $phpEx))
{
$filepath = $module_root_path;
$script_lang = $user["lang"];
}
else if( file_exists($module_root_path . 'language/' . $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'] . '/' . $filename . '.' . $phpEx))
{
$filepath = $module_root_path;
$script_lang = $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'];
}
else if( file_exists($phpms_root_path . 'language/' . $script_config["lang"] . '/' . $filename . '.' . $phpEx))
{
$filepath = $module_root_path;
$script_lang = $portal_config["lang"];
}
else if( file_exists($phpms_root_path . 'language/' . $default_language . '/' . $filename . '.' . $phpEx))
{
$filepath = $module_root_path;
$script_lang = $default_language;
}
//
//If not found into module folder check in PhpMS folder
//
else if( file_exists($phpms_root_path . 'language/' . $user["lang"] . '/' . $filename . '.' . $phpEx))
{
$filepath = $phpms_root_path;
$script_lang = $user["lang"];
}
else if( file_exists($phpms_root_path . 'language/' . $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'] . '/' . $filename . '.' . $phpEx))
{
$filepath = $phpms_root_path;
$script_lang = $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'];
}
else if( file_exists($phpms_root_path . 'language/' . $script_config["lang"] . '/' . $filename . '.' . $phpEx))
{
$filepath = $phpms_root_path;
$script_lang = $portal_config["lang"];
}
else if( file_exists($phpms_root_path . 'language/' . $default_language . '/' . $filename . '.' . $phpEx))
{
$filepath = $phpms_root_path;
$script_lang = $default_language;
}
include($filepath . 'language/' . $script_lang . '/' . $filename . '.' . $phpEx);
}
inc_lang(main);
echo $lang["powered_by"];
?>
il mio problema è il file main viene incluso correttamente, ma non mi vengono resttuiti i valori dell'array perchè?