{"id":30486,"date":"2024-11-25T13:17:13","date_gmt":"2024-11-25T05:17:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30486\/"},"modified":"2024-11-25T13:17:13","modified_gmt":"2024-11-25T05:17:13","slug":"dede%e4%b8%93%e9%a2%98%e8%8a%82%e7%82%b9%e6%96%87%e7%ab%a0%e6%80%8e%e4%b9%88%e6%8c%89id%e7%b1%bb%e5%9e%8b%e6%8e%92%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30486\/","title":{"rendered":"dede\u4e13\u9898\u8282\u70b9\u6587\u7ae0\u600e\u4e48\u6309id\u7c7b\u578b\u6392\u5e8f"},"content":{"rendered":"<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5dfc331c59550506.jpg\" class=\"aligncenter\" title=\"dede\u4e13\u9898\u8282\u70b9\u6587\u7ae0\u600e\u4e48\u6309id\u7c7b\u578b\u6392\u5e8f\u63d2\u56fe\" alt=\"dede\u4e13\u9898\u8282\u70b9\u6587\u7ae0\u600e\u4e48\u6309id\u7c7b\u578b\u6392\u5e8f\u63d2\u56fe\" \/><strong><br \/><\/strong><\/p>\n<p><strong>dede\u4e13\u9898\u8282\u70b9\u6587\u7ae0\u600e\u4e48\u6309id\u7c7b\u578b\u6392\u5e8f\uff1f<\/strong><\/p>\n<p><strong>dede\u4e13\u9898\u8282\u70b9\u6587\u7ae0\u6309id\uff0c\u70b9\u51fb\u7b49\u7c7b\u578b\u6392\u5e8f<\/strong><\/p>\n<p>\u4f7f\u7528dedecms\u5f04\u4e00\u4e2a\u4e13\u9898\uff0c\u6dfb\u52a0\u5185\u5bb9\u53d1\u73b0\u5185\u5bb9\u6807\u9898\u4e0d\u662f\u6309\u7167\u6dfb\u52a0\u7684id\u6392\u5e8f\u7684\uff0c\u4e5f\u4e0d\u662f\u6309\u7167id\u987a\u5e8f\u6392\u5217\u7684\u3002\u611f\u89c9\u50cf\u662f\u968f\u673a\u7684<\/p>\n<p>&nbsp;&nbsp;\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>\u6309\u7167 \u6807\u9898\u7684id&nbsp; \u964d\u5e8f\u6392\u5217\u3002<\/p>\n<p>\u8fd9\u4e2a\u6548\u679c\u9700\u8981\u4fee\u65392 \u4e2aphp\u6587\u4ef6\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u4fee\u6539&nbsp; includetaglibchannelspecialtopic.lib.php&nbsp; \u6587\u4ef6<\/p>\n<p>2. \u5728\u7b2c52\u884c \u5904 \u6709\u8fd9\u884c\u4ee3\u7801\uff1a<\/p>\n<pre>&nbsp;$ctag-&amp;gt;GetAtt('imgwidth'),&nbsp;$ctag-&amp;gt;GetAtt('imgheight'),&nbsp;'all',&nbsp;'default',&nbsp;$keywords,&nbsp;$listTemplet,&nbsp;0,&nbsp;$idlist,<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fee\u6539\u6210\uff1a<\/p>\n<pre>&nbsp;$ctag-&amp;gt;GetAtt('imgwidth'),&nbsp;$ctag-&amp;gt;GetAtt('imgheight'),&nbsp;'all',&nbsp;'asc',&nbsp;$keywords,&nbsp;$listTemplet,&nbsp;0,&nbsp;$idlist,<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>3. \u4fdd\u5b58\u6587\u4ef6\u7ed3\u675f<\/p>\n<p>\u7b2c\u4e8c\u6b65\u9aa4\uff1a<\/p>\n<p>1.\u4fee\u6539includetaglibarclist.lib.php<\/p>\n<p>2. \u5927\u7ea6\u5728196\u884c\u5904\u3002\u6709\u8fd9\u884c\u4ee3\u7801\uff1a<\/p>\n<pre>&nbsp;&nbsp;\/\/\u6587\u6863\u6392\u5e8f\u7684\u65b9\u5f0f\n&nbsp;&nbsp;&nbsp;&nbsp;$ordersql&nbsp;=&nbsp;'';\n&nbsp;&nbsp;&nbsp;&nbsp;if($orderby=='hot'&nbsp;||&nbsp;$orderby=='click')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;arc.click&nbsp;$orderWay\";\n&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;'sortrank'&nbsp;||&nbsp;$orderby=='pubdate')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;arc.sortrank&nbsp;$orderWay\";\n&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;'id')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;&nbsp;order&nbsp;by&nbsp;arc.id&nbsp;$orderWay\";\n&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;'near')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;ABS(arc.id&nbsp;-&nbsp;\".$arcid.\")\";\n&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;'lastpost')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;&nbsp;order&nbsp;by&nbsp;arc.lastpost&nbsp;$orderWay\";\n&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;'scores')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;&nbsp;order&nbsp;by&nbsp;arc.scores&nbsp;$orderWay\";\n&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;'rand')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;&nbsp;order&nbsp;by&nbsp;rand()\";\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/\u589e\u52a0&nbsp;&nbsp;\u5f00\u59cb\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;'asc')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;&nbsp;order&nbsp;by&nbsp;arc.id&nbsp;asc\";\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/\u589e\u52a0&nbsp;\u7ed3\u675f\n&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;arc.sortrank&nbsp;$orderWay\";<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>3.&nbsp; \u4fee\u6539\u7ed3\u675f<\/p>\n<p>\u4e0b\u9762\u518d\u7ed9\u4e00\u4e2a\u5b9e\u73b0\u65b9\u6cd5<\/p>\n<p>1\u3001\u627e\u5230 include\/taglib\/\/channel\/specialtopic.lib.php&nbsp;<\/p>\n<p>2\u3001\u5c06 require_once(DEDEINC.&#8217;\/taglib\/arclist.lib.php&#8217;); \u6362\u6210 require_once(DEDEINC.&#8217;\/taglib\/arclist.lib2.php&#8217;);&nbsp;<\/p>\n<p>3\u3001\u590d\u5236arclist.lib.php \u6539\u540d\u6210 arclist.lib2.php&nbsp;<\/p>\n<p>\u7136\u540e\u4fee\u6539arclist.lib2.php&nbsp;<\/p>\n<p>\u67e5\u627e$order=&#8217;desc&#8217; \u66ff\u6362\u6210 $orderby=&#8217;id&#8217;&nbsp;<\/p>\n<p>\u4eff\u7ad9\u5173\u4e8e\u662f\u5347\u5e8f\u8fd8\u662f\u964d\u5e8f\u6392\u5217\u53ea\u9700\u8981&nbsp;<\/p>\n<p>\u67e5\u627e$orderWay = AttDef($order,&#8217;desc&#8217;); \u66ff\u6362\u6210 $orderWay = AttDef($order,&#8217;asc&#8217;);&nbsp;<\/p>\n<p>\u60f3\u8c03\u7528\u4ee5\u4e0b\u53c2\u6570\uff0c\u53ea\u9700\u8981\u6309\u7740\u4fee\u6539\u5c31\u884c&nbsp;<\/p>\n<pre>\u00a7&nbsp;orderby='hot'&nbsp;\u6216&nbsp;orderby='click'&nbsp;\u8868\u793a\u6309\u70b9\u51fb\u6570\u6392\u5217&nbsp;\n\u00a7&nbsp;orderby='sortrank'&nbsp;\u6216&nbsp;orderby='pubdate'&nbsp;\u6309\u51fa\u7248\u65f6\u95f4\u6392\u5217&nbsp;\n\u00a7&nbsp;orderby='near'&nbsp;\n\u00a7&nbsp;orderby=='lastpost'&nbsp;\u6309\u6700\u540e\u8bc4\u8bba\u65f6\u95f4&nbsp;\n\u00a7&nbsp;orderby=='scores'&nbsp;\u6309\u5f97\u5206\u6392\u5e8f&nbsp;\n\u00a7&nbsp;orderby='id'&nbsp;\u6309\u6587\u7ae0ID\u6392\u5e8f&nbsp;\n\u00a7&nbsp;orderby='rand'&nbsp;\u968f\u673a\u83b7\u5f97\u6307\u5b9a\u6761\u4ef6\u7684\u6587\u6863\u5217\u8868<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5bf9\u4e8ededecms 5.1\u7684\u7248\u672c<\/p>\n<p>id\u6392\u5e8f\u589e\u52a0\u529f\u80fd\u66f4&nbsp;<\/p>\n<pre>include\/inc\/.inc_fun_SpFullList.php\n\/\/\u6587\u6863\u6392\u5e8f\u7684\u65b9\u5f0f&nbsp;\n$ordersql&nbsp;=&nbsp;\"\";&nbsp;\nif($orderby=='rand')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;rand()\";&nbsp;\nelse&nbsp;if($orderby=='click'||$orderby=='hot')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;arcf.click&nbsp;desc\";&nbsp;\nelse&nbsp;if($orderby=='digg')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;arcf.digg&nbsp;desc\";&nbsp;\nelse&nbsp;if($orderby=='diggtime')&nbsp;$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;arcf.diggtime&nbsp;desc\";&nbsp;\nelse&nbsp;$ordersql=\"&nbsp;order&nbsp;by&nbsp;arcf.aid&nbsp;desc\";&nbsp;\n\/\/&nbsp;2013\u5e74\u9488\u5bf9\u4e13\u9898id\u5217\u8868\u6240\u52a0\u529f\u80fd&nbsp;\nif($idlist!=''){&nbsp;\n$ordersql&nbsp;=&nbsp;\"&nbsp;order&nbsp;by&nbsp;find_in_set(arcf.aid,'$idlist')\";&nbsp;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fdede\u4e13\u9898\u8282\u70b9\u6587\u7ae0\u600e\u4e48\u6309id\u7c7b\u578b\u6392\u5e8f\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>dede\u4e13\u9898\u8282\u70b9\u6587\u7ae0\u600e\u4e48\u6309id\u7c7b\u578b\u6392\u5e8f\uff1f dede\u4e13\u9898\u8282\u70b9\u6587\u7ae0\u6309id\uff0c\u70b9\u51fb\u7b49\u7c7b\u578b\u6392\u5e8f \u4f7f\u7528dedecms\u5f04\u4e00\u4e2a\u4e13\u9898\uff0c\u6dfb\u52a0\u5185\u5bb9\u53d1\u73b0\u5185\u5bb9\u6807\u9898\u4e0d\u662f\u6309\u7167\u6dfb\u52a0\u7684id\u6392\u5e8f\u7684\uff0c\u4e5f\u4e0d\u662f\u6309\u7167id\u987a\u5e8f\u6392\u5217\u7684\u3002\u611f\u89c9\u50cf\u662f\u968f\u673a\u7684 &nbsp;&nbsp;\u63a8\u8350\u5b66\u4e60\uff1a \u6309\u7167 \u6807\u9898\u7684id&nbsp; \u964d\u5e8f\u6392\u5217\u3002 \u8fd9\u4e2a\u6548\u679c\u9700\u8981\u4fee\u65392 \u4e2aphp\u6587\u4ef6\u3002 \u7b2c\u4e00\u6b65\u9aa4\uff1a 1. \u4fee\u6539&nbsp; includetaglibchannelspecialtopic.lib.php&nbsp; \u6587\u4ef6 2. \u5728\u7b2c52\u884c \u5904 \u6709\u8fd9\u884c\u4ee3\u7801\uff1a &nbsp;$ctag-&amp;gt;GetAtt(&#8216;imgwidth&#8217;),&nbsp;$ctag-&amp;gt;GetAtt(&#8216;imgheight&#8217;),&nbsp;&#8216;all&#8217;,&nbsp;&#8216;default&#8217;,&nbsp;$keywords,&nbsp;$listTemplet,&nbsp;0,&nbsp;$idlist, \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539\u6210\uff1a &nbsp;$ctag-&amp;gt;GetAtt(&#8216;imgwidth&#8217;),&nbsp;$ctag-&amp;gt;GetAtt(&#8216;imgheight&#8217;),&nbsp;&#8216;all&#8217;,&nbsp;&#8216;asc&#8217;,&nbsp;$keywords,&nbsp;$listTemplet,&nbsp;0,&nbsp;$idlist, \u767b\u5f55\u540e\u590d\u5236 3. \u4fdd\u5b58\u6587\u4ef6\u7ed3\u675f \u7b2c\u4e8c\u6b65\u9aa4\uff1a 1.\u4fee\u6539includetaglibarclist.lib.php 2. \u5927\u7ea6\u5728196\u884c\u5904\u3002\u6709\u8fd9\u884c\u4ee3\u7801\uff1a &nbsp;&nbsp;\/\/\u6587\u6863\u6392\u5e8f\u7684\u65b9\u5f0f &nbsp;&nbsp;&nbsp;&nbsp;$ordersql&nbsp;=&nbsp;&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;if($orderby==&#8217;hot&#8217;&nbsp;||&nbsp;$orderby==&#8217;click&#8217;)&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;order&nbsp;by&nbsp;arc.click&nbsp;$orderWay&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;&#8216;sortrank&#8217;&nbsp;||&nbsp;$orderby==&#8217;pubdate&#8217;)&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;order&nbsp;by&nbsp;arc.sortrank&nbsp;$orderWay&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;&#8216;id&#8217;)&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;&nbsp;order&nbsp;by&nbsp;arc.id&nbsp;$orderWay&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;&#8216;near&#8217;)&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;order&nbsp;by&nbsp;ABS(arc.id&nbsp;&#8211;&nbsp;&#8220;.$arcid.&#8221;)&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;&#8216;lastpost&#8217;)&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;&nbsp;order&nbsp;by&nbsp;arc.lastpost&nbsp;$orderWay&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;&#8216;scores&#8217;)&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;&nbsp;order&nbsp;by&nbsp;arc.scores&nbsp;$orderWay&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;&#8216;rand&#8217;)&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;&nbsp;order&nbsp;by&nbsp;rand()&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;\/\/\u589e\u52a0&nbsp;&nbsp;\u5f00\u59cb &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if($orderby&nbsp;==&nbsp;&#8216;asc&#8217;)&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;&nbsp;order&nbsp;by&nbsp;arc.id&nbsp;asc&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;\/\/\u589e\u52a0&nbsp;\u7ed3\u675f &nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;$ordersql&nbsp;=&nbsp;&#8221;&nbsp;order&nbsp;by&nbsp;arc.sortrank&nbsp;$orderWay&#8221;; \u767b\u5f55\u540e\u590d\u5236 3.&nbsp; \u4fee\u6539\u7ed3\u675f \u4e0b\u9762\u518d\u7ed9\u4e00\u4e2a\u5b9e\u73b0\u65b9\u6cd5 1\u3001\u627e\u5230 include\/taglib\/\/channel\/specialtopic.lib.php&nbsp; 2\u3001\u5c06 require_once(DEDEINC.&#8217;\/taglib\/arclist.lib.php&#8217;); \u6362\u6210 require_once(DEDEINC.&#8217;\/taglib\/arclist.lib2.php&#8217;);&nbsp; 3\u3001\u590d\u5236arclist.lib.php \u6539\u540d\u6210 arclist.lib2.php&nbsp; [&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-30486","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30486","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=30486"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30486\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}