{"id":30439,"date":"2024-11-25T10:12:59","date_gmt":"2024-11-25T02:12:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30439\/"},"modified":"2024-11-25T10:12:59","modified_gmt":"2024-11-25T02:12:59","slug":"%e7%bb%87%e6%a2%a6%e5%a6%82%e4%bd%95%e8%ae%a9channelartlist%e6%a0%87%e7%ad%be%e6%94%af%e6%8c%81limit%e5%b1%9e%e6%80%a7","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30439\/","title":{"rendered":"\u7ec7\u68a6\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301limit\u5c5e\u6027"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5df988b1b13d0213.jpg\" class=\"aligncenter\" title=\"\u7ec7\u68a6\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301limit\u5c5e\u6027\u63d2\u56fe\" alt=\"\u7ec7\u68a6\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301limit\u5c5e\u6027\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>\u7ec7\u68a6\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301limit\u5c5e\u6027\uff1f<\/strong><\/p>\n<p>\u6253\u5f00\u6587\u4ef6\uff1aincludetaglibchannelartlist.lib.php<\/p>\n<p>\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>1\u3001\u5c06<\/p>\n<pre>$attlist=&nbsp;'typeid|0,row|20,cacheid|';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre>$attlist=&nbsp;'typeid|0,row|20,cacheid|,limit|';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>2\u3001\u5728\u201c$dsql-&gt;SetQuery\u201d\u524d\u9762\u6dfb\u52a0<\/p>\n<pre>$limit=&nbsp;trim(preg_replace('#limit#is',&nbsp;'',&nbsp;$limit));&nbsp;&nbsp;&nbsp;\nif($limit!='')&nbsp;$limitsql=&nbsp;\"&nbsp;LIMIT&nbsp;$limit&nbsp;\";&nbsp;&nbsp;&nbsp;\nelse$limitsql=&nbsp;\"&nbsp;LIMIT&nbsp;0,$totalnum\";<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>3\u3001<\/p>\n<pre>$dsql-&amp;gt;SetQuery(\"SELECT&nbsp;id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,\nsiteurl,sitepath&nbsp;FROM&nbsp;`zmb_arctype`&nbsp;WHERE&nbsp;$tpsqlORDER&nbsp;BY&nbsp;sortrank&nbsp;ASC&nbsp;LIMIT&nbsp;$totalnum\");<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre>$dsql-&amp;gt;SetQuery(\"SELECT&nbsp;id,typename,typedir,isdefault,ispart,defaultname,namerule2,\nmoresite,siteurl,sitepath&nbsp;FROM&nbsp;zmb_arctype&nbsp;WHERE&nbsp;$tpsql&nbsp;ORDER&nbsp;BY&nbsp;sortrank&nbsp;ASC&nbsp;$limitsql\");<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5230\u8fd9\u91cc\u5c31\u5168\u90e8\u4fee\u6539\u5b8c\u6210\u4e86\uff0c\u4f7f\u7528\u65b9\u6cd5<\/p>\n<pre>{dede:channelartlist&nbsp;limit='0,1'}{\/dede:channelartlist}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>limit:\uff08\u8d77\u59cbID\u4ece0\u5f00\u59cb\uff09\u8868\u793a\u9650\u5b9a\u7684\u8bb0\u5f55\u8303\u56f4\uff08\u5982\uff1alimit=&#8217;1,2&#8242; \u8868\u793a\u4eceID\u4e3a1\u7684\u8bb0\u5f55\u5f00\u59cb\uff0c\u53d62\u6761\u8bb0\u5f55<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301limit\u5c5e\u6027\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ec7\u68a6\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301limit\u5c5e\u6027\uff1f \u6253\u5f00\u6587\u4ef6\uff1aincludetaglibchannelartlist.lib.php \u63a8\u8350\u5b66\u4e60\uff1a 1\u3001\u5c06 $attlist=&nbsp;&#8216;typeid|0,row|20,cacheid|&#8217;; \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539\u4e3a $attlist=&nbsp;&#8216;typeid|0,row|20,cacheid|,limit|&#8217;; \u767b\u5f55\u540e\u590d\u5236 2\u3001\u5728\u201c$dsql-&gt;SetQuery\u201d\u524d\u9762\u6dfb\u52a0 $limit=&nbsp;trim(preg_replace(&#8216;#limit#is&#8217;,&nbsp;&#8221;,&nbsp;$limit));&nbsp;&nbsp;&nbsp; if($limit!=&#8221;)&nbsp;$limitsql=&nbsp;&#8221;&nbsp;LIMIT&nbsp;$limit&nbsp;&#8220;;&nbsp;&nbsp;&nbsp; else$limitsql=&nbsp;&#8221;&nbsp;LIMIT&nbsp;0,$totalnum&#8221;; \u767b\u5f55\u540e\u590d\u5236 3\u3001 $dsql-&amp;gt;SetQuery(&#8220;SELECT&nbsp;id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite, siteurl,sitepath&nbsp;FROM&nbsp;`zmb_arctype`&nbsp;WHERE&nbsp;$tpsqlORDER&nbsp;BY&nbsp;sortrank&nbsp;ASC&nbsp;LIMIT&nbsp;$totalnum&#8221;); \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539\u4e3a $dsql-&amp;gt;SetQuery(&#8220;SELECT&nbsp;id,typename,typedir,isdefault,ispart,defaultname,namerule2, moresite,siteurl,sitepath&nbsp;FROM&nbsp;zmb_arctype&nbsp;WHERE&nbsp;$tpsql&nbsp;ORDER&nbsp;BY&nbsp;sortrank&nbsp;ASC&nbsp;$limitsql&#8221;); \u767b\u5f55\u540e\u590d\u5236 \u5230\u8fd9\u91cc\u5c31\u5168\u90e8\u4fee\u6539\u5b8c\u6210\u4e86\uff0c\u4f7f\u7528\u65b9\u6cd5 {dede:channelartlist&nbsp;limit=&#8217;0,1&#8242;}{\/dede:channelartlist} \u767b\u5f55\u540e\u590d\u5236 limit:\uff08\u8d77\u59cbID\u4ece0\u5f00\u59cb\uff09\u8868\u793a\u9650\u5b9a\u7684\u8bb0\u5f55\u8303\u56f4\uff08\u5982\uff1alimit=&#8217;1,2&#8242; \u8868\u793a\u4eceID\u4e3a1\u7684\u8bb0\u5f55\u5f00\u59cb\uff0c\u53d62\u6761\u8bb0\u5f55 \u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301limit\u5c5e\u6027\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-30439","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30439","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=30439"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30439\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}