summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authormarlencrabapple <marlen.crabapple@gmail.com>2014-09-17 15:55:16 -0700
committermarlencrabapple <marlen.crabapple@gmail.com>2014-09-17 15:55:16 -0700
commit40787db1779fdb2cc2667dc5931e98a9bcc61c05 (patch)
tree42c119ce108b984132016efac30e2d795d59e090 /templates
parent4da5f4ec90b80efd0ebb4a163e6f3648d0709bc9 (diff)
Fixed spoiler thumbnails not showing up in the recent theme
Diffstat (limited to 'templates')
-rw-r--r--templates/themes/recent/theme.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php
index 842ab9ac..a25ff6a9 100644
--- a/templates/themes/recent/theme.php
+++ b/templates/themes/recent/theme.php
@@ -54,14 +54,27 @@
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
openBoard($post['board']);
+
if (isset($post['files']))
$files = json_decode($post['files']);
if ($files[0]->file == 'deleted') continue;
// board settings won't be available in the template file, so generate links now
- $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id'];
- if ($files) $post['src'] = $config['uri_thumb'] . $files[0]->thumb;
+ $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res']
+ . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id'];
+
+ if ($files) {
+ if ($files[0]->thumb == 'spoiler') {
+ $tn_size = @getimagesize($config['spoiler_image']);
+ $post['src'] = $config['spoiler_image'];
+ $post['thumbwidth'] = $tn_size[0];
+ $post['thumbheight'] = $tn_size[1];
+ }
+ else {
+ $post['src'] = $config['uri_thumb'] . $files[0]->thumb;
+ }
+ }
$recent_images[] = $post;
}