Browse Source

fix(download): 更新下载文件链接判断逻辑

- 使用!empty()替代trim()来检查url字段,确保更准确的链接判断
- 保持对缩略图链接的回退功能不变
master
peijunlei 1 week ago
parent
commit
247c9da4ed
  1. 2
      public/themes/website/1/en/demo/download.html
  2. 2
      public/themes/website/1/zh/demo/download.html

2
public/themes/website/1/en/demo/download.html

@ -119,7 +119,7 @@
<div class="d-list"> <div class="d-list">
{hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="12" item="vo" sort="sort desc"} {hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="12" item="vo" sort="sort desc"}
{php} {php}
$dl_file = trim((string)($vo['url'] ?? ($vo['thumbnail']['url'] ?? '')));
$dl_file = !empty($vo['url']) ? $vo['url'] : ($vo['thumbnail']['url'] ?? '');
$has_dl = $dl_file !== ''; $has_dl = $dl_file !== '';
{/php} {/php}
<div class="d-item"> <div class="d-item">

2
public/themes/website/1/zh/demo/download.html

@ -119,7 +119,7 @@
<div class="d-list"> <div class="d-list">
{hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="12" item="vo" sort="sort desc"} {hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="12" item="vo" sort="sort desc"}
{php} {php}
$dl_file = trim((string)($vo['url'] ?? ($vo['thumbnail']['url'] ?? '')));
$dl_file = !empty($vo['url']) ? $vo['url'] : ($vo['thumbnail']['url'] ?? '');
$has_dl = $dl_file !== ''; $has_dl = $dl_file !== '';
{/php} {/php}
<div class="d-item"> <div class="d-item">

Loading…
Cancel
Save