mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-12 01:50:48 +01:00
Merge branch 'master' of http://github.com/ctrlcctrlv/Tinyboard
This commit is contained in:
commit
6e26c76c56
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user