mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 03:34:04 +02:00
splitted language files
git-svn-id: file:///svn/phpbb/trunk@4844 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1452,7 +1452,7 @@ function page_header($page_title = '')
|
||||
'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
|
||||
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
|
||||
'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'],
|
||||
'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang[$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang[$tz], ''),
|
||||
'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''),
|
||||
'S_DISPLAY_ONLINE_LIST' => (!empty($config['load_online'])) ? 1 : 0,
|
||||
'S_DISPLAY_SEARCH' => (!empty($config['load_search'])) ? 1 : 0,
|
||||
'S_DISPLAY_PM' => (empty($config['privmsg_disable'])) ? 1 : 0,
|
||||
|
@@ -31,7 +31,7 @@ function generate_smilies($mode, $forum_id)
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$user->setup(false, (int) $row['forum_style']);
|
||||
$user->setup('posting', (int) $row['forum_style']);
|
||||
|
||||
page_header($user->lang['SMILIES']);
|
||||
|
||||
|
@@ -43,7 +43,7 @@ class custom_profile
|
||||
|
||||
function generate_profile_fields($mode, $lang_id, $cp_error)
|
||||
{
|
||||
global $db, $template, $auth;
|
||||
global $db, $template, $auth, $user;
|
||||
|
||||
$sql = "SELECT l.*, f.*
|
||||
FROM phpbb_profile_lang l, phpbb_profile_fields f
|
||||
|
@@ -453,6 +453,7 @@ class session
|
||||
class user extends session
|
||||
{
|
||||
var $lang = array();
|
||||
var $help = array();
|
||||
var $theme = array();
|
||||
var $date_format;
|
||||
var $timezone;
|
||||
@@ -467,7 +468,7 @@ class user extends session
|
||||
|
||||
function setup($lang_set = false, $style = false)
|
||||
{
|
||||
global $db, $template, $config, $auth, $phpEx, $phpbb_root_path;
|
||||
global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $lang, $help;
|
||||
|
||||
if ($this->data['user_id'] != ANONYMOUS)
|
||||
{
|
||||
@@ -514,28 +515,9 @@ class user extends session
|
||||
}
|
||||
}
|
||||
|
||||
include($this->lang_path . 'lang_main.' . $phpEx);
|
||||
if (defined('IN_ADMIN'))
|
||||
{
|
||||
include($this->lang_path . 'lang_admin.' . $phpEx);
|
||||
}
|
||||
$this->lang = &$lang;
|
||||
|
||||
/* if (is_array($lang_set))
|
||||
{
|
||||
include($this->lang_path . '/common.' . $phpEx);
|
||||
|
||||
foreach ($lang_set as $lang_file)
|
||||
{
|
||||
include($this->lang_path . '/' . $lang_file . '.' . $phpEx);
|
||||
}
|
||||
unset($lang_set);
|
||||
}
|
||||
else
|
||||
{
|
||||
include($this->lang_path . '/common.' . $phpEx);
|
||||
include($this->lang_path . '/' . $lang_set . '.' . $phpEx);
|
||||
}*/
|
||||
include($this->lang_path . '/common.' . $phpEx);
|
||||
$this->add_lang($lang_set);
|
||||
unset($lang_set);
|
||||
|
||||
if (!empty($_GET['style']) && $auth->acl_get('a_styles'))
|
||||
{
|
||||
@@ -591,6 +573,77 @@ class user extends session
|
||||
return;
|
||||
}
|
||||
|
||||
// Internal usage
|
||||
function set_lang($lang_file, $use_db = false, $use_help = false)
|
||||
{
|
||||
global $lang, $help, $phpEx;
|
||||
|
||||
if (!$use_db)
|
||||
{
|
||||
include($this->lang_path . '/' . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx);
|
||||
}
|
||||
else if ($use_db)
|
||||
{
|
||||
// Get Database Language Strings
|
||||
// Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
|
||||
// For example: help:faq, posting
|
||||
}
|
||||
}
|
||||
|
||||
// Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
|
||||
//
|
||||
// $lang_set = array('posting', 'help' => 'faq');
|
||||
// $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq'))
|
||||
// $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq'))
|
||||
// $lang_set = 'posting'
|
||||
// $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
|
||||
function add_lang($lang_set, $use_db = false, $use_help = false)
|
||||
{
|
||||
global $lang, $help, $phpEx;
|
||||
|
||||
if (is_array($lang_set))
|
||||
{
|
||||
foreach ($lang_set as $key => $lang_file)
|
||||
{
|
||||
$key = (string) $key;
|
||||
if ($key == 'db')
|
||||
{
|
||||
$this->add_lang($lang_file, true, $use_help);
|
||||
}
|
||||
else if ($key == 'help')
|
||||
{
|
||||
$this->add_lang($lang_file, $use_db, true);
|
||||
}
|
||||
else if (!is_array($lang_file))
|
||||
{
|
||||
$this->set_lang($lang_file, $use_db, $use_help);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->add_lang($lang_file, $use_db, $use_help);
|
||||
}
|
||||
}
|
||||
unset($lang_set);
|
||||
}
|
||||
else if ($lang_set)
|
||||
{
|
||||
$this->set_lang($lang_set, $use_db, $use_help);
|
||||
}
|
||||
|
||||
if ($use_help || sizeof($help))
|
||||
{
|
||||
$this->help += $help;
|
||||
unset($help);
|
||||
}
|
||||
|
||||
if (sizeof($lang))
|
||||
{
|
||||
$this->lang += $lang;
|
||||
// Yes, we unset $lang here, this variable is in use elsewhere
|
||||
unset($lang);
|
||||
}
|
||||
}
|
||||
|
||||
function format_date($gmepoch, $format = false)
|
||||
{
|
||||
static $lang_dates;
|
||||
|
@@ -50,7 +50,7 @@ class ucp_pm extends ucp
|
||||
// Is PM disabled?
|
||||
if (!empty($config['privmsg_disable']))
|
||||
{
|
||||
trigger_error($user->lang['PM_disabled']);
|
||||
trigger_error($user->lang['PM_DISABLED']);
|
||||
}
|
||||
|
||||
$html_entities_match = array('#&#', '#<#', '#>#');
|
||||
|
@@ -17,6 +17,8 @@ class ucp_profile extends module
|
||||
{
|
||||
global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx;
|
||||
|
||||
$user->add_lang('posting');
|
||||
|
||||
$preview = (!empty($_POST['preview'])) ? true : false;
|
||||
$submit = (!empty($_POST['submit'])) ? true : false;
|
||||
$delete = (!empty($_POST['delete'])) ? true : false;
|
||||
|
Reference in New Issue
Block a user