[field:title/]
[field:globalname=autoindexrunphp" />

"景先生毕设|www.jxszl.com

dede循环递增autoindex使用方法

2022-10-29 16:21编辑: www.jxszl.com景先生毕设
当我们用dede织梦模板做网站时,有时候需要用到每循环I.次,变量加I.,这是就需要使用到autoindex标签.
代码写法如下:
{dede:arclisttitlelen=IIVIrow=I.0}

  •  更多精彩就在: 51免费论文网|www.jxszl.com 
    lspecialchars(@me)/]"href="[field:arcurl/]">[field:title/]
    [field:globalname=autoindexrunphp="yes"]if(@me%V==0)@me="
    ";else@me="";[/field:global]
    {/dede:arclist}
    红色的即为autoindex标签用法.意思是,循环调用文章时,到第V条时输出
    ,否则输出空.这样我们就实现了第V篇文章下面进行换行.配合css和简单的php等代码使用,达到更多效果.
    循环+I.的写法:
    [field:globalname=autoindexrunphp="yes"]@me=@me+I.;[/field:global]
    频道页使用时可以换成itemindex标签,原理同autoindex
    {dede:globalname=itemindex/}
    {dede:globalname=itemindexrunphp=yes}if(@me%V==0)@me="
    ";else@me="";{/dede:global}
    {dede:globalname=itemindexrunphp=yes}@me=@me+I.;{/dede:global}
    织梦默认的搜索页不支持autoindex标签,需要修改核心文件增加支持:
    找到文件:include/arc.searchview.class.php
    里面找到代码:$this->dtpII->LoadSource($innertext);
    下面加上:
    $GLOBALS[autoindex]=0;
    ------------------------------------
    if($row=$this->dsql->GetArray("al"))
    {
    下面加上:
    $GLOBALS[autoindex]++;
    $ids[$row[id]]=$row[id];


    原文链接:http://www.jxszl.com/biancheng/dedecms/74315.html