<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

DedeCMS自增函数[field:global name=autoindex/]常见用法

时间:2020-12-15

看来不少朋友需要不了解这个自增函数的用法,在这里我列举一些常见的写法以及作用。


 
[field:global name=autoindex/]  <!--普通打印递增的数字-->
[field:global name=autoindex runphp="yes"]@me=@me+5;[/field:global] <!--将值加5后再打印-->
[field:global name=autoindex runphp="yes"](@me%2==0)? @me="|":@me="";[/field:global] <!--如果被2整除则打印竖线否则为空-->
[field:global name=autoindex runphp="yes"](@me!=8)? @me="|":@me="";[/field:global]  <!--如果不等于8输出竖线否则为空,即为8的时候不打印竖线-->
 
[field:global runphp='yes' name=autoindex]
           $a="<li>";
           $c="<li class='line'>";
           if ((@me % 5) == 0) @me = $c;
           else @me = $a;
 [/field:global]  <!--常见的列表每5行有下划线-->
  
  
  [field:global runphp='yes' name=autoindex]
           $a="<div class='box'>";
           $b="广告1";
           $c="</div>";
           $d="广告2";
           $e="";
           if (@me == 5) @me = $a.$b.$c;
              else if (@me == 10) @me = $a.$d.$c;
           else @me = $e;
 [/field:global]
  
 {dede:global name='itemindex' runphp='yes'}
 
           $a="<dl class='box1 w335 fl'>";
           $c="<dl class='box1 w335 fr'>";
           if ((@me % 2) == 0) @me = $c;
           else @me = $a;
{/dede:global}
 
 
[field:global name="autoindex" runphp="yes"]
        if (@me <= 3) @me=@me-1;
        else if (@me%4 == 0) @me = "3";
        else if (@me%4 == 1) @me = "0";
        else if (@me%4 == 2) @me = "1";
        else if (@me%4 == 3) @me = "2";
        else @me = "";
0
首页
案例
关于
联系