mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Merge pull request #3910 from kinerity/ticket/14170
[ticket/14170] Fix mcp_change_poster_after event
This commit is contained in:
commit
8398e0700a
1 changed files with 12 additions and 11 deletions
|
@ -549,6 +549,18 @@ function change_poster(&$post_info, $userdata)
|
||||||
$from_username = $post_info['username'];
|
$from_username = $post_info['username'];
|
||||||
$to_username = $userdata['username'];
|
$to_username = $userdata['username'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event allows you to perform additional tasks after changing a post's poster
|
||||||
|
*
|
||||||
|
* @event core.mcp_change_poster_after
|
||||||
|
* @var array userdata Information on a post's new poster
|
||||||
|
* @var array post_info Information on the affected post
|
||||||
|
* @since 3.1.6-RC1
|
||||||
|
* @changed 3.1.7-RC1 Change location to prevent post_info from being set to the new post information
|
||||||
|
*/
|
||||||
|
$vars = array('userdata', 'post_info');
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars)));
|
||||||
|
|
||||||
// Renew post info
|
// Renew post info
|
||||||
$post_info = phpbb_get_post_data(array($post_id), false, true);
|
$post_info = phpbb_get_post_data(array($post_id), false, true);
|
||||||
|
|
||||||
|
@ -559,17 +571,6 @@ function change_poster(&$post_info, $userdata)
|
||||||
|
|
||||||
$post_info = $post_info[$post_id];
|
$post_info = $post_info[$post_id];
|
||||||
|
|
||||||
/**
|
|
||||||
* This event allows you to perform additional tasks after changing a post's poster
|
|
||||||
*
|
|
||||||
* @event core.mcp_change_poster_after
|
|
||||||
* @var array userdata Information on a post's new poster
|
|
||||||
* @var array post_info Information on the affected post
|
|
||||||
* @since 3.1.6-RC1
|
|
||||||
*/
|
|
||||||
$vars = array('userdata', 'post_info');
|
|
||||||
extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars)));
|
|
||||||
|
|
||||||
// Now add log entry
|
// Now add log entry
|
||||||
add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username);
|
add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue