diff options
| author | czaks <marcin@6irc.net> | 2013-07-16 13:02:13 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-07-16 13:02:13 -0400 |
| commit | 7bdb96a16b51eb8086fead11783bb095ea42cd90 (patch) | |
| tree | b236bbd6082d927e25ecf4b07ea45bb5e1206a60 /inc/mod/pages.php | |
| parent | 8a598982a4f6ae48ad6e2a4d634314215871c4c1 (diff) | |
| parent | aadb57f2a2db9210468f25d7dcd45d561ef6ad54 (diff) | |
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts:
install.php
templates/index.html
templates/thread.html
Diffstat (limited to 'inc/mod/pages.php')
| -rw-r--r-- | inc/mod/pages.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index f8a730d0..0e261357 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -217,6 +217,19 @@ function mod_edit_board($boardName) { $query = prepare('DELETE FROM `antispam` WHERE `board` = :board'); $query->bindValue(':board', $board['uri']); $query->execute() or error(db_error($query)); + + // Remove board from users/permissions table + $query = query('SELECT `id`,`boards` FROM `mods`') or error(db_error()); + while ($user = $query->fetch(PDO::FETCH_ASSOC)) { + $user_boards = explode(',', $user['boards']); + if (in_array($board['uri'], $user_boards)) { + unset($user_boards[array_search($board['uri'], $user_boards)]); + $_query = prepare('UPDATE `mods` SET `boards` = :boards WHERE `id` = :id'); + $_query->bindValue(':boards', implode(',', $user_boards)); + $_query->bindValue(':id', $user['id']); + $_query->execute() or error(db_error($_query)); + } + } } else { $query = prepare('UPDATE `boards` SET `title` = :title, `subtitle` = :subtitle WHERE `uri` = :uri'); $query->bindValue(':uri', $board['uri']); @@ -725,6 +738,13 @@ function mod_lock($board, $unlock, $post) { buildIndex(); } + if ($config['mod']['dismiss_reports_on_lock']) { + $query = prepare('DELETE FROM `reports` WHERE `board` = :board AND `post` = :id'); + $query->bindValue(':board', $board); + $query->bindValue(':id', $post); + $query->execute() or error(db_error($query)); + } + header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); if ($unlock) @@ -906,8 +926,10 @@ function mod_move($originBoard, $postID) { modLog("Moved thread #${postID} to " . sprintf($config['board_abbreviation'], $targetBoard) . " (#${newID})", $originBoard); - // build new hread + // build new thread buildThread($newID); + + clean(); buildIndex(); // trigger themes |
