1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-12 01:50:48 +01:00
This commit is contained in:
czaks 2013-08-11 17:32:57 -04:00
commit 6e26c76c56
3 changed files with 20 additions and 2 deletions

View File

@ -1124,6 +1124,8 @@
$config['mod']['bandelete'] = MOD;
// Remove bans
$config['mod']['unban'] = MOD;
// Spoiler file (and keep post)
$config['mod']['spoilerfile'] = JANITOR;
// Delete file (and keep post)
$config['mod']['deletefile'] = JANITOR;
// Spoiler image

View File

@ -1466,6 +1466,14 @@ function mod_spoiler_image($board, $post) {
error($config['error']['noaccess']);
// Delete file
$query = prepare(sprintf("SELECT `thumb`, `thread` FROM ``posts_%s`` WHERE id = :id", $board));
$query->bindValue(':id', $post, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
$result = $query->fetch(PDO::FETCH_ASSOC);
file_unlink($board . '/' . $config['dir']['thumb'] . $result['thumb']);
// Make thumbnail spoiler
$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);
@ -1475,7 +1483,10 @@ function mod_spoiler_image($board, $post) {
// Record the action
modLog("Spoilered file from post #{$post}");
// Rebuild thread
buildThread($result['thread'] ? $result['thread'] : $post);
// Rebuild board
buildIndex();

View File

@ -3,8 +3,13 @@
function catalog() {
var board = $("input[name='board']");
if (board) {
if (board.length>0) {
if (window.location.href.indexOf("/res/")==-1){ //if we are inside a thread
var catalog_url = 'catalog.html';
}
else {
var catalog_url = '../catalog.html';
}
var pages = document.getElementsByClassName('pages')[0];
var bottom = document.getElementsByClassName('boardlist bottom')[0]
var subtitle = document.getElementsByClassName('subtitle')[0];