summaryrefslogtreecommitdiff
path: root/mod.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-01-15 15:05:58 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-01-15 15:05:58 +1100
commita0ef70beab3ddcc1d61016d65f9687594d0db5b9 (patch)
treecc92118da847b3d01a585dd80c6459ea3169f631 /mod.php
parentee6af9bfba49c8a70d5bc3a1e348dcf237e241ca (diff)
"ban&delete"
Diffstat (limited to 'mod.php')
-rw-r--r--mod.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/mod.php b/mod.php
index 41e593c9..ecdfedcf 100644
--- a/mod.php
+++ b/mod.php
@@ -348,12 +348,13 @@
header('Location: ' . $_SERVER['HTTP_REFERER'], true, REDIRECT_HTTP);
else
header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
- } elseif(preg_match('/^\/' . $regex['board'] . 'ban\/(\d+)$/', $query, $matches)) {
+ } elseif(preg_match('/^\/' . $regex['board'] . 'ban(&delete)\/(\d+)$/', $query, $matches)) {
if($mod['type'] < MOD_DELETE) error(ERROR_NOACCESS);
// Ban by post
$boardName = $matches[1];
- $post = $matches[2];
+ $delete = isset($matches[2]) && $matches[2] == '&delete';
+ $post = $matches[3];
// Open board
if(!openBoard($boardName))
error(ERROR_NOBOARD);
@@ -427,6 +428,10 @@
}
$query->execute() or error(db_error($query));
+ // Delete too
+ if($delete)
+ deletePost($post['id']);
+
// Redirect
if(isset($_POST['continue']))
header('Location: ' . $_POST['continue'], true, REDIRECT_HTTP);