From 8e1102b1da2652e88906a1cc6ecd47acec3fab7a Mon Sep 17 00:00:00 2001 From: Richard McGirr Date: Thu, 5 May 2016 05:26:19 -0400 Subject: [ticket/14624] Add event to ucp_profile in signature section PHPBB3-14624 --- phpBB/includes/ucp/ucp_profile.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 2708a8dedf..3e21618b27 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -492,6 +492,32 @@ class ucp_profile $error[] = 'FORM_INVALID'; } + /** + * Modify user signature on editing profile in UCP + * + * @event core.ucp_profile_modify_signature + * @var bool enable_bbcode Whether or not bbcode is enabled + * @var bool enable_smilies Whether or not smilies are enabled + * @var bool enable_urls Whether or not urls are enabled + * @var string signature Users signature text + * @var object message_parser The message parser object + * @var array error Any error strings + * @var bool submit Whether or not the form has been sumitted + * @var bool preview Whether or not the signature is being previewed + * @since 3.1.9 + */ + $vars = array( + 'enable_bbocde', + 'enable_smilies', + 'enable_urls', + 'signature', + 'message_parser', + 'error', + 'submit', + 'preview', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature', compact($vars))); + if (!sizeof($error) && $submit) { $user->optionset('sig_bbcode', $enable_bbcode); -- cgit v1.2.1 From aa3c5286cd572a5dd695a5d60932d52c7b89fe5c Mon Sep 17 00:00:00 2001 From: Richard McGirr Date: Thu, 5 May 2016 06:09:11 -0400 Subject: [ticket/14624] Move event so it actually works PHPBB3-14624 --- phpBB/includes/ucp/ucp_profile.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 3e21618b27..fa60b2ea30 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -479,19 +479,6 @@ class ucp_profile { $message_parser = new parse_message($signature); - // Allowing Quote BBCode - $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig'); - - if (sizeof($message_parser->warn_msg)) - { - $error[] = implode('
', $message_parser->warn_msg); - } - - if (!check_form_key('ucp_sig')) - { - $error[] = 'FORM_INVALID'; - } - /** * Modify user signature on editing profile in UCP * @@ -517,6 +504,19 @@ class ucp_profile 'preview', ); extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature', compact($vars))); + + // Allowing Quote BBCode + $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig'); + + if (sizeof($message_parser->warn_msg)) + { + $error[] = implode('
', $message_parser->warn_msg); + } + + if (!check_form_key('ucp_sig')) + { + $error[] = 'FORM_INVALID'; + } if (!sizeof($error) && $submit) { -- cgit v1.2.1 From c3b30144e393e9b7d4085e51f520b1f4ae989929 Mon Sep 17 00:00:00 2001 From: Richard McGirr Date: Thu, 5 May 2016 06:10:56 -0400 Subject: [ticket/14624] Fix typo and phpBB version PHPBB3-14624 --- phpBB/includes/ucp/ucp_profile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index fa60b2ea30..f4a801363e 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -491,10 +491,10 @@ class ucp_profile * @var array error Any error strings * @var bool submit Whether or not the form has been sumitted * @var bool preview Whether or not the signature is being previewed - * @since 3.1.9 + * @since 3.1.10-RC1 */ $vars = array( - 'enable_bbocde', + 'enable_bbcode', 'enable_smilies', 'enable_urls', 'signature', -- cgit v1.2.1 From c0f34638193c375103ec6c75c4429583d3b0e05f Mon Sep 17 00:00:00 2001 From: Richard McGirr Date: Thu, 5 May 2016 06:42:28 -0400 Subject: [ticket/14624] Remove whitespace PHPBB3-14624 --- phpBB/includes/ucp/ucp_profile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index f4a801363e..fcb29832d4 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -504,10 +504,10 @@ class ucp_profile 'preview', ); extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature', compact($vars))); - + // Allowing Quote BBCode $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig'); - + if (sizeof($message_parser->warn_msg)) { $error[] = implode('
', $message_parser->warn_msg); -- cgit v1.2.1 From c7bbcd7b84ad142a1fb804558c549a1e295a21ee Mon Sep 17 00:00:00 2001 From: Richard McGirr Date: Fri, 6 May 2016 06:31:35 -0400 Subject: [ticket/14630] Add event to modify pm message https://tracker.phpbb.com/browse/PHPBB3-14630 PHPBB3-14630 --- phpBB/includes/ucp/ucp_pm_compose.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index aae80b0c06..62ea82bf1f 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -751,6 +751,34 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1; $enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false); + /** + * Modify Private message + * + * @event core.ucp_pm_compose_modify_private_message + * @var bool enable_bbcode Whether or not bbcode is enabled + * @var bool enable_smilies Whether or not smilies are enabled + * @var bool enable_urls Whether or not urls are enabled + * @var bool enable_sig Whether or not signature is enabled + * @var string subject PM subject text + * @var object message_parser The message parser object + * @var bool submit Whether or not the form has been sumitted + * @var bool preview Whether or not the signature is being previewed + * @var string error Any error strings + * @since 3.1.10-RC1 + */ + $vars = array( + 'enable_bbcode', + 'enable_smilies', + 'enable_urls', + 'enable_sig', + 'subject', + 'message_parser', + 'submit', + 'preview', + 'error', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_private_message', compact($vars))); + if ($submit) { $status_switch = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); -- cgit v1.2.1 From 06507f9fa63ddacc3aec611247cfaaaa06ea3231 Mon Sep 17 00:00:00 2001 From: Richard McGirr Date: Mon, 16 May 2016 17:57:26 -0400 Subject: [ticket/14630] Change event name and fix capitalization PHPBB3-14630 --- phpBB/includes/ucp/ucp_pm_compose.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 62ea82bf1f..f9990a7ad0 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -752,9 +752,9 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false); /** - * Modify Private message + * Modify private message * - * @event core.ucp_pm_compose_modify_private_message + * @event core.ucp_pm_compose_modify_submit_before * @var bool enable_bbcode Whether or not bbcode is enabled * @var bool enable_smilies Whether or not smilies are enabled * @var bool enable_urls Whether or not urls are enabled @@ -777,7 +777,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) 'preview', 'error', ); - extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_private_message', compact($vars))); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_submit_before', compact($vars))); if ($submit) { -- cgit v1.2.1 From e6e4c0e62d9767f0e5d886a8c8029cf88380132f Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 23 May 2016 17:51:26 +0200 Subject: [ticket/13978] Add core.ucp_profile_modify_signature_sql_ary PHPBB3-13978 --- phpBB/includes/ucp/ucp_profile.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index fcb29832d4..0be1930f1a 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -531,6 +531,16 @@ class ucp_profile 'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield ); + /** + * Modify user registration data before submitting it to the database + * + * @event core.ucp_profile_modify_signature_sql_ary + * @var array sql_ary Array with user signature data to submit to the database + * @since 3.1.10-RC1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature_sql_ary', compact($vars))); + $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $user->data['user_id']; -- cgit v1.2.1 From 08acf2acba01d997239712acd245ff96e2770acb Mon Sep 17 00:00:00 2001 From: Richard McGirr Date: Thu, 2 Jun 2016 05:18:14 -0400 Subject: [ticket/14630] Rename core event PHPBB3-14630 --- phpBB/includes/ucp/ucp_pm_compose.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index f9990a7ad0..d365e8b489 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -754,7 +754,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) /** * Modify private message * - * @event core.ucp_pm_compose_modify_submit_before + * @event core.ucp_pm_compose_modify_parse_before * @var bool enable_bbcode Whether or not bbcode is enabled * @var bool enable_smilies Whether or not smilies are enabled * @var bool enable_urls Whether or not urls are enabled @@ -763,7 +763,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) * @var object message_parser The message parser object * @var bool submit Whether or not the form has been sumitted * @var bool preview Whether or not the signature is being previewed - * @var string error Any error strings + * @var array error Any error strings * @since 3.1.10-RC1 */ $vars = array( @@ -777,7 +777,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) 'preview', 'error', ); - extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_submit_before', compact($vars))); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_parse_before', compact($vars))); if ($submit) { -- cgit v1.2.1