The dream weaving DedeCMS atlas does not call the number of images by default, such as "X in total". When the website needs to display these images, it can be modified according to the following method.

1. Number of pictures called by list page

code:

{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: arc/] target=_blank>[field: title/]</a><br>A total of [field: id function="Getinstant (@ me)"/]
</li>
{/dede:list}

Add the following functions in 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;
}

2. Number of pictures called by atlas content page

Add the following code in the appropriate location:

{dede:sql sql="select count(*) as c from dede_archives where channel=2"}
Total atlas: [field: c/]
{/dede:sql}

Post reply

Can't comment until