summaryrefslogtreecommitdiff
path: root/inc/mod/pages.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/mod/pages.php')
-rw-r--r--inc/mod/pages.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index 706d747d..8b0c400e 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1360,6 +1360,33 @@ function mod_deletefile($board, $post) {
header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']);
}
+function mod_spoiler_image($board, $post) {
+ global $config, $mod;
+
+ if (!openBoard($board))
+ error($config['error']['noboard']);
+
+ if (!hasPermission($config['mod']['spoilerimage'], $board))
+ error($config['error']['noaccess']);
+
+ // Delete file
+ $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = :thumb, `thumbwidth` = :thumbwidth, `thumbheight` = :thumbheight WHERE `id` = :id", $board));
+ $query->bindValue(':thumb', "spoiler");
+ $query->bindValue(':thumbwidth', 128, PDO::PARAM_INT);
+ $query->bindValue(':thumbheight', 128, PDO::PARAM_INT);
+ $query->bindValue(':id', $post, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+
+ // Record the action
+ modLog("Spoilered file from post #{$post}");
+
+ // Rebuild board
+ buildIndex();
+
+ // Redirect
+ header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']);
+}
+
function mod_deletebyip($boardName, $post, $global = false) {
global $config, $mod, $board;