首页 话题 小组 问答 好文 用户 我的社区 域名交易 唠叨

[代码]帝国CMS调用列表list图集调用方法

发布于 2025-04-14 10:56:38
0
460

图片alt

列表内容模板(list.var):


$fr=$empire->fetch1("select * from {$dbtbpre}ecms_news where id='$r[id]'");
$rexp="\r\n";
$fexp="::::::";
$rr=explode($rexp,$fr[morepic]);
$count=count($rr);
$listtemps="";
// 循环次数达到 3 时停止
for($i=1;$i<$count+1 && $i <= 3;$i++)
{
$frt=explode($fexp,$rr[$i-1]);
$listtemps.=(' <a title="'.$frt[2].'" class="game-pic">
<img alt="'.$frt[2].'" src="'.$frt[0].'" style="display: block;">
</a>');
}
$tagstr=dp_InfoTag($r['classid'],$r['id'],'| ',5);
$listtemp='<li class="game-item">
<div class="game-left">
<div class="game-icon">
<img class="icon lazyload"
alt="[!--title--]([!--xckh--])"
src="[!--titlepic--]" data-src="[!--titlepic--]"
style="display: inline;">
<img class="qrcode lazyload"
src="/qr/api.php?url='.$public_r['add_murl'].'[!--titleurl--]" data-src="/qr/api.php?url='.$public_r['add_murl'].'[!--titleurl--]"
alt="[!--title--]([!--xckh--])" style="display: none;">
<a title="[!--title--]([!--xckh--])" href="[!--titleurl--]"
class="game-down">立即下载</a>
</div>
</div>
<div class="game-center">
<div class="game-title">
<h3>
<a title="[!--title--]([!--xckh--])" href="[!--titleurl--]">[!--title--]([!--xckh--])</a>
</h3>
<span>[!--yjh--]</span>
</div>
<div class="game-info">
[!--newstime--]更新 '.$tagstr.' </div>
<p class="game-detail">
简介:[!--smalltext--]</p>
</div>
<div class="game-right">
 
'.$listtemps.'
</div>
<span class="num-bg"></span>
<span class="game-num">[!--no.num--]</span>';


内容图片集调用代码:


  <?php
 
$picr=explode(egetzy('rn'),$navinfor[morepic]);
 
for($p=0;$p<count($picr);$p++)
 
{
 
$spicr=explode("::::::",$picr[$p]);?>
 
                                <div class="swiper-slide">
 
                  <img src="<?=$spicr[0]?>" title="[!--title--]([!--xckh--])" alt="[!--title--]([!--xckh--])游戏截图<?=$bqno?>">
 
                </div>
 
<?php
 
}
 
?>


内容页列表页


[e:loop={'news',10,18,1}]
<?php
$fr=$empire->fetch1("select newstext from {$dbtbpre}ecms_news_data_{$bqr[stb]} where id='$bqr[id]'");
$str=stripcslashes($fr['newstext']);
preg_match_all('/<img.*?src="(.*?)".*?>/is',$str,$imgArr);
$imgArr = array_unique($imgArr[1]);
?>
<?=count($imgArr)?>张
<img src="<?=$imgArr[0]?>"  width="200" height="200" />
<img src="<?=$imgArr[1]?>" width="200" height="200" />
<img src="<?=$imgArr[2]?>" width="200" height="200" />
<a href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a><br>
[/e:loop]


评论
一个月内的热帖推荐
啊龙
Lv.1普通用户

706

帖子

23

小组

1503

积分

站长交流