diff options
Diffstat (limited to 'phpBB/includes')
25 files changed, 212 insertions, 63 deletions
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 0e058213e0..7b1dc706db 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -29,6 +29,9 @@ class acp_groups global $phpbb_root_path, $phpbb_admin_path, $phpEx; global $request, $phpbb_container, $phpbb_dispatcher; + /** @var \phpbb\language\language $language Language object */ + $language = $phpbb_container->get('language'); + $user->add_lang('acp/groups'); $this->tpl_name = 'acp_groups'; $this->page_title = 'ACP_GROUPS_MANAGE'; @@ -293,7 +296,19 @@ class acp_groups // Add user/s to group if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row)) { - trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); + $display_message = $language->lang($error); + + if ($error == 'GROUP_USERS_INVALID') + { + // Find which users don't exist + $actual_name_ary = $name_ary; + $actual_user_id_ary = []; + user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true); + + $display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp'))); + } + + trigger_error($display_message . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); } $message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED'; diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 66f0d2116c..4ee4cd4816 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -24,9 +24,9 @@ class acp_inactive var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 8e05b95849..e683b1972e 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -676,7 +676,7 @@ class acp_permissions /** * Apply permissions */ - function set_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + function set_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id) { global $db, $cache, $user, $auth; global $request; @@ -765,7 +765,7 @@ class acp_permissions /** * Apply all permissions */ - function set_all_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + function set_all_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id) { global $db, $cache, $user, $auth; global $request; @@ -881,7 +881,7 @@ class acp_permissions /** * Remove permissions */ - function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id) + function remove_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id, &$forum_id) { global $user, $db, $cache, $auth; diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index d89c200a1b..49da7d84a4 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -845,7 +845,7 @@ class acp_profile /** * Build all Language specific options */ - function build_language_options(&$cp, $field_type, $action = 'create') + function build_language_options($cp, $field_type, $action = 'create') { global $user, $config, $db, $request; @@ -942,7 +942,7 @@ class acp_profile /** * Save Profile Field */ - function save_profile_field(&$cp, $field_type, $action = 'create') + function save_profile_field($cp, $field_type, $action = 'create') { global $db, $config, $user, $phpbb_container, $phpbb_log, $request, $phpbb_dispatcher; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index b74fe535ee..2d1eaadfae 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -24,9 +24,9 @@ class acp_users var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 2fb83770fe..c19d48b0be 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -3042,6 +3042,8 @@ function tidy_database() } $db->sql_freeresult($result); + $db->sql_transaction('begin'); + // Delete those rows from the acl tables not having listed the forums above $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true); @@ -3051,6 +3053,8 @@ function tidy_database() WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true); $db->sql_query($sql); + $db->sql_transaction('commit'); + $config->set('database_last_gc', time(), false); } diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 4fe7e71117..e95fa40a58 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -391,7 +391,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $ * * @deprecated 3.1.0 (To be removed: 3.3.0) */ -function get_tables(&$db) +function get_tables($db) { $db_tools_factory = new \phpbb\db\tools\factory(); $db_tools = $db_tools_factory->get($db); diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php index d91993b23f..75e24618de 100644 --- a/phpBB/includes/functions_mcp.php +++ b/phpBB/includes/functions_mcp.php @@ -22,12 +22,12 @@ if (!defined('IN_PHPBB')) /** * Functions used to generate additional URL paramters */ -function phpbb_module__url($mode, &$module_row) +function phpbb_module__url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_notes_url($mode, &$module_row) +function phpbb_module_notes_url($mode, $module_row) { if ($mode == 'front') { @@ -38,7 +38,7 @@ function phpbb_module_notes_url($mode, &$module_row) return ($user_id) ? "&u=$user_id" : ''; } -function phpbb_module_warn_url($mode, &$module_row) +function phpbb_module_warn_url($mode, $module_row) { if ($mode == 'front' || $mode == 'list') { @@ -64,27 +64,27 @@ function phpbb_module_warn_url($mode, &$module_row) } } -function phpbb_module_main_url($mode, &$module_row) +function phpbb_module_main_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_logs_url($mode, &$module_row) +function phpbb_module_logs_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_ban_url($mode, &$module_row) +function phpbb_module_ban_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_queue_url($mode, &$module_row) +function phpbb_module_queue_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_reports_url($mode, &$module_row) +function phpbb_module_reports_url($mode, $module_row) { return phpbb_extra_url(); } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 7549ce4d58..5f2dea3b94 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -26,8 +26,10 @@ if (!defined('IN_PHPBB')) * @param array &$user_id_ary The user ids to check or empty if usernames used * @param array &$username_ary The usernames to check or empty if user ids used * @param mixed $user_type Array of user types to check, false if not restricting by user type +* @param boolean $update_references If false, the supplied array is unset and appears unchanged from where it was called +* @return boolean|string Returns false on success, error string on failure */ -function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false) +function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false, $update_references = false) { global $db; @@ -50,7 +52,13 @@ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false) } $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary}); - unset(${$which_ary}); + + // By unsetting the array here, the values passed in at the point user_get_id_name() was called will be retained. + // Otherwise, if we don't unset (as the array was passed by reference) the original array will be updated below. + if ($update_references === false) + { + unset(${$which_ary}); + } $user_id_ary = $username_ary = array(); @@ -2699,6 +2707,13 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, return 'NO_USER'; } + // Because the item that gets passed into the previous function is unset, the reference is lost and our original + // array is retained - so we know there's a problem if there's a different number of ids to usernames now. + if (count($user_id_ary) != count($username_ary)) + { + return 'GROUP_USERS_INVALID'; + } + // Remove users who are already members of this group $sql = 'SELECT user_id, group_leader FROM ' . USER_GROUP_TABLE . ' diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index b878b1af0a..8797f06db8 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -34,7 +34,10 @@ class mcp_ban } // Include the admin banning interface... - include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx); + if (!class_exists('acp_ban')) + { + include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx); + } $bansubmit = $request->is_set_post('bansubmit'); $unbansubmit = $request->is_set_post('unbansubmit'); diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index aeb716c1f9..918a98734b 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -290,7 +290,10 @@ function mcp_front_view($id, $mode, $action) if ($total) { - include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + if (!function_exists('get_recipient_strings')) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + } $sql_ary = array( 'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, p.message_attachment, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id', diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 049f24b262..79f9d35ebe 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -28,9 +28,9 @@ class mcp_logs var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 196d2f995f..733bcccc09 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -28,9 +28,9 @@ class mcp_main var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) @@ -174,7 +174,10 @@ class mcp_main switch ($mode) { case 'front': - include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx); + if (!function_exists('mcp_front_view')) + { + include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx); + } $user->add_lang('acp/common'); @@ -185,7 +188,10 @@ class mcp_main break; case 'forum_view': - include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx); + if (!function_exists('mcp_forum_view')) + { + include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx); + } $user->add_lang('viewforum'); @@ -208,7 +214,10 @@ class mcp_main break; case 'topic_view': - include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx); + if (!function_exists('mcp_topic_view')) + { + include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx); + } mcp_topic_view($id, $mode, $action); @@ -217,7 +226,10 @@ class mcp_main break; case 'post_details': - include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx); + if (!function_exists('mcp_post_details')) + { + include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx); + } mcp_post_details($id, $mode, $action); diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 12b116e495..a4c2356a43 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -28,9 +28,9 @@ class mcp_notes var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index ba89733bfe..eecfe9cbc8 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -28,9 +28,9 @@ class mcp_pm_reports var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index a95c8fad44..dec583f6f4 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -28,9 +28,9 @@ class mcp_queue var $p_master; var $u_action; - public function __construct(&$p_master) + public function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } public function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index b4018184a7..4600257344 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -28,9 +28,9 @@ class mcp_reports var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 9c63245982..68a65aafdd 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -93,7 +93,11 @@ function mcp_topic_view($id, $mode, $action) // Restore or pprove posts? if (($action == 'restore' || $action == 'approve') && $auth->acl_get('m_approve', $topic_info['forum_id'])) { - include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx); + if (!class_exists('mcp_queue')) + { + include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx); + } + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 888069ef5d..df175133fc 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -28,9 +28,9 @@ class mcp_warn var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index c12f2ab1aa..0b79cca864 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1587,6 +1587,16 @@ class parse_message extends bbcode_firstpass 'poster_id' => $user->data['user_id'], ); + /** + * Modify attachment sql array on submit + * + * @event core.modify_attachment_sql_ary_on_submit + * @var array sql_ary Array containing SQL data + * @since 3.2.6-RC1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.modify_attachment_sql_ary_on_submit', compact($vars))); + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); $new_entry = array( @@ -1722,6 +1732,16 @@ class parse_message extends bbcode_firstpass 'poster_id' => $user->data['user_id'], ); + /** + * Modify attachment sql array on upload + * + * @event core.modify_attachment_sql_ary_on_upload + * @var array sql_ary Array containing SQL data + * @since 3.2.6-RC1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.modify_attachment_sql_ary_on_upload', compact($vars))); + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); $new_entry = array( diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 1fb026167a..2423af86be 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -32,6 +32,9 @@ class ucp_groups global $db, $user, $auth, $cache, $template; global $request, $phpbb_container, $phpbb_log; + /** @var \phpbb\language\language $language Language object */ + $language = $phpbb_container->get('language'); + $user->add_lang('groups'); $return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>'); @@ -396,7 +399,10 @@ class ucp_groups $action = (isset($_POST['addusers'])) ? 'addusers' : $request->variable('action', ''); $group_id = $request->variable('g', 0); - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + if (!function_exists('phpbb_get_user_rank')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } add_form_key('ucp_groups'); @@ -1054,13 +1060,27 @@ class ucp_groups if (confirm_box(true)) { + $return_manage_page = '<br /><br />' . $language->lang('RETURN_PAGE', '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>'); + // Add user/s to group if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row)) { - trigger_error($user->lang[$error] . $return_page); + $display_message = $language->lang($error); + + if ($error == 'GROUP_USERS_INVALID') + { + // Find which users don't exist + $actual_name_ary = $name_ary; + $actual_user_id_ary = []; + user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true); + + $display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp'))); + } + + trigger_error($display_message . $return_manage_page); } - trigger_error($user->lang['GROUP_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); + trigger_error($language->lang('GROUP_USERS_ADDED') . $return_manage_page); } else { diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index ec652a5e45..36f45f3f46 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -28,9 +28,9 @@ class ucp_main var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) @@ -245,7 +245,10 @@ class ucp_main case 'subscribed': - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + if (!function_exists('topic_status')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } $user->add_lang('viewforum'); @@ -481,7 +484,10 @@ class ucp_main break; } - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + if (!function_exists('topic_status')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } $user->add_lang('viewforum'); diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index fa374c15c8..4d02620e89 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -82,7 +82,10 @@ class ucp_pm $mode = 'view'; } - include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + if (!function_exists('get_folder')) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + } switch ($mode) { @@ -104,7 +107,10 @@ class ucp_pm break; } - include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx); + if (!function_exists('compose_pm')) + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx); + } compose_pm($id, $mode, $action, $user_folders); $tpl_file = 'posting_body'; @@ -114,7 +120,10 @@ class ucp_pm set_user_message_limit(); get_folder($user->data['user_id']); - include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx); + if (!function_exists('message_options')) + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx); + } message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions); $tpl_file = 'ucp_pm_options'; @@ -125,8 +134,10 @@ class ucp_pm get_folder($user->data['user_id']); $this->p_name = 'pm'; - // Call another module... please do not try this at home... Hoochie Coochie Man - include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx); + if (!class_exists('ucp_main')) + { + include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx); + } $module = new ucp_main($this); $module->u_action = $this->u_action; @@ -375,7 +386,10 @@ class ucp_pm if ($action == 'view_folder') { - include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx); + if (!function_exists('view_folder')) + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx); + } view_folder($id, $mode, $folder_id, $folder); $tpl_file = 'ucp_pm_viewfolder'; @@ -393,7 +407,10 @@ class ucp_pm trigger_error('NO_MESSAGE'); } - include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx); + if (!function_exists('view_message')) + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx); + } view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row); $tpl_file = ($view == 'print') ? 'ucp_pm_viewmessage_print' : 'ucp_pm_viewmessage'; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index b1b039add1..543db4f889 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -33,9 +33,20 @@ function compose_pm($id, $mode, $action, $user_folders = array()) // Needed for handle_message_list_actions() global $refresh, $submit, $preview; - include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); - include($phpbb_root_path . 'includes/message_parser.' . $phpEx); + if (!function_exists('generate_smilies')) + { + include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + } + + if (!function_exists('display_custom_bbcodes')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + + if (!class_exists('parse_message')) + { + include($phpbb_root_path . 'includes/message_parser.' . $phpEx); + } if (!$action) { @@ -1195,7 +1206,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $controller_helper = $phpbb_container->get('controller.helper'); // Start assigning vars for main posting page ... - $template->assign_vars(array( + $template_ary = array( 'L_POST_A' => $page_title, 'L_ICON' => $user->lang['PM_ICON'], 'L_MESSAGE_BODY_EXPLAIN' => $user->lang('MESSAGE_BODY_EXPLAIN', (int) $config['max_post_chars']), @@ -1240,7 +1251,19 @@ function compose_pm($id, $mode, $action, $user_folders = array()) 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup'), 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup')), - )); + ); + + /** + * Modify the default template vars + * + * @event core.ucp_pm_compose_template + * @var array template_ary Template variables + * @since 3.2.6-RC1 + */ + $vars = array('template_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_template', compact($vars))); + + $template->assign_vars($template_ary); // Build custom bbcodes array display_custom_bbcodes(); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index a36bf619f8..9a1284083f 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -469,8 +469,15 @@ class ucp_profile trigger_error('NO_AUTH_SIGNATURE'); } - include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + if (!function_exists('generate_smilies')) + { + include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + } + + if (!function_exists('display_custom_bbcodes')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } $preview = $request->is_set_post('preview'); |