|
第一步:列表页调用代码:
{dede:list pagesize=’12′}
[url=,
[img][/img]
[/url]
[url=,[field:title/,[/url]
共[field:id function="Getimgnum(@me)"/,张
{/dede:list}
第二步:在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;
} |
|