详情页

帝国CMS内容页列表页怎么调用多张图片显示

时间:2024年04月24日

编辑:佚名

举例:
[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]
帝国CMS内容页列表页怎么调用多张图片显示两个地方需要考虑
1. newstext字段是不是在副表?
2. 要对newstext字段脱敏stripcslashes($bqr[‘newstext’]);
相关文章
猜你需要