$chapter_sql = "select * from {$dbtbpre}ecms_zhangjie where bookid='".$r[id]."' order by newstime desc limit 6";
$chapter_result = $empire->query($chapter_sql);
$chapter_html = '';
while($chapter_r = $empire->fetch($chapter_result)){
$chapter_titleurl = sys_ReturnBqTitleLink($chapter_r);
$chapter_html .= '
<div class="chapter-item">
<a href="'.$chapter_titleurl.'">
<img src="'.$chapter_r[titlepic].'" alt="'.$chapter_r[title].'" class="chapter-img"></a>
<a href="'.$chapter_titleurl.'" class="chapter-link">'.$chapter_r[title].'</a>
</div>
';
}
$listtemp = '
<div class="container1">
<!-- 左侧漫画介绍 -->
<div class="comic-info">
<a href="[!--titleurl--]">
<img src="[!--titlepic--]" alt="[!--title--]" class="comic-cover">
</a>
</div>
<!-- 右侧章节列表(无背景查看更多按钮) -->
<div class="chapter-list">
<div class="chapter-header">
<h2>最新章节</h2>
<!-- 保留button标签,保持点击功能,样式改为无背景文字链接 -->
<a href="[!--titleurl--]">
<button class="more-btn">查看更多</button>
</a>
</div>
<div class="chapter-grid">
'.$chapter_html.'
</div>
</div>
</div>
';
灵动标签方式:
[e:loop={'news',1,18,0,'','newstime DESC'}]
<div class="fullwidth-wrapper">
<div class="mod6-dark">
<div class="mod6-19">
<div class="mod6-left">
<div class="rec-title">重磅推荐</div>
<div class="top1-cover">
<img src="<?=$bqr['titlepic']?>" alt="top1">
<div class="top1-info">
<span class="top1-tag">TOP1</span>
<span class="top1-name"><?=$bqr['title']?></span>
<span class="top1-date"><?=date('Y-m-d',$bqr[newstime])?></span>
</div>
</div>
<div class="desc"><?=$bqr['smalltext']?></div>
</div>
<div class="mod6-right">
<?php
// 核心查询:保留你的原始逻辑
$cur_bookid = $bqr['id'];
$chapter_sql = "select * from {$dbtbpre}ecms_zhangjie where bookid='".$cur_bookid."' order by newstime desc limit 6";
$chapter_result = $empire->query($chapter_sql);
while($chapter_r = $empire->fetch($chapter_result)){
$chapter_titleurl = sys_ReturnBqTitleLink($chapter_r);
$chapter_date = date('m-d', $chapter_r['newstime']);
?>
<div class="episode-card"><img src="<?=$chapter_r['titlepic']?>"><div class="episode-text"><span class="episode-title">第<?=$chapter_r['ftitle']?>话</span><span class="episode-date"><?=$chapter_date?></span></div></div>
<?php } ?>
</div>
</div>
</div>
</div>
[/e:loop]

腾讯云 12-20 广告
