diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-10-08 15:01:20 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-10-08 15:01:20 +0200 |
commit | c525e900d3b96b829c939010db343d8032698011 (patch) | |
tree | 3f37f1b5baa2217f02c1be5a12597568e87657a4 /phpBB/includes | |
parent | 25804eb8e8b17196116e233b2c8ad3b444cfb5ae (diff) | |
download | forums-c525e900d3b96b829c939010db343d8032698011.tar forums-c525e900d3b96b829c939010db343d8032698011.tar.gz forums-c525e900d3b96b829c939010db343d8032698011.tar.bz2 forums-c525e900d3b96b829c939010db343d8032698011.tar.xz forums-c525e900d3b96b829c939010db343d8032698011.zip |
[feature/soft-delete] Allow to update multiple posts with set_post_visibility
PHPBB3-9567
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/content_visibility.php | 15 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 2 |
2 files changed, 11 insertions, 6 deletions
diff --git a/phpBB/includes/content_visibility.php b/phpBB/includes/content_visibility.php index 0d08cb83b6..868400b5f6 100644 --- a/phpBB/includes/content_visibility.php +++ b/phpBB/includes/content_visibility.php @@ -210,8 +210,8 @@ class phpbb_content_visibility * Change visibility status of one post or a hole topic * * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED} - * @param $post_id mixed Post ID to act on, if it is empty, - * all posts of topic_id will be modified + * @param $post_id mixed Post ID or array of post IDs to act on, + * if it is empty, all posts of topic_id will be modified * @param $topic_id int Topic where $post_id is found * @param $forum_id int Forum where $topic_id is found * @param $user_id int User performing the action @@ -234,7 +234,14 @@ class phpbb_content_visibility if ($post_id) { - $where_sql = 'post_id = ' . (int) $post_id; + if (is_array($post_id)) + { + $where_sql = $db->sql_in_set('post_id', array_map('intval', $post_id)); + } + else + { + $where_sql = 'post_id = ' . (int) $post_id; + } } else if ($topic_id) { @@ -382,7 +389,7 @@ class phpbb_content_visibility } /** - * One function to rule them all ... and unhide posts and topics. This could + * One function to rule them all... and unhide posts and topics. This could * reasonably be broken up, I straight copied this code from the mcp_queue.php * file here for global access. * @param $mode - string - member of the set {'approve', 'restore'} diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 9cf7b59ad3..2ae4fe2bd8 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1629,8 +1629,6 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ } } -// $sql_data[USERS_TABLE] = ($data['post_postcount']) ? 'user_posts = user_posts - 1' : ''; - $db->sql_transaction('begin'); $where_sql = array( |