1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-12 11:40:26 +01:00

[ticket/15925] Add core.mcp_main_modify_fork_post_sql

Modify the forked post's sql array before it's inserted into the database
Lets additional variables be added into the sql_ary
Allows the same edits as mcp_main_fork_sql_after but for posts not topics

PHPBB3-15925
This commit is contained in:
Alec 2019-01-12 06:48:57 -05:00 committed by Marc Alexander
parent 66cbf2607b
commit 9d2ab88c69
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -1563,6 +1563,26 @@ function mcp_fork_topic($topic_ids)
$counter[$row['poster_id']] = 1; $counter[$row['poster_id']] = 1;
} }
} }
/**
* Modify the forked post's sql array before it's inserted into the database.
*
* @event core.mcp_main_modify_fork_post_sql
* @var int new_topic_id The newly created topic ID
* @var int to_forum_id The forum ID where the forked topic has been moved to
* @var array sql_ary SQL Array with the post's data
* @var array row Post data
* @var array counter Array with post counts
* @since 3.2.6-RC1
*/
$vars = array(
'new_topic_id',
'to_forum_id',
'sql_ary',
'row',
'counter',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_fork_post_sql', compact($vars)));
$db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); $db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_post_id = $db->sql_nextid(); $new_post_id = $db->sql_nextid();