|
|
@ -112,13 +112,17 @@ class Api { |
|
|
|
$apiPost['file_path'] = $config['uri_img'] . $file->file; |
|
|
|
|
|
|
|
// Pick the correct thumbnail |
|
|
|
if (!isset ($file->thumb) || $file->thumb === 'file') { |
|
|
|
if (isset($file->thumb)) { |
|
|
|
if ($file->thumb === 'spoiler') { |
|
|
|
$apiPost['thumb_path'] = $config['root'] . $config['spoiler_image']; |
|
|
|
} else if ($file->thumb === 'file') { |
|
|
|
$thumbFile = $config['file_icons']['default']; |
|
|
|
if (isset($file->extension) && isset($config['file_icons'][$file->extension])) { |
|
|
|
$thumbFile = $config['file_icons'][$file->extension]; |
|
|
|
} |
|
|
|
|
|
|
|
$apiPost['thumb_path'] = $config['root'] . sprintf($config['file_thumb'], $thumbFile); |
|
|
|
} |
|
|
|
} else { |
|
|
|
$apiPost['thumb_path'] = $config['uri_thumb'] . $file->thumb; |
|
|
|
} |
|
|
@ -133,6 +137,11 @@ class Api { |
|
|
|
if (isset($config['poster_ids']) && $config['poster_ids']) $apiPost['id'] = poster_id($post->ip, $post->thread, $board['uri']); |
|
|
|
if ($threadsPage) return $apiPost; |
|
|
|
|
|
|
|
// Load board info |
|
|
|
if (isset($post->board)) { |
|
|
|
openBoard($post->board); |
|
|
|
} |
|
|
|
|
|
|
|
// Handle special fields |
|
|
|
if (isset($post->body_nomarkup) && ($this->config['country_flags'] || $this->config['user_flag'])) { |
|
|
|
$modifiers = extract_modifiers($post->body_nomarkup); |
|
|
|