diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2015-03-07 21:23:57 +0100 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2015-03-07 21:23:57 +0100 |
| commit | 2348580255b19919e2b0d22143be72494a79e527 (patch) | |
| tree | c1e67f5304f5ec9cc6458929963614bbdfa7c18d /phpBB/includes/functions_admin.php | |
| parent | d7f4715b96f2d43f7469e54b7c27bc3415a84a24 (diff) | |
| parent | 2ad87c662f3d9312f7dc997a976906f7aa461a62 (diff) | |
| download | forums-2348580255b19919e2b0d22143be72494a79e527.tar forums-2348580255b19919e2b0d22143be72494a79e527.tar.gz forums-2348580255b19919e2b0d22143be72494a79e527.tar.bz2 forums-2348580255b19919e2b0d22143be72494a79e527.tar.xz forums-2348580255b19919e2b0d22143be72494a79e527.zip | |
Merge pull request #3452 from RobertHeim/ticket/13658
[ticket/13658] add event before and after topics are deleted
Diffstat (limited to 'phpBB/includes/functions_admin.php')
| -rw-r--r-- | phpBB/includes/functions_admin.php | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index b016659541..79f9db2f3f 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -618,7 +618,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) */ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true) { - global $db, $config, $phpbb_container; + global $db, $config, $phpbb_container, $phpbb_dispatcher; $approved_topics = 0; $forum_ids = $topic_ids = array(); @@ -672,6 +672,20 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s $table_ary = array(BOOKMARKS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, POLL_VOTES_TABLE, POLL_OPTIONS_TABLE, TOPICS_WATCH_TABLE, TOPICS_TABLE); + /** + * Perform additional actions before topic(s) deletion + * + * @event core.delete_topics_before_query + * @var array table_ary Array of tables from which all rows will be deleted that hold a topic_id occuring in topic_ids + * @var array topic_ids Array of topic ids to delete + * @since 3.1.4-RC1 + */ + $vars = array( + 'table_ary', + 'topic_ids', + ); + extract($phpbb_dispatcher->trigger_event('core.delete_topics_before_query', compact($vars))); + foreach ($table_ary as $table) { $sql = "DELETE FROM $table @@ -680,6 +694,18 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s } unset($table_ary); + /** + * Perform additional actions after topic(s) deletion + * + * @event core.delete_topics_after_query + * @var array topic_ids Array of topic ids that were deleted + * @since 3.1.4-RC1 + */ + $vars = array( + 'topic_ids', + ); + extract($phpbb_dispatcher->trigger_event('core.delete_topics_after_query', compact($vars))); + $moved_topic_ids = array(); // update the other forums |
