mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 15:45:34 +02:00
grmbl... another way to get your forum out of sync. ;)
git-svn-id: file:///svn/phpbb/trunk@4663 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
6a701d1cf5
commit
5f91c611d7
@ -591,6 +591,8 @@ function delete_attachments($mode, $ids, $resync = TRUE)
|
|||||||
$topic_ids = array_unique($topic_ids);
|
$topic_ids = array_unique($topic_ids);
|
||||||
|
|
||||||
// Update post indicators
|
// Update post indicators
|
||||||
|
if (sizeof($post_ids))
|
||||||
|
{
|
||||||
if ($mode == 'post' || $mode == 'topic')
|
if ($mode == 'post' || $mode == 'topic')
|
||||||
{
|
{
|
||||||
$db->sql_query('UPDATE ' . POSTS_TABLE . '
|
$db->sql_query('UPDATE ' . POSTS_TABLE . '
|
||||||
@ -614,14 +616,17 @@ function delete_attachments($mode, $ids, $resync = TRUE)
|
|||||||
$db->sql_fetchrow($result);
|
$db->sql_fetchrow($result);
|
||||||
|
|
||||||
$unset_ids = array_diff($post_ids, $remaining);
|
$unset_ids = array_diff($post_ids, $remaining);
|
||||||
if (sizeof($delete_ids))
|
if (sizeof($unset_ids))
|
||||||
{
|
{
|
||||||
$db->sql_query('UPDATE ' . POSTS_TABLE . '
|
$db->sql_query('UPDATE ' . POSTS_TABLE . '
|
||||||
SET post_attachment = 0
|
SET post_attachment = 0
|
||||||
WHERE post_id IN (' . implode(', ', $unset_ids) . ')');
|
WHERE post_id IN (' . implode(', ', $unset_ids) . ')');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sizeof($topic_ids))
|
||||||
|
{
|
||||||
// Update topic indicator
|
// Update topic indicator
|
||||||
if ($mode == 'topic')
|
if ($mode == 'topic')
|
||||||
{
|
{
|
||||||
@ -653,6 +658,7 @@ function delete_attachments($mode, $ids, $resync = TRUE)
|
|||||||
WHERE topic_id IN (' . implode(', ', $unset_ids) . ')');
|
WHERE topic_id IN (' . implode(', ', $unset_ids) . ')');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $num_deleted;
|
return $num_deleted;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user