mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 22:38:52 +00:00
Merge pull request #3786 from marc1706/ticket/13311
[ticket/13311] Add core event on acp_forums for forum content deletes
This commit is contained in:
commit
e686f8bbdf
1 changed files with 19 additions and 1 deletions
|
@ -1786,7 +1786,7 @@ class acp_forums
|
||||||
*/
|
*/
|
||||||
function delete_forum_content($forum_id)
|
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);
|
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);
|
$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.6-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)
|
foreach ($table_ary as $table)
|
||||||
{
|
{
|
||||||
$db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id");
|
$db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id");
|
||||||
|
|
Loading…
Add table
Reference in a new issue