那是要放在哪個檔案阿?messagebox 寫:拿這個變數的資料~~~$_SERVER["HTTP_ACCEPT_LANGUAGE"]
對了,有沒有辦法將語言選單轉成按鈕阿?以及語系的標題要如何修改(如Chinese改成中文)?
版主: 版主管理群
代碼: 選擇全部
Parse error: parse error, unexpected T_ELSE in /home/cocolee2/public_html/forum/includes/functions.php on line 405
代碼: 選擇全部
//$board_config['default_lang'] = ($_COOKIE['lang']) ? $_COOKIE['lang'] : $board_config['default_lang'];
//$board_config['default_lang'] = ($_GET['lang']) ? $_GET['lang'] : $board_config['default_lang'];
//$board_config['default_lang'] = ($_POST['lang']) ? $_POST['lang'] : $board_config['default_lang'];
//setcookie("lang",$board_config['default_lang']);
代碼: 選擇全部
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx)) )
{
$board_config['default_lang'] = 'english';
}
代碼: 選擇全部
else
{
$default_lang = phpbb_ltrim(basename(phpbb_rtrim($board_config['default_lang'])), "'");
}
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) )
{
if ( $userdata['user_id'] != ANONYMOUS )
{
// For logged in users, try the board default language next
$default_lang = phpbb_ltrim(basename(phpbb_rtrim($board_config['default_lang'])), "'");
}
else
{
// For guests it means the default language is not present, try english
// This is a long shot since it means serious errors in the setup to reach here,
// but english is part of a new install so it's worth us trying
$default_lang = 'english';
}
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) )
{
message_die(CRITICAL_ERROR, 'Could not locate valid language pack');
}
}
// If we've had to change the value in any way then let's write it back to the database
// before we go any further since it means there is something wrong with it
if ( $userdata['user_id'] != ANONYMOUS && $userdata['user_lang'] !== $default_lang )
{
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_lang = '" . $default_lang . "'
WHERE user_lang = '" . $userdata['user_lang'] . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not update user language info');
}
$board_config['default_lang'] = $default_lang;
$userdata['user_lang'] = $default_lang;
}
elseif ( $board_config['default_lang'] !== $default_lang )
{
$sql = 'UPDATE ' . CONFIG_TABLE . "
SET config_value = '" . $default_lang . "'
WHERE config_name = 'default_lang'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not update user language info');
}
$board_config['default_lang'] = $default_lang;
}