muban大师 发表于 2021-8-16 10:16:13

织梦在channel标签的数字递增调用方法

我们知道文章调用支持autoindex 但channel 不支持,那如何支持呢?
       
        在include/taglib/channel.lib.php 第140行即是
       
       
               
                       
                               
                                       
$linkOkstr = str_replace("~typename~",$row['typename',,$linkOkstr);
                               
                       
               
       
之后加一句


       
               
                       
                               
$linkOkstr = str_replace("~autoindex~",$GLOBALS['autoindex',,$linkOkstr);
                       
               
       

下面是例句:


       
               
                       
                               
{dede:channel type='top' currentstyle="" }
         ,
{/dede:channel}
                       
               
       

从1开始标签


       
               
                       
                               
[field:autoindex runphp='yes',@me=$GLOBALS['autoindex',+0;[/field:autoindex,
                       
               
       


       
               
                       
                               
$GLOBALS['autoindex', = 0;
                       
               
       

这是织梦默认从0开始,如果要从1开始可以把0改成1,就是


       
               
                       
                               
$GLOBALS['autoindex', = 1;
页: [1]
查看完整版本: 织梦在channel标签的数字递增调用方法