From fdac051956238ccd30a51641f4332a012eaf4a6e Mon Sep 17 00:00:00 2001 From: David King Date: Sun, 8 Dec 2013 14:42:46 -0500 Subject: [ticket/12069] Add core.submit_post_end event PHPBB3-12069 --- phpBB/includes/functions_posting.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'phpBB/includes/functions_posting.php') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 1bcef7f1f2..e71b44a45b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2305,6 +2305,23 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx"; $url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor; + /** + * This event is used for performing actions directly after a post or topic + * has been submitted. When a new topic is posted, the topic ID is + * available in the $data array. + * + * The only action that can be done by altering data made available to this + * event is to modify the return URL ($urL). + * + * @event core.submit_post_end + * @var string url The "Return to topic" URL + * @var array data Array of post data about the + * submitted post + * @since 3.1-A2 + */ + $vars = array('url', 'data'); + extract($phpbb_dispatcher->trigger_event('core.submit_post_end', compact($vars))); + return $url; } -- cgit v1.2.1 From 0b76880816f6f06ee41c4cc99c4a481a04ec459f Mon Sep 17 00:00:00 2001 From: David King Date: Sun, 8 Dec 2013 15:01:53 -0500 Subject: [ticket/12069] Fix event documentation PHPBB3-12069 --- phpBB/includes/functions_posting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_posting.php') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index e71b44a45b..1c4fe1ca70 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2311,13 +2311,13 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u * available in the $data array. * * The only action that can be done by altering data made available to this - * event is to modify the return URL ($urL). + * event is to modify the return URL ($url). * * @event core.submit_post_end * @var string url The "Return to topic" URL * @var array data Array of post data about the * submitted post - * @since 3.1-A2 + * @since 3.1-A3 */ $vars = array('url', 'data'); extract($phpbb_dispatcher->trigger_event('core.submit_post_end', compact($vars))); -- cgit v1.2.1 From 6b081433c5ffc68ae8e46fadce0bc565e736437f Mon Sep 17 00:00:00 2001 From: David King Date: Sun, 8 Dec 2013 15:08:30 -0500 Subject: [ticket/12069] Globalize in submit_post() PHPBB3-12069 --- phpBB/includes/functions_posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_posting.php') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 1c4fe1ca70..172f4403ac 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1473,7 +1473,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ */ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true) { - global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container; + global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher; // We do not handle erasing posts here if ($mode == 'delete') -- cgit v1.2.1