[feature/soft-delete] Allow to update multiple posts with set_post_visibility

PHPBB3-9567
This commit is contained in:
Joas Schilling 2012-10-08 15:01:20 +02:00
parent 25804eb8e8
commit c525e900d3
2 changed files with 11 additions and 6 deletions

View file

@ -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
@ -233,9 +233,16 @@ class phpbb_content_visibility
}
if ($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)
{
$where_sql = 'topic_id = ' . (int) $topic_id;

View file

@ -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(