织梦DedeCMS给图片加上编号
发布时间:01/20 来源:未知 浏览:
关键词:
$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/]" width="805" height="523" /></span>
{/dede:productimagelist} 假设有3个图片,则效果为:
<span id="0"><img src="1.jpg" width="805" height="523" /></span>
<span id="1"><img src="2.jpg" width="805" height="523" /></span>
<span id="2"><img src="3.jpg" width="805" height="523" /></span>