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 diff --git a/templates/index.html b/templates/index.html index d0702ba9..acca2408 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,6 +8,7 @@ +

{board[url]} - {board[name]}

{board[title]?{board[title]}}

{mod?Return to dashboard}

@@ -38,7 +39,7 @@ - + diff --git a/templates/thread.html b/templates/thread.html index e1260ff5..82867ec2 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -8,6 +8,7 @@ +

{board[url]} - {board[name]}

{board[title]?{board[title]}}

{mod?Return to dashboard}

@@ -39,7 +40,7 @@ - +