Changes for phpbb 3.3.0
This commit is contained in:
@@ -99,7 +99,7 @@ class user_menu extends module_base
|
||||
*/
|
||||
public function get_template_side($module_id)
|
||||
{
|
||||
if (!function_exists('phpbb_get_user_rank'))
|
||||
if (!function_exists('get_user_rank'))
|
||||
{
|
||||
include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
|
||||
}
|
||||
@@ -147,8 +147,22 @@ class user_menu extends module_base
|
||||
$username = $this->user->data['username'];
|
||||
$colour = $this->user->data['user_colour'];
|
||||
$avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($this->user->data, 'user'), 'USER_AVATAR');
|
||||
$rank_data = phpbb_get_user_rank($this->user->data, $this->user->data['user_posts']);
|
||||
$rank_title = $rank_img = $rank_img_src = '';
|
||||
\get_user_rank($this->user->data['user_rank'], $this->user->data['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||
|
||||
|
||||
$s_login_redirect = build_hidden_fields(array('redirect' => $this->path_helper->remove_web_root_path(build_url())));
|
||||
/**
|
||||
* Workaround for missing template variable in pre phpBB 3.2.6 styles.
|
||||
* @deprecated 3.2.7 (To be removed: 3.3.0-a1)
|
||||
*/
|
||||
$form_token_login = $this->template->retrieve_var('S_FORM_TOKEN_LOGIN');
|
||||
if (!empty($form_token_login))
|
||||
{
|
||||
$s_login_redirect .= $form_token_login;
|
||||
// Remove S_FORM_TOKEN_LOGIN as it's already appended to S_login_redirect
|
||||
$this->template->assign_var('S_FORM_TOKEN_LOGIN', '');
|
||||
}
|
||||
// Assign specific vars
|
||||
$this->template->assign_vars(array(
|
||||
'L_NEW_POSTS' => $this->user->lang['SEARCH_NEW'] . ' (' . $new_posts_count . ')',
|
||||
@@ -156,9 +170,9 @@ class user_menu extends module_base
|
||||
'L_UNREAD_POSTS'=> $this->user->lang['SEARCH_UNREAD'] . ' (' . $unread_posts_count . ')',
|
||||
|
||||
'B3P_AVATAR_IMG' => $avatar_img,
|
||||
'B3P_RANK_TITLE' => $rank_data['title'],
|
||||
'B3P_RANK_IMG' => $rank_data['img'],
|
||||
'RANK_IMG_SRC' => $rank_data['img_src'],
|
||||
'B3P_RANK_TITLE' => $rank_title,
|
||||
'B3P_RANK_IMG' => $rank_img,
|
||||
'RANK_IMG_SRC' => $rank_img_src,
|
||||
|
||||
'USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour),
|
||||
'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $colour),
|
||||
@@ -176,13 +190,16 @@ class user_menu extends module_base
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add form token for login box
|
||||
add_form_key('login', '_LOGIN');
|
||||
|
||||
/*
|
||||
* Assign specific vars
|
||||
* Need to remove web root path as ucp.php will do the
|
||||
* redirect
|
||||
*/
|
||||
$this->template->assign_vars(array(
|
||||
'U_PORTAL_REDIRECT' => $this->path_helper->remove_web_root_path($this->controller_helper->route('board3_portal_controller')),
|
||||
'U_login_redirect' => $this->path_helper->remove_web_root_path($this->controller_helper->route('board3_portal_controller')),
|
||||
'S_DISPLAY_FULL_LOGIN' => true,
|
||||
'S_AUTOLOGIN_ENABLED' => ($this->config['allow_autologin']) ? true : false,
|
||||
'S_LOGIN_ACTION' => append_sid("{$this->phpbb_root_path}ucp.{$this->php_ext}", 'mode=login'),
|
||||
|
||||
Reference in New Issue
Block a user