diff --git a/public/themes/dist_static/static/images/placeholder.png b/public/themes/dist_static/static/images/placeholder.png new file mode 100644 index 0000000..7f032f2 Binary files /dev/null and b/public/themes/dist_static/static/images/placeholder.png differ diff --git a/public/themes/website/1/en/demo/single_search.html b/public/themes/website/1/en/demo/single_search.html index 67404b6..4043e27 100755 --- a/public/themes/website/1/en/demo/single_search.html +++ b/public/themes/website/1/en/demo/single_search.html @@ -142,7 +142,10 @@ } } $sr_cid = $vo['category_id'] ?? ($vo['category'][0]['id'] ?? 0); - $sr_thumb = is_array($vo['thumbnail'] ?? null) ? ($vo['thumbnail']['url'] ?? '') : ''; + $sr_thumb = trim((string)(is_array($vo['thumbnail'] ?? null) ? ($vo['thumbnail']['url'] ?? '') : '')); + if ($sr_thumb === '') { + $sr_thumb = '/themes/dist_static/static/images/placeholder.png'; + } $sr_url = hcUrl('detail/index', ['id' => $vo['id'], 'cid' => $sr_cid]); $sr_file = trim((string)($vo['url'] ?? '')); $has_sr_file = $sr_file !== ''; diff --git a/public/themes/website/1/zh/demo/single_search.html b/public/themes/website/1/zh/demo/single_search.html index 360143b..3940196 100755 --- a/public/themes/website/1/zh/demo/single_search.html +++ b/public/themes/website/1/zh/demo/single_search.html @@ -142,7 +142,10 @@ } } $sr_cid = $vo['category_id'] ?? ($vo['category'][0]['id'] ?? 0); - $sr_thumb = is_array($vo['thumbnail'] ?? null) ? ($vo['thumbnail']['url'] ?? '') : ''; + $sr_thumb = trim((string)(is_array($vo['thumbnail'] ?? null) ? ($vo['thumbnail']['url'] ?? '') : '')); + if ($sr_thumb === '') { + $sr_thumb = '/themes/dist_static/static/images/placeholder.png'; + } $sr_url = hcUrl('detail/index', ['id' => $vo['id'], 'cid' => $sr_cid]); $sr_file = trim((string)($vo['url'] ?? '')); $has_sr_file = $sr_file !== '';