summaryrefslogtreecommitdiff
path: root/mod.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-01-20 19:25:11 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-01-20 19:25:11 +1100
commitd7f7b602efc6668557e1c0f544dd3bab0e677122 (patch)
tree295628372abb508da2a3ec2e02ad5389c1b01012 /mod.php
parente1e5dc713e9f7fdf44618f94065290f97357279b (diff)
...
Diffstat (limited to 'mod.php')
-rw-r--r--mod.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/mod.php b/mod.php
index 80647471..04b758f6 100644
--- a/mod.php
+++ b/mod.php
@@ -348,6 +348,23 @@
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'] . 'deletebyip\/(\d+)$/', $query, $matches)) {
+ // Delete all posts by an IP
+
+ $boardName = $matches[1];
+ $post = $matches[2];
+ // Open board
+ if(!openBoard($boardName))
+ error(ERROR_NOBOARD);
+
+ $query = prepare(sprintf("SELECT `id` FROM `posts_%s` WHERE `ip` = :ip", $board['uri']));
+ $query->bindValue(':ip', $ip);
+ $query->execute() or error(db_error($query));
+
+ //if(isset($_SERVER['HTTP_REFERER']))
+ // header('Location: ' . $_SERVER['HTTP_REFERER'], true, REDIRECT_HTTP);
+ //else
+ // header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
} elseif(preg_match('/^\/ban$/', $query)) {
// Ban page