mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Deleting moved topics now works
git-svn-id: file:///svn/phpbb/trunk@890 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5c7b614ee1
commit
1390d48aa3
1 changed files with 8 additions and 0 deletions
|
@ -168,15 +168,18 @@ switch($mode)
|
||||||
|
|
||||||
$sql = "SELECT post_id FROM ".POSTS_TABLE." WHERE ";
|
$sql = "SELECT post_id FROM ".POSTS_TABLE." WHERE ";
|
||||||
$delete_topics = "DELETE FROM ".TOPICS_TABLE." WHERE ";
|
$delete_topics = "DELETE FROM ".TOPICS_TABLE." WHERE ";
|
||||||
|
$moved_topics = "DELETE FROM ".TOPICS_TABLE. " WHERE ";
|
||||||
for($x = 0; $x < count($topics); $x++)
|
for($x = 0; $x < count($topics); $x++)
|
||||||
{
|
{
|
||||||
if($x > 0)
|
if($x > 0)
|
||||||
{
|
{
|
||||||
$sql .= " OR ";
|
$sql .= " OR ";
|
||||||
$delete_topics .= " OR ";
|
$delete_topics .= " OR ";
|
||||||
|
$moved_topics .= " OR ";
|
||||||
}
|
}
|
||||||
$sql .= "topic_id = ".$topics[$x];
|
$sql .= "topic_id = ".$topics[$x];
|
||||||
$delete_topics .= "topic_id = ".$topics[$x];
|
$delete_topics .= "topic_id = ".$topics[$x];
|
||||||
|
$moved_topics .= "topic_moved_id = ".$topics[$x];
|
||||||
}
|
}
|
||||||
$topics_removed = $x;
|
$topics_removed = $x;
|
||||||
|
|
||||||
|
@ -215,6 +218,11 @@ switch($mode)
|
||||||
message_die(GENERAL_ERROR, "Could not delete topics!", "Error", __LINE__, __FILE__, $delete_topics);
|
message_die(GENERAL_ERROR, "Could not delete topics!", "Error", __LINE__, __FILE__, $delete_topics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$result = $db->sql_query($moved_topics))
|
||||||
|
{
|
||||||
|
message_die(GENERAL_ERRORm "Could not delete moved topics!", "Error", __LINE__, __FILE__, $moved_topics);
|
||||||
|
}
|
||||||
|
|
||||||
if(SQL_LAYER != "mysql")
|
if(SQL_LAYER != "mysql")
|
||||||
{
|
{
|
||||||
$update_index = "UPDATE ".FORUMS_TABLE."
|
$update_index = "UPDATE ".FORUMS_TABLE."
|
||||||
|
|
Loading…
Add table
Reference in a new issue