<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦dedecms图集列表页、图集内容页调用图片数量的方法

时间:2020-12-15

织梦图集默认是不调用图片数量的,比如“本图集共X张图片”这样,当我们网站需要显示这些的时候,按照下面的方法修改即可。

一、列表页调用图片数量

1、代码:

 
 
 
 
 
 
 
 
 
{dede:list pagesize='12'}
<li>
<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)"/]张
</li>
{/dede:list}

2、在include/common.func.php增加下列函数:

 
 
 
 
 
 
 
 
 
 
 
function Getimgnum($aid)
{
global $dsql;
$imgurls = '';
$row =$dsql->getone( "Select imgurls From `phper_addonimages` where 
aid='$aid' ");
$imgurls= $row['imgurls'];
preg_match_all("/{dede:img (.*){\/dede:img/isU",$imgurls,$wordcount);
$count=count($wordcount[1]);
return $count;
}

二、图集内容页调用图片数量

在合适的位置加入以下代码:

 
 
 
{dede:sql sql="select count(*) as c from phper_archives where channel=2"}
共有图集:[field:c /]个
{/dede:sql}

0
首页
案例
关于
联系