diff options
| author | czaks <marcin@6irc.net> | 2013-08-28 12:41:36 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-08-28 12:41:36 -0400 |
| commit | 8503e65858ce3145a11f8daec4104e3a7249c889 (patch) | |
| tree | c619ac3da567cacb96ed9b95a75bb3c1cbbcc87a /inc/mod/pages.php | |
| parent | 753b67aa71963f32ec3c3bc7c18f53bb00f2e4f8 (diff) | |
| parent | 7a4e481333c3ab39ea63c2d961a7c05016b12460 (diff) | |
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts:
inc/config.php
inc/functions.php
install.php
stylesheets/dark_roach.css
Diffstat (limited to 'inc/mod/pages.php')
| -rw-r--r-- | inc/mod/pages.php | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 2ca7eb55..8940f684 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)); @@ -1156,7 +1159,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']); } @@ -1346,6 +1349,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']); @@ -1409,6 +1414,8 @@ function mod_edit_post($board, $edit_raw_html, $postID) { } buildIndex(); + + 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 { @@ -1438,7 +1445,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']); } @@ -1459,6 +1467,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']); @@ -1497,6 +1507,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']); @@ -1547,6 +1560,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 |
