mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 10:16:36 +02:00
- introduce LA_, UA_ and A_ template variables (they allow styles to use template variables used for javascript in subSilver outside javascript in their own template while they won't break our javascript if they contain quotes) also fixes [Bug #1116]
- corrected page title for search indexing progress bar [Bug #1695] - correct poster name for the anonymous user in mcp_queue and mcp_reports git-svn-id: file:///svn/phpbb/trunk@5888 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -173,7 +173,8 @@ class acp_ban
|
||||
{
|
||||
$template->assign_block_vars('ban_length', array(
|
||||
'BAN_ID' => $ban_id,
|
||||
'LENGTH' => $length)
|
||||
'LENGTH' => $length,
|
||||
'A_LENGTH' => addslashes($length))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -184,7 +185,8 @@ class acp_ban
|
||||
{
|
||||
$template->assign_block_vars('ban_reason', array(
|
||||
'BAN_ID' => $ban_id,
|
||||
'REASON' => addslashes(html_entity_decode($reason)))
|
||||
'REASON' => $reason,
|
||||
'A_REASON' => addslashes(html_entity_decode($reason)))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -195,7 +197,8 @@ class acp_ban
|
||||
{
|
||||
$template->assign_block_vars('ban_give_reason', array(
|
||||
'BAN_ID' => $ban_id,
|
||||
'REASON' => addslashes(html_entity_decode($reason)))
|
||||
'REASON' => $reason,
|
||||
'A_REASON' => addslashes(html_entity_decode($reason)))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -523,7 +523,8 @@ class acp_groups
|
||||
'GROUP_HIDDEN' => $type_hidden,
|
||||
|
||||
'U_BACK' => $u_back,
|
||||
'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour",
|
||||
'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour",
|
||||
'UA_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour",
|
||||
'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id",
|
||||
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
|
||||
)
|
||||
|
@@ -363,7 +363,7 @@ class acp_modules
|
||||
// Name options
|
||||
$s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_name']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']</option>';
|
||||
|
||||
$template->assign_block_vars('m_names', array('NAME' => str_replace("'", "\'", stripslashes($option))));
|
||||
$template->assign_block_vars('m_names', array('NAME' => $option));
|
||||
|
||||
// Build module modes
|
||||
foreach ($values['modes'] as $m_mode => $m_values)
|
||||
@@ -374,8 +374,10 @@ class acp_modules
|
||||
}
|
||||
|
||||
$template->assign_block_vars('m_names.modes', array(
|
||||
'OPTION' => str_replace("'", "\'", stripslashes($m_mode)),
|
||||
'VALUE' => str_replace("'", "\'", stripslashes($this->lang_name($m_values['title']))))
|
||||
'OPTION' => $m_mode,
|
||||
'VALUE' => $this->lang_name($m_values['title']),
|
||||
'A_OPTION' => addslashes($m_mode),
|
||||
'A_VALUE' => addslashes($this->lang_name($m_values['title'])))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -399,7 +399,8 @@ class acp_search
|
||||
$template->assign_vars(array(
|
||||
'S_INDEX' => true,
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_PROGRESS_BAR' => $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=progress_bar") // don't use & here
|
||||
'U_PROGRESS_BAR' => $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=progress_bar",
|
||||
'UA_PROGRESS_BAR' => $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=progress_bar")
|
||||
);
|
||||
|
||||
if (isset($this->state[1]))
|
||||
@@ -416,15 +417,18 @@ class acp_search
|
||||
function display_progress_bar($type)
|
||||
{
|
||||
global $template, $user;
|
||||
adm_page_header('PROGRESS_BAR');
|
||||
|
||||
$l_type = ($type == 'create') ? 'INDEXING_IN_PROGRESS' : 'DELETING_INDEX_IN_PROGRESS';
|
||||
|
||||
adm_page_header($user->lang[$l_type]);
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'search_index_progress_bar.html')
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_PROGRESS' => ($type == 'create') ? $user->lang['INDEXING_IN_PROGRESS'] : $user->lang['DELETING_INDEX_IN_PROGRESS'],
|
||||
'L_PROGRESS_EXPLAIN' => ($type == 'create') ? $user->lang['INDEXING_IN_PROGRESS_EXPLAIN'] : $user->lang['DELETING_INDEX_IN_PROGRESS_EXPLAIN'])
|
||||
'L_PROGRESS' => $user->lang[$l_type],
|
||||
'L_PROGRESS_EXPLAIN' => $user->lang[$l_type . '_EXPLAIN'])
|
||||
);
|
||||
|
||||
adm_page_footer();
|
||||
|
@@ -1223,6 +1223,7 @@ class acp_users
|
||||
'S_DATEFORMAT_OPTIONS' => $dateformat_options,
|
||||
'S_CUSTOM_DATEFORMAT' => $s_custom,
|
||||
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
|
||||
'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']),
|
||||
|
||||
'S_LANG_OPTIONS' => language_select($lang),
|
||||
'S_STYLE_OPTIONS' => style_select($style),
|
||||
|
@@ -2541,9 +2541,9 @@ function page_header($page_title = '')
|
||||
|
||||
'U_PRIVATEMSGS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox",
|
||||
'U_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox",
|
||||
'U_JS_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox",
|
||||
'UA_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox",
|
||||
'U_POPUP_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup",
|
||||
'U_JS_POPUP_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup",
|
||||
'UA_POPUP_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup",
|
||||
'U_MEMBERLIST' => "{$phpbb_root_path}memberlist.$phpEx$SID",
|
||||
'U_MEMBERSLIST' => "{$phpbb_root_path}memberlist.$phpEx$SID",
|
||||
'U_VIEWONLINE' => "{$phpbb_root_path}viewonline.$phpEx$SID",
|
||||
|
@@ -69,11 +69,12 @@ function generate_smilies($mode, $forum_id)
|
||||
if ($row['smiley_url'] !== $last_url)
|
||||
{
|
||||
$template->assign_block_vars('smiley', array(
|
||||
'SMILEY_CODE' => $row['code'],
|
||||
'SMILEY_IMG' => $phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
|
||||
'SMILEY_WIDTH' => $row['smiley_width'],
|
||||
'SMILEY_HEIGHT' => $row['smiley_height'],
|
||||
'SMILEY_DESC' => $row['emotion'])
|
||||
'SMILEY_CODE' => $row['code'],
|
||||
'A_SMILEY_CODE' => addslashes($row['code']),
|
||||
'SMILEY_IMG' => $phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
|
||||
'SMILEY_WIDTH' => $row['smiley_width'],
|
||||
'SMILEY_HEIGHT' => $row['smiley_height'],
|
||||
'SMILEY_DESC' => $row['emotion'])
|
||||
);
|
||||
}
|
||||
$last_url = $row['smiley_url'];
|
||||
@@ -839,7 +840,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||
'U_POST_ID' => $row['post_id'],
|
||||
'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#p' . $row['post_id'],
|
||||
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '',
|
||||
'U_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? 'javascript:addquote(' . $row['post_id'] . ", '" . str_replace("'", "\\'", $poster) . "')" : '')
|
||||
'U_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? 'javascript:addquote(' . $row['post_id'] . ", '" . addslashes($poster) . "')" : '')
|
||||
);
|
||||
unset($rowset[$i]);
|
||||
}
|
||||
|
@@ -91,13 +91,13 @@ class mcp_queue
|
||||
}
|
||||
|
||||
// Set some vars
|
||||
$poster = ($post_info['user_colour']) ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
|
||||
|
||||
if ($post_info['user_id'] == ANONYMOUS)
|
||||
{
|
||||
$poster = ($post_info['post_username']) ? $post_info['post_username'] : $user->lang['GUEST'];
|
||||
}
|
||||
|
||||
$poster = ($post_info['user_colour']) ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
|
||||
|
||||
// Process message, leave it uncensored
|
||||
$message = $post_info['post_text'];
|
||||
if ($post_info['bbcode_bitfield'])
|
||||
|
@@ -98,6 +98,11 @@ class mcp_reports
|
||||
}
|
||||
|
||||
// Set some vars
|
||||
if ($post_info['user_id'] == ANONYMOUS)
|
||||
{
|
||||
$poster = ($post_info['post_username']) ? $post_info['post_username'] : $user->lang['GUEST'];
|
||||
}
|
||||
|
||||
$poster = ($post_info['user_colour']) ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
|
||||
|
||||
// Process message, leave it uncensored
|
||||
@@ -119,7 +124,7 @@ class mcp_reports
|
||||
'S_POST_LOCKED' => $post_info['post_edit_locked'],
|
||||
'S_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? true : false,
|
||||
|
||||
'U_VIEW_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'],
|
||||
'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'] : '',
|
||||
'U_MCP_USER_NOTES' => "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'],
|
||||
'U_MCP_WARN_USER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $post_info['user_id'],
|
||||
'U_VIEW_REPORTER_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $report['user_id'],
|
||||
|
@@ -626,7 +626,8 @@ class ucp_groups
|
||||
'GROUP_CLOSED' => $type_closed,
|
||||
'GROUP_HIDDEN' => $type_hidden,
|
||||
|
||||
'U_SWATCH' => "{$phpbb_root_path}adm/swatch.$phpEx$SID&form=ucp&name=group_colour",
|
||||
'U_SWATCH' => "{$phpbb_root_path}adm/swatch.$phpEx$SID&form=ucp&name=group_colour",
|
||||
'UA_SWATCH' => "{$phpbb_root_path}adm/swatch.$phpEx$SID&form=ucp&name=group_colour",
|
||||
'S_UCP_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode&action=$action&g=$group_id",
|
||||
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)))
|
||||
);
|
||||
|
@@ -165,6 +165,7 @@ class ucp_prefs
|
||||
'S_DATEFORMAT_OPTIONS' => $dateformat_options,
|
||||
'S_CUSTOM_DATEFORMAT' => $s_custom,
|
||||
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
|
||||
'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']),
|
||||
|
||||
'S_LANG_OPTIONS' => language_select($lang),
|
||||
'S_STYLE_OPTIONS' => style_select($style),
|
||||
|
Reference in New Issue
Block a user