forked from leftypol/leftypol
add some stuff to the api, to match vichan's api at the request of a user. fixed the delete-stray-images script
This commit is contained in:
parent
57df86557a
commit
f1a48042c2
2 changed files with 5 additions and 2 deletions
|
@ -95,6 +95,9 @@ class Api {
|
|||
|
||||
$this->translateFields($this->fileFields, $file, $apiPost);
|
||||
$apiPost['filename'] = @substr($file->name, 0, strrpos($file->name, '.'));
|
||||
$dotPos = strrpos($file->file, '.');
|
||||
$apiPost['ext'] = substr($file->file, $dotPos);
|
||||
$apiPost['tim'] = substr($file->file, 0, $dotPos);
|
||||
if (isset ($file->thumb) && $file->thumb) {
|
||||
$apiPost['spoiler'] = $file->thumb === 'spoiler';
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ foreach ($boards as $board) {
|
|||
$valid_thumb = array();
|
||||
|
||||
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
$files = json_decode($post['files']);
|
||||
$files = json_decode($post['files']);
|
||||
foreach ($files as $i => $f) {
|
||||
if ($f->file != 'deleted' && $f->file != 'spoiler' && $f->file != 'file'){
|
||||
$valid_src[] = $f->filename;
|
||||
$valid_src[] = $f->file;
|
||||
$valid_thumb[] = $f->thumb;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue