From b5eee58b96460d8a169ddfaf08b28baa68e34ada Mon Sep 17 00:00:00 2001 From: PVNFU-28 <34801669+PVNFU-28@users.noreply.github.com> Date: Sat, 20 Aug 2022 13:21:42 -0300 Subject: [PATCH] Update theme.php (#409) fixed hardcoded root that broke spoilered images on the catalog if vichan was not installed on the web root. --- templates/themes/catalog/theme.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 4d34d42d..b25abf32 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -1,18 +1,18 @@ fetch(PDO::FETCH_ASSOC)) { $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post); $post['board_name'] = $board['name']; if ($post['embed'] && preg_match('/^https?:\/\/(\w+\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9\-_]{10,11})(&.+)?$/i', $post['embed'], $matches)) { $post['youtube'] = $matches[2]; - } + } if (isset($post['files']) && $post['files']) { $files = json_decode($post['files']); @@ -87,7 +87,7 @@ } } else if($files[0]->thumb == 'spoiler') { - $post['file'] = '/' . $config['spoiler_image']; + $post['file'] = $config['root'] . $config['spoiler_image']; } else { $post['file'] = $config['uri_thumb'] . $files[0]->thumb; @@ -101,7 +101,7 @@ $post['pubdate'] = date('r', $post['time']); $recent_posts[] = $post; } - + $required_scripts = array('js/jquery.min.js', 'js/jquery.mixitup.min.js', 'js/catalog.js'); foreach($required_scripts as $i => $s) {