zoukankan      html  css  js  c++  java
  • 织梦图集图片加上序列号教程

    在图集内容页调用图集的时候,如果使用某些幻灯片特效或者jquery插件,难免会用到ID编号什么的,本教程将教会你如何给图集图片自动编号,也就是说,让{dede:productimagelist}标签支持自动编号,非常简单。

    打开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/]" 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>

  • 相关阅读:
    洛谷P1330 封锁阳光大学
    洛谷P1341 无序字母对
    Bzoj1059 [ZJOI2007]矩阵游戏
    POJ2337 Catenyms
    Bzoj2342 [Shoi2011]双倍回文
    Bzoj1009 [HNOI2008]GT考试
    Bzoj3670 [Noi2014]动物园
    POJ2406 Power Strings
    POJ 2752 Seek the Name, Seek the Fame
    POJ3522 Slim Span
  • 原文地址:https://www.cnblogs.com/snowhite/p/10661829.html
Copyright © 2011-2022 走看看