small bugfixes

This commit is contained in:
Michael Save 2012-05-19 20:52:45 +10:00
parent 93c3ceb04d
commit d2c6853ed3

View File

@ -175,11 +175,6 @@ function mod_edit_board($boardName) {
$query->bindValue(':uri', $board['uri'], PDO::PARAM_INT); $query->bindValue(':uri', $board['uri'], PDO::PARAM_INT);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
if ($config['cache']['enabled']) {
cache::delete('board_' . $board['uri']);
cache::delete('all_boards');
}
$query = prepare("SELECT `board`, `post` FROM `cites` WHERE `target_board` = :board"); $query = prepare("SELECT `board`, `post` FROM `cites` WHERE `target_board` = :board");
$query->bindValue(':board', $board['uri']); $query->bindValue(':board', $board['uri']);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
@ -207,6 +202,11 @@ function mod_edit_board($boardName) {
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
} }
if ($config['cache']['enabled']) {
cache::delete('board_' . $board['uri']);
cache::delete('all_boards');
}
rebuildThemes('boards'); rebuildThemes('boards');
header('Location: ?/', true, $config['redirect_http']); header('Location: ?/', true, $config['redirect_http']);
@ -249,7 +249,7 @@ function mod_new_board() {
query(Element('posts.sql', array('board' => $board['uri']))) or error(db_error()); query(Element('posts.sql', array('board' => $board['uri']))) or error(db_error());
if ($config['cache']['enabled']) if ($config['cache']['enabled'])
cache::delete('all_boards'); cache::delete('all_boards');
// Build the board // Build the board
buildIndex(); buildIndex();
@ -1189,7 +1189,7 @@ function mod_user_new() {
$query->bindValue(':boards', implode(',', $boards)); $query->bindValue(':boards', implode(',', $boards));
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
$uid = $pdo->lastInsertId(); $userID = $pdo->lastInsertId();
modLog('Created a new user: ' . utf8tohtml($_POST['username']) . ' <small>(#' . $userID . ')</small>'); modLog('Created a new user: ' . utf8tohtml($_POST['username']) . ' <small>(#' . $userID . ')</small>');