织梦图集图片在首页列表页调用并且自定义输出几张
不改动官方核心文件,在自定义方法文件里加入个方法来实现织梦图集图片在首页列表页调用并且自定义输出几张 打开 /include/extend.func.php 在最下面加入这个方法 function Getimgurls($aid,$num=4) { global $dsql; $imgurls = $result = ''; $imgrow = $dsql->GetOne( "Select imgurls From `#@__addonimages` where aid='$aid' "); $imgurls = $imgrow['imgurls']; if($imgurls != '') { $dtp = new DedeTagParse(); $dtp->LoadSource($imgurls); $images = array(); if(is_array($dtp->CTags)) { foreach($dtp->CTags as $ctag) { if($ctag->GetName() == 'img') { $row = array(); $row['width'] = $ctag->GetAtt('width'); $row['height'] = $ctag->GetAtt('height'); $row['imgsrc'] = trim($ctag-