在include/common.func.php增加下列函数:
function Getimgnum($aid)
{
global $dsql;
$imgurls = ”;
$row =$dsql->getone( “Select imgurls From `dede_addonimages` where aid=’$aid’ “);
$imgurls= $row['imgurls'];
preg_match_all(“/{dede:img (.*){\/dede:img/isU”,$imgurls,$wordcount);
$count=count($wordcount[1]);
return $count;
}
调用方法(list,aclist都可以调用):
{dede:list pagesize=’12′}
<SPAN class=SXC><a href=[field:arcurl/] target=_blank><img src=[field:litpic/] alt=”[field:title/]“ width=40 height=40 border=0></a><br><a href=[field:arcurl/] target=_blank>[field:title/]</a><br>共[field:id function="Getimgnum(@me)"/]张</SPAN>
{/dede:list}
关键词:织梦,图集,图片,数量,获取,方法,在,include, 标签:
更多资讯请收藏关注
网站模板(www.1yc.cn)