From c3de0f1febc49db3f2a88e71f5baf7ef883897c2 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Mon, 18 Jan 2021 01:30:20 -0600 Subject: [PATCH] Removes rebuilds after each deleted post when deleting by IP. --- inc/mod/pages.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index ef0c00cc..140ec48c 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2528,9 +2528,11 @@ function mod_deletebyip($boardName, $post, $global = false) { @set_time_limit($config['mod']['rebuild_timelimit']); + $boards_to_rebuild = array(); $threads_to_rebuild = array(); $threads_deleted = array(); while ($post = $query->fetch(PDO::FETCH_ASSOC)) { + $boards_to_rebuild[$post['board']] = true; openBoard($post['board']); if ($config['autotagging']){ $query2 = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE id = :id", $post['board'])); @@ -2576,10 +2578,6 @@ function mod_deletebyip($boardName, $post, $global = false) { deletePostShadow($post['id'], false, false); - rebuildThemes('post-delete', $board['uri']); - - buildIndex(); - if ($post['thread']) $threads_to_rebuild[$post['board']][$post['thread']] = true; else @@ -2592,6 +2590,11 @@ function mod_deletebyip($boardName, $post, $global = false) { if ($_dummy && !isset($threads_deleted[$_board][$_thread])) buildThread($_thread); } + } + + foreach(array_keys($boards_to_rebuild) as $_board) { + openBoard($_board); + rebuildThemes('post-delete', $board['uri']); buildIndex(); }