diff options
| author | ctrlcctrlv <wizardchan@hush.com> | 2013-08-08 19:41:21 +0000 |
|---|---|---|
| committer | ctrlcctrlv <wizardchan@hush.com> | 2013-08-08 19:41:21 +0000 |
| commit | a59c2e83698d604456fbc85b8a118f7d312cfb39 (patch) | |
| tree | b8d2e335961ec3d01a2b5244f203cf69224461e5 /inc/mod/pages.php | |
| parent | 7205801ced0f3b09166f388362f253a613b5ceb2 (diff) | |
Spoil files moderator action
Diffstat (limited to 'inc/mod/pages.php')
| -rw-r--r-- | inc/mod/pages.php | 27 |
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; |
