mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Add check lang
Fixed: #174. PHP Notice in GET / #175. PHP Notice in GET /
This commit is contained in:
parent
e87f1beff0
commit
8b33d82fc6
2 changed files with 4 additions and 2 deletions
|
@ -125,7 +125,8 @@ $template->assign_vars(array(
|
||||||
// The following assigns all _common_ variables that may be used at any point in a template
|
// The following assigns all _common_ variables that may be used at any point in a template
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
||||||
'CONTENT_ENCODING' => $bb_cfg['lang'][$userdata['user_lang']]['encoding'],
|
'CONTENT_ENCODING' => isset($bb_cfg['lang'][$userdata['user_lang']]['encoding']) ?
|
||||||
|
$bb_cfg['lang'][$userdata['user_lang']]['encoding'] : 'utf-8',
|
||||||
|
|
||||||
'IN_ADMIN' => defined('IN_ADMIN'),
|
'IN_ADMIN' => defined('IN_ADMIN'),
|
||||||
'SHOW_ADS' => (!$logged_in || isset($bb_cfg['show_ads_users'][$user->id]) || (!IS_AM && $user->show_ads)),
|
'SHOW_ADS' => (!$logged_in || isset($bb_cfg['show_ads_users'][$user->id]) || (!IS_AM && $user->show_ads)),
|
||||||
|
|
|
@ -562,7 +562,8 @@ class user_common
|
||||||
}
|
}
|
||||||
|
|
||||||
require(LANG_DIR . 'main.php');
|
require(LANG_DIR . 'main.php');
|
||||||
setlocale(LC_ALL, $bb_cfg['lang'][$this->data['user_lang']]['locale']);
|
setlocale(LC_ALL, isset($bb_cfg['lang'][$this->data['user_lang']]['locale']) ?
|
||||||
|
$bb_cfg['lang'][$this->data['user_lang']]['locale'] : 'en_US.UTF-8');
|
||||||
|
|
||||||
$theme = setup_style();
|
$theme = setup_style();
|
||||||
$DeltaTime = new Date_Delta();
|
$DeltaTime = new Date_Delta();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue