文章来源:http://www.imtr.cn/html/n217.html
源代码修改:
打开 /include/taglib/productimagelist.lib.php 文件
找到:
$ctp->LoadSource($innerText);
在此代码下边添加如下代码:
$GLOBALS['autoindex'] = 0;
找到:
$revalue .= $ctp->GetResult();
在此代码下边添加如下代码:
$GLOBALS['autoindex']++;
调用代码:
[field:global name=autoindex/]
示例:
{dede:productimagelist} <span id="[field:global name=autoindex/]"><img src="[field:imgsrc/]" alt="织梦OK" width="200" height="300" /></span> {/dede:productimagelist}
输出html代码示例:
<span id="0"><img src="1.jpg" alt="织梦OK" width="200" height="300" /></span>
<span id="1"><img src="2.jpg" alt="织梦OK" width="200" height="300" /></span>
<span id="2"><img src="3.jpg" alt="织梦OK" width="200" height="300" /></span>
原文地址:http://www.imtr.cn/html/n217.html