aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_forums.php
diff options
context:
space:
mode:
authoralf007 <alf007@free.fr>2015-05-15 19:45:28 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-07-22 09:25:19 +0200
commite30c6caac8ea71086625348c39e25f000cf531d6 (patch)
treec741b17c0afd04b0a1881f396cfce9416691e2b4 /phpBB/includes/acp/acp_forums.php
parent6b658874bb6d502acfc68e74ca2eca643acac579 (diff)
downloadforums-e30c6caac8ea71086625348c39e25f000cf531d6.tar
forums-e30c6caac8ea71086625348c39e25f000cf531d6.tar.gz
forums-e30c6caac8ea71086625348c39e25f000cf531d6.tar.bz2
forums-e30c6caac8ea71086625348c39e25f000cf531d6.tar.xz
forums-e30c6caac8ea71086625348c39e25f000cf531d6.zip
[ticket/13311] Add core event on acp_forums for forum content deletes
Event added for the function delete_forum_content() in includes/acp/acp_forums.php, so that you can insert any extension's table(s) to be updated when forum content is deleted Incude parameters forum_id, topic_ids and post_counts PHPBB3-13311
Diffstat (limited to 'phpBB/includes/acp/acp_forums.php')
-rw-r--r--phpBB/includes/acp/acp_forums.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index adf5de44f5..d457c5dd70 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -1786,7 +1786,7 @@ class acp_forums
*/
function delete_forum_content($forum_id)
{
- global $db, $config, $phpbb_root_path, $phpEx;
+ global $db, $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -1918,6 +1918,24 @@ class acp_forums
$table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE);
+ /**
+ * Perform additional actions before forum content deletion
+ *
+ * @event core.delete_forum_content_before_query
+ * @var array table_ary Array of tables from which all rows will be deleted that hold the forum_id
+ * @var int forum_id the forum id
+ * @var array topic_ids Array of the topic ids from the forum to be deleted
+ * @var array post_counts Array of counts of posts in the forum, by poster_id
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'table_ary',
+ 'forum_id',
+ 'topic_ids',
+ 'post_counts',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_forum_content_before_query', compact($vars)));
+
foreach ($table_ary as $table)
{
$db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id");