Merge branch 'master' of http://github.com/ctrlcctrlv/Tinyboard
This commit is contained in:
commit
6e26c76c56
@ -1124,6 +1124,8 @@
|
|||||||
$config['mod']['bandelete'] = MOD;
|
$config['mod']['bandelete'] = MOD;
|
||||||
// Remove bans
|
// Remove bans
|
||||||
$config['mod']['unban'] = MOD;
|
$config['mod']['unban'] = MOD;
|
||||||
|
// Spoiler file (and keep post)
|
||||||
|
$config['mod']['spoilerfile'] = JANITOR;
|
||||||
// Delete file (and keep post)
|
// Delete file (and keep post)
|
||||||
$config['mod']['deletefile'] = JANITOR;
|
$config['mod']['deletefile'] = JANITOR;
|
||||||
// Spoiler image
|
// Spoiler image
|
||||||
|
@ -1466,6 +1466,14 @@ function mod_spoiler_image($board, $post) {
|
|||||||
error($config['error']['noaccess']);
|
error($config['error']['noaccess']);
|
||||||
|
|
||||||
// Delete file
|
// 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 = prepare(sprintf("UPDATE ``posts_%s`` SET `thumb` = :thumb, `thumbwidth` = :thumbwidth, `thumbheight` = :thumbheight WHERE `id` = :id", $board));
|
||||||
$query->bindValue(':thumb', "spoiler");
|
$query->bindValue(':thumb', "spoiler");
|
||||||
$query->bindValue(':thumbwidth', 128, PDO::PARAM_INT);
|
$query->bindValue(':thumbwidth', 128, PDO::PARAM_INT);
|
||||||
@ -1476,6 +1484,9 @@ function mod_spoiler_image($board, $post) {
|
|||||||
// Record the action
|
// Record the action
|
||||||
modLog("Spoilered file from post #{$post}");
|
modLog("Spoilered file from post #{$post}");
|
||||||
|
|
||||||
|
// Rebuild thread
|
||||||
|
buildThread($result['thread'] ? $result['thread'] : $post);
|
||||||
|
|
||||||
// Rebuild board
|
// Rebuild board
|
||||||
buildIndex();
|
buildIndex();
|
||||||
|
|
||||||
|
@ -3,8 +3,13 @@
|
|||||||
function catalog() {
|
function catalog() {
|
||||||
var board = $("input[name='board']");
|
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';
|
var catalog_url = 'catalog.html';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var catalog_url = '../catalog.html';
|
||||||
|
}
|
||||||
var pages = document.getElementsByClassName('pages')[0];
|
var pages = document.getElementsByClassName('pages')[0];
|
||||||
var bottom = document.getElementsByClassName('boardlist bottom')[0]
|
var bottom = document.getElementsByClassName('boardlist bottom')[0]
|
||||||
var subtitle = document.getElementsByClassName('subtitle')[0];
|
var subtitle = document.getElementsByClassName('subtitle')[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user