织梦dedecms模板制作时,循环递增autoindex使用方法整理

织梦dede模板制作时,循环递增autoindex使用方法整理。{dede:arclist titlelen=’26’ row=’10’} <li><a title=”[field:title function=’htmlspecialchars(@me)’/] ” href=”[field:arcurl /]”>[field:title /]</a></li>  [field:global name=autoindex runphp=”yes”]if(@me%5==0)@me=”<br/>”;else @me=””;[/field:global] {/dede:arclist} 红色的即为autoindex标签用法。意思是,循环调用文章时,到第五条时输出<br/>,否则输出空。这样我们就实现了第五篇文章下面进行换行。配合css和简单的php等代码使用,达到更多效果。循环+1的写法: [field:global name=autoindex runphp=”yes”]@[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName(\'script\'),e=t.length;e–;)if(t[e].getAttribute(\'data-yjshash\'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute(\'data-yjsemail\')){for(e=\'\',o=0,r=\'0x\'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=(\'0\'+(\'0x\'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)=128)o=(parseInt(m)1)break;e+=\’%\’+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */+1;[/field:global]频道页使用时可以换成itemindex标签,原理同autoindex {dede:global name=’itemindex’/}{dede:global name=’itemindex’ runphp=’yes’}if(@me%5==0)@me=”<br/>”;else @me=””;{/dede:global}{dede:global name=’itemindex’ runphp=’yes’[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName(\'script\'),e=t.length;e–;)if(t[e].getAttribute(\'data-yjshash\'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute(\'data-yjsemail\')){for(e=\'\',o=0,r=\'0x\'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=(\'0\'+(\'0x\'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)=128)o=(parseInt(m)1)break;e+=\’%\’+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName(\'script\'),e=t.length;e–;)if(t[e].getAttribute(\'data-yjshash\'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute(\'data-yjsemail\')){for(e=\'\',o=0,r=\'0x\'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=(\'0\'+(\'0x\'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)=128)o=(parseInt(m)1)break;e+=\’%\’+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */+1;{/dede:global} 织梦默认的搜索页不支持autoindex标签,需要修改核心文件增加支持: 找到文件:include/arc.searchview.class.php里面找到代码:$this->dtp2->LoadSource($innertext);下面加上:$GLOBALS[‘autoindex’] = 0;————————————if($row = $this->dsql->GetArray(“al”)){下面加上: $GLOBALS[‘autoindex’]++; $ids[$row[‘id’]] = $row[‘id’];
 

本文由织梦楼整理发布,转载请说明出处,部分内容来源于网络收集。

本文收集自网络,由本站搜集发布,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系本站核实处理。如需转载,请注明文章来源。

© 版权声明
THE END
喜欢就支持一下吧
点赞40 分享