{"id":30598,"date":"2024-11-25T16:04:27","date_gmt":"2024-11-25T08:04:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30598\/"},"modified":"2024-11-25T16:04:27","modified_gmt":"2024-11-25T08:04:27","slug":"dedecms-autoindex%e5%92%8citemindex%e6%80%8e%e4%b9%88%e7%94%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30598\/","title":{"rendered":"DedeCms autoindex\u548citemindex\u600e\u4e48\u7528"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5e040af341c84999.jpg\" class=\"aligncenter\" title=\"DedeCms autoindex\u548citemindex\u600e\u4e48\u7528\u63d2\u56fe\" alt=\"DedeCms autoindex\u548citemindex\u600e\u4e48\u7528\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong> autoindex\u548citemindex\u600e\u4e48\u7528\uff1f<\/strong><\/p>\n<p>autoindex\/itemindex \u53ef\u4ee5\u4f7f\u7528 @me+1;\u5b9e\u73b0\u7531\u6307\u5b9a\u6570\u5b57\u5f00\u59cb\uff0c\u4e0b\u9762\u4e3a\u5927\u5bb6\u8be6\u7ec6\u4ecb\u7ecd\u4e0b\u5177\u4f53\u7684\u4e24\u8005\u5177\u4f53\u7684\u7528\u6cd5\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e0b<\/p>\n<p>&nbsp;&nbsp;\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>&lt;span&gt;&lt;\/span&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8ba9dedecms autoindex,itemindex \u4ece0\u52301\u5f00\u59cb\u7684\u529e\u6cd5&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>[field:global&nbsp;name=autoindex&nbsp;runphp=\"yes\"]@me=@me+1;[\/field:global]&nbsp;\n{dede:global&nbsp;name=itemindex&nbsp;runphp=\"yes\"}@me=@me+1;{\/dede:global}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>autoindex itemindex \u7684\u4f7f\u7528\u5fc3\u5f97\u533a\u522b&nbsp;<\/p>\n<pre>channelartlist&nbsp;\u6807\u7b7e\u4e0b\u4f7f\u7528&nbsp;{dede:global&nbsp;name='itemindex'&nbsp;runphp='yes'}@me;{\/dede:global}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u81ea\u589e1&nbsp;<\/p>\n<pre>arclist&nbsp;\u6807\u7b7e\u4e0b\u4f7f\u7528&nbsp;[field:global.autoindex\/]&nbsp;\u9ed8\u8ba4\u4ece1\u5f00\u59cb&nbsp;\nchannel&nbsp;\u6807\u7b7e\u4e0b\u4f7f\u7528&nbsp;[field:global.autoindex\/]&nbsp;\u9ed8\u8ba4\u4ece0\u5f00\u59cb&nbsp;\nchannelartlist&nbsp;\u6807\u7b7e\u4e0b\u4f7f\u7528&nbsp;{dede:global.itemindex\/}&nbsp;\u9ed8\u8ba4\u4ece1\u5f00\u59cb&nbsp;\narclist&nbsp;\u4ece0\u5f00\u59cb[field:global&nbsp;name=autoindex&nbsp;runphp=\"yes\"]@me=@me-1;[\/field:global]&nbsp;\nchannel&nbsp;\u4ece1\u5f00\u59cb[field:global&nbsp;name=autoindex&nbsp;runphp=\"yes\"]@me=@me+1;[\/field:global][field:typename\/]&nbsp;\nchannelartlist&nbsp;\u4ece0\u5f00\u59cb{dede:global&nbsp;name=itemindex&nbsp;runphp='yes'}@me=@me-1;{\/dede:global}&nbsp;\n&lt;div&gt;\n&lt;p&gt;channelartlist\u5b9e\u4f8b&nbsp;&lt;\/p&gt;\n&lt;p&gt;\u4ee3\u7801\u5982\u4e0b:&lt;\/p&gt;\n&lt;pre class=\"brush:php;toolbar:false\"&gt;{dede:channelartlist&nbsp;notypeid='123,124,146,147'}&nbsp;\n&lt;a&gt;&nbsp;\n{dede:php}if($refObj-&amp;gt;Fields['ispart']){echo&nbsp;$refObj-&amp;gt;Fields['typename'];}{\/dede:php}&nbsp;\n&lt;\/a&gt;&nbsp;\n{\/dede:channelartlist}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6807\u7b7e\u4e0b\u4f7f\u7528 [field:global name=autoindex\/]&nbsp;<\/p>\n<p>channel\u5b9e\u4f8b&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>{dede:channel&nbsp;titlelen='32'}&nbsp;\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<li>\n<h3><\/h3>\n<\/li>\n<p>&nbsp; {\/dede:channel} <\/p>\n<p>\u5728arclist\u4e2d\u4f7f\u7528autoindex runphp \u65f6\u7528\u8fd9\u79cd\u65b9\u5f0f\uff1a&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>{dede:arclist&nbsp;titlelen='22'&nbsp;row='4'&nbsp;flag='c'&nbsp;orderby='id'}&nbsp;\n&lt;a&gt;[field:title&nbsp;\/]&lt;\/a&gt;&nbsp;\n[field:global&nbsp;name='autoindex'&nbsp;runphp='yes']if(@me==2){@me=\"\n\";}else{@me='&nbsp;';}[\/field:global]{\/dede:arclist}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u81ea\u589e1&nbsp;<\/p>\n<pre>[field:global.autoindex\/]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>arclist\u5b9e\u4f8b&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>{dede:arclist&nbsp;channelid=17&nbsp;row=6&nbsp;orderby=pubdate&nbsp;titlelen=40&nbsp;addfields='docphoto,docjob,doctec'typeid='123,136,146,155,172,182,202'}&nbsp;\n&lt;div&gt;&nbsp;\n&lt;div&gt;&lt;a&gt;@@##@@&lt;\/a&gt;&lt;\/div&gt;&nbsp;\n&lt;\/div&gt;&nbsp;\n{\/dede:arclist}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u4f55\u81ea\u7531\u5b9a\u4e49 \u5f00\u59cb\u7684\u6570\u5b57&nbsp;<\/p>\n<p>autoindex\/itemindex \u53ef\u4ee5\u4f7f\u7528 @me+1;\u5b9e\u73b0\u7531\u6307\u5b9a\u6570\u5b57\u5f00\u59cb&nbsp;<\/p>\n<p>\u9047\u5230\u7c7b\u4f3c\u7684\u95ee\u9898\u505a\u4e0b\u8fd9\u4e2a\u7b14\u8bb0\uff0c\u5728\u7528\u5230\u7684\u65f6\u5019\u53ef\u4ee5\u7075\u6d3b\u53d1\u6325\uff01&nbsp;<\/p>\n<p>list \u6807\u7b7e\u4e0b\u8bd5\u7528autoindex&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>{dede:list&nbsp;pagesize='40'&nbsp;orderby='id'}&nbsp;\n[field:global&nbsp;name='autoindex'&nbsp;runphp='yes']if(@me%10==0){@me=\"test\";}else{@me='';}[\/field:global]&nbsp;\n{\/dede:list}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5bf9autoindex\/itemindex\u4f7f\u7528\u81ea\u5b9a\u4e49\u51fd\u6570&nbsp;<\/p>\n<p>\u5148\u5728include\/extend.fun.php\u91cc\u6dfb\u52a0\u81ea\u5b9a\u4e49\u51fd\u6570&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>function&nbsp;MyPosition($p){&nbsp;\n$positionArr=array(275,330,380,435,495,547);&nbsp;\nreturn&nbsp;$positionArr[$p];<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\u5728\u6a21\u677f\u91cc\u6dfb\u52a0&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>{dede:channel&nbsp;type='son'&nbsp;typeid='13'&nbsp;row='6'&nbsp;noself='yes'}&nbsp;\n&lt;!-----\u4fa7\u680f\u83dc\u5355------------------&gt;&nbsp;\n&lt;div&gt;&nbsp;\n&lt;div&gt;&lt;a&gt;&lt;strong&gt;[field:typename\/]&lt;\/strong&gt;&lt;\/a&gt;&lt;\/div&gt;&nbsp;\n&lt;\/div&gt;&nbsp;\n{\/dede:channel}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236<br \/>\n<img><\/p>\n","protected":false},"excerpt":{"rendered":"<p>autoindex\u548citemindex\u600e\u4e48\u7528\uff1f autoindex\/itemindex \u53ef\u4ee5\u4f7f\u7528 @me+1;\u5b9e\u73b0\u7531\u6307\u5b9a\u6570\u5b57\u5f00\u59cb\uff0c\u4e0b\u9762\u4e3a\u5927\u5bb6\u8be6\u7ec6\u4ecb\u7ecd\u4e0b\u5177\u4f53\u7684\u4e24\u8005\u5177\u4f53\u7684\u7528\u6cd5\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e0b &nbsp;&nbsp;\u63a8\u8350\u5b66\u4e60\uff1a \u4ee3\u7801\u5982\u4e0b: &lt;span&gt;&lt;\/span&gt; \u767b\u5f55\u540e\u590d\u5236 \u8ba9dedecms autoindex,itemindex \u4ece0\u52301\u5f00\u59cb\u7684\u529e\u6cd5&nbsp; \u4ee3\u7801\u5982\u4e0b: [field:global&nbsp;name=autoindex&nbsp;runphp=&#8221;yes&#8221;]@me=@me+1;[\/field:global]&nbsp; {dede:global&nbsp;name=itemindex&nbsp;runphp=&#8221;yes&#8221;}@me=@me+1;{\/dede:global} \u767b\u5f55\u540e\u590d\u5236 autoindex itemindex \u7684\u4f7f\u7528\u5fc3\u5f97\u533a\u522b&nbsp; channelartlist&nbsp;\u6807\u7b7e\u4e0b\u4f7f\u7528&nbsp;{dede:global&nbsp;name=&#8217;itemindex&#8217;&nbsp;runphp=&#8217;yes&#8217;}@me;{\/dede:global} \u767b\u5f55\u540e\u590d\u5236 \u81ea\u589e1&nbsp; arclist&nbsp;\u6807\u7b7e\u4e0b\u4f7f\u7528&nbsp;[field:global.autoindex\/]&nbsp;\u9ed8\u8ba4\u4ece1\u5f00\u59cb&nbsp; channel&nbsp;\u6807\u7b7e\u4e0b\u4f7f\u7528&nbsp;[field:global.autoindex\/]&nbsp;\u9ed8\u8ba4\u4ece0\u5f00\u59cb&nbsp; channelartlist&nbsp;\u6807\u7b7e\u4e0b\u4f7f\u7528&nbsp;{dede:global.itemindex\/}&nbsp;\u9ed8\u8ba4\u4ece1\u5f00\u59cb&nbsp; arclist&nbsp;\u4ece0\u5f00\u59cb[field:global&nbsp;name=autoindex&nbsp;runphp=&#8221;yes&#8221;]@me=@me-1;[\/field:global]&nbsp; channel&nbsp;\u4ece1\u5f00\u59cb[field:global&nbsp;name=autoindex&nbsp;runphp=&#8221;yes&#8221;]@me=@me+1;[\/field:global][field:typename\/]&nbsp; channelartlist&nbsp;\u4ece0\u5f00\u59cb{dede:global&nbsp;name=itemindex&nbsp;runphp=&#8217;yes&#8217;}@me=@me-1;{\/dede:global}&nbsp; &lt;div&gt; &lt;p&gt;channelartlist\u5b9e\u4f8b&nbsp;&lt;\/p&gt; &lt;p&gt;\u4ee3\u7801\u5982\u4e0b:&lt;\/p&gt; &lt;pre class=&#8221;brush:php;toolbar:false&#8221;&gt;{dede:channelartlist&nbsp;notypeid=&#8217;123,124,146,147&#8242;}&nbsp; &lt;a&gt;&nbsp; {dede:php}if($refObj-&amp;gt;Fields[&#8216;ispart&#8217;]){echo&nbsp;$refObj-&amp;gt;Fields[&#8216;typename&#8217;];}{\/dede:php}&nbsp; &lt;\/a&gt;&nbsp; {\/dede:channelartlist} \u767b\u5f55\u540e\u590d\u5236 \u6807\u7b7e\u4e0b\u4f7f\u7528 [field:global name=autoindex\/]&nbsp; channel\u5b9e\u4f8b&nbsp; \u4ee3\u7801\u5982\u4e0b: {dede:channel&nbsp;titlelen=&#8217;32&#8217;}&nbsp; \u767b\u5f55\u540e\u590d\u5236 &nbsp; {\/dede:channel} \u5728arclist\u4e2d\u4f7f\u7528autoindex runphp \u65f6\u7528\u8fd9\u79cd\u65b9\u5f0f\uff1a&nbsp; \u4ee3\u7801\u5982\u4e0b: {dede:arclist&nbsp;titlelen=&#8217;22&#8217;&nbsp;row=&#8217;4&#8242;&nbsp;flag=&#8217;c&#8217;&nbsp;orderby=&#8217;id&#8217;}&nbsp; &lt;a&gt;[field:title&nbsp;\/]&lt;\/a&gt;&nbsp; [field:global&nbsp;name=&#8217;autoindex&#8217;&nbsp;runphp=&#8217;yes&#8217;]if(@me==2){@me=&#8221; &#8220;;}else{@me=&#8217;&nbsp;&#8216;;}[\/field:global]{\/dede:arclist} \u767b\u5f55\u540e\u590d\u5236 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-30598","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=30598"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30598\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}