From 72beacc1da12d3851330e229ff43c8ec6f2ce352 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 21 Aug 2013 20:54:46 +1000 Subject: allow moving threads with non-image uploads --- inc/mod/pages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 63e7266e..7df8f316 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1048,7 +1048,7 @@ function mod_move($originBoard, $postID) { if ($post['has_file']) { // copy image $clone($file_src, sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']); - if (!in_array($post['thumb'], array('spoiler', 'deleted'))) + if (!in_array($post['thumb'], array('spoiler', 'deleted', 'file'))) $clone($file_thumb, sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']); } -- cgit v1.3 From 54a8c721212e279f47d786168b1c38bd9c28e8ed Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 21 Aug 2013 21:34:18 +1000 Subject: Huge bug with deleting boards: $tmp_board unused; sometimes it would delete the wrong board's directory --- inc/mod/pages.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 7df8f316..706513a3 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -379,7 +379,7 @@ function mod_edit_board($boardName) { $query->bindValue(':uri', $board['uri'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); - $query = prepare("SELECT `board`, `post` FROM ``cites`` WHERE `target_board` = :board"); + $query = prepare("SELECT `board`, `post` FROM ``cites`` WHERE `target_board` = :board ORDER BY `board`"); $query->bindValue(':board', $board['uri']); $query->execute() or error(db_error($query)); while ($cite = $query->fetch(PDO::FETCH_ASSOC)) { @@ -391,6 +391,9 @@ function mod_edit_board($boardName) { } } + if (isset($tmp_board)) + $board = $tmp_board; + $query = prepare('DELETE FROM ``cites`` WHERE `board` = :board OR `target_board` = :board'); $query->bindValue(':board', $board['uri']); $query->execute() or error(db_error($query)); -- cgit v1.3 From 08bb2894bc358600eeaa03014080c3c2dd910cef Mon Sep 17 00:00:00 2001 From: Dan Saunders Date: Sun, 25 Aug 2013 23:50:29 -0400 Subject: Rebuild themes when a post or file is deleted... Rebuild themes when a post or file is deleted in the moderation panel. --- inc/mod/pages.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 706513a3..5ee8221b 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1241,6 +1241,8 @@ function mod_ban_post($board, $delete, $post, $token = false) { modLog("Deleted post #{$post}"); // Rebuild board buildIndex(); + // Rebuild themes + rebuildThemes('post-delete', $board['uri']); } header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); @@ -1333,7 +1335,8 @@ function mod_delete($board, $post) { modLog("Deleted post #{$post}"); // Rebuild board buildIndex(); - + // Rebuild themes + rebuildThemes('post-delete', $board['uri']); // Redirect header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); } @@ -1354,6 +1357,8 @@ function mod_deletefile($board, $post) { // Rebuild board buildIndex(); + // Rebuild themes + rebuildThemes('post-delete', $board['uri']); // Redirect header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); @@ -1392,6 +1397,9 @@ function mod_spoiler_image($board, $post) { // Rebuild board buildIndex(); + + // Rebuild themes + rebuildThemes('post-delete', $board['uri']); // Redirect header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); @@ -1442,6 +1450,8 @@ function mod_deletebyip($boardName, $post, $global = false) { deletePost($post['id'], false, false); + rebuildThemes('post-delete', $board['uri']); + if ($post['thread']) $threads_to_rebuild[$post['board']][$post['thread']] = true; else -- cgit v1.3 From 00a1841cbc6fb76cd96c51142a3a1b86a073d58a Mon Sep 17 00:00:00 2001 From: Dan Saunders Date: Mon, 26 Aug 2013 00:36:41 -0400 Subject: Regenerate themes after editing a post --- inc/mod/pages.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 5ee8221b..3305e0c2 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1306,6 +1306,8 @@ function mod_edit_post($board, $edit_raw_html, $postID) { } buildIndex(); + + rebuildThemes('post', $board['uri']); header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $postID) . '#' . $postID, true, $config['redirect_http']); } else { -- cgit v1.3 From 6ce78cb1a454e8556580eaf6b253e1111f848ac0 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Tue, 27 Aug 2013 17:27:17 +1000 Subject: Bugfix: post editing: should be $board here, not $board['uri'] --- inc/mod/pages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 3305e0c2..105061e9 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1307,7 +1307,7 @@ function mod_edit_post($board, $edit_raw_html, $postID) { buildIndex(); - rebuildThemes('post', $board['uri']); + rebuildThemes('post', $board); header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $postID) . '#' . $postID, true, $config['redirect_http']); } else { -- cgit v1.3