列表内容模板(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]
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。