{"id":30275,"date":"2024-11-25T16:10:36","date_gmt":"2024-11-25T08:10:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30275\/"},"modified":"2024-11-25T16:10:36","modified_gmt":"2024-11-25T08:10:36","slug":"%e7%bb%87%e6%a2%a6dedecms%e4%b8%ad%e6%80%8e%e4%b9%88%e5%a2%9e%e5%8a%a0%e7%88%b6%e6%a0%8f%e7%9b%ae%e8%b0%83%e7%94%a8%e5%8f%8a%e5%a4%9a%e7%ba%a7%e6%94%af%e6%8c%81currentstyle","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30275\/","title":{"rendered":"\u7ec7\u68a6DEDECMS\u4e2d\u600e\u4e48\u589e\u52a0\u7236\u680f\u76ee\u8c03\u7528\u53ca\u591a\u7ea7\u652f\u6301currentstyle"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5df2ecbc57eaa149.jpg\" class=\"aligncenter\" title=\"\u7ec7\u68a6DEDECMS\u4e2d\u600e\u4e48\u589e\u52a0\u7236\u680f\u76ee\u8c03\u7528\u53ca\u591a\u7ea7\u652f\u6301currentstyle\u63d2\u56fe\" alt=\"\u7ec7\u68a6DEDECMS\u4e2d\u600e\u4e48\u589e\u52a0\u7236\u680f\u76ee\u8c03\u7528\u53ca\u591a\u7ea7\u652f\u6301currentstyle\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>\u7ec7\u68a6\u4e2d\u600e\u4e48\u589e\u52a0\u7236\u680f\u76ee\u8c03\u7528\u53ca\u591a\u7ea7\u652f\u6301currentstyle\uff1f<\/strong><\/p>\n<p>\u56e0\u4e3a\u672c\u4eba\u9700\u8981\uff0c\u81ea\u5df1\u5c31\u52a8\u624b\u4fee\u6539\u4e86\u5176\u4e2d\u4ee3\u7801\uff0c\u62ff\u6765\u5206\u4eab\uff0c\u80fd\u7528\u5230\u7684\u670b\u53cb\u53ef\u4ee5\u501f\u9274\u4e00\u4e0b\uff01&nbsp;<\/p>\n<p>\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>includeinc_typelink.php&nbsp;<\/p>\n<p>1\u3001\u5728\u8fd9\u6bb5\u4ee3\u7801\u540e\uff08\u5927\u6982263\u884c\uff09&nbsp;<\/p>\n<pre>if($reID==0&nbsp;&amp;amp;&amp;amp;&nbsp;$typeid&amp;gt;0){&nbsp;\n$dbrow&nbsp;=&nbsp;$this-&amp;gt;dsql-&amp;gt;GetOne(\"Select&nbsp;reID&nbsp;From&nbsp;dede_arctype&nbsp;where&nbsp;ID='$typeid'&nbsp;\");&nbsp;\nif(is_array($dbrow))&nbsp;$reID&nbsp;=&nbsp;$dbrow['reID'];&nbsp;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u589e\u52a0&nbsp;<\/p>\n<pre>\/\/&nbsp;\u65b0\u589e\u4ee3\u7801&nbsp;\nif($reID&amp;gt;0){&nbsp;\n$dbrow&nbsp;=&nbsp;$this-&amp;gt;dsql-&amp;gt;GetOne(\"Select&nbsp;reID&nbsp;From&nbsp;dede_arctype&nbsp;where&nbsp;ID='$reID'\");&nbsp;\nif(is_array($dbrow))&nbsp;$parentID&nbsp;=&nbsp;$dbrow['reID'];&nbsp;\n}&nbsp;\n\/\/&nbsp;\u65b0\u589e\u4ee3\u7801\u7ed3\u675f\u7ed3\u675f<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>&nbsp;2\u3001\u7136\u540e\u5728\u4ee5\u4e0b\u4ee3\u7801\u540e\uff1a&nbsp;<\/p>\n<pre>else&nbsp;if($typetype==\"self\"){&nbsp;\n$sql&nbsp;=&nbsp;\"Select&nbsp;ID,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl&nbsp;From&nbsp;dede_arctype&nbsp;where&nbsp;reID='$reID'&nbsp;And&nbsp;ishidden1&nbsp;order&nbsp;by&nbsp;sortrank&nbsp;asc&nbsp;limit&nbsp;0,$row\";&nbsp;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u589e\u52a0&nbsp;<\/p>\n<pre>else&nbsp;if($typetype==\"parent\"){&nbsp;\/\/\u65b0\u589e\u4ee3\u7801&nbsp;\u83b7\u5f97\u4e0a\u7ea7\u680f\u76ee&nbsp;\n$sql&nbsp;=&nbsp;\"Select&nbsp;ID,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl&nbsp;From&nbsp;dede_arctype&nbsp;where&nbsp;reID='$parentID'&nbsp;And&nbsp;ishidden1&nbsp;order&nbsp;by&nbsp;sortrank&nbsp;asc&nbsp;limit&nbsp;0,$row\";&nbsp;\n}&nbsp;\n\/\/\u65b0\u589e\u4ee3\u7801\u7ed3\u675f&nbsp;\u83b7\u5f97\u4e0a\u7ea7\u680f\u76ee<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>3\u3001\u4fee\u6539\u4e0b\u9762\u4e00\u53e5\u4ee3\u7801&nbsp;<\/p>\n<pre>if($row['ID']==\"$typeid\"&nbsp;&amp;amp;&amp;amp;&nbsp;$myinnertext&nbsp;!=&nbsp;''){<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fee\u6539\u4e3a\uff1a&nbsp;<\/p>\n<pre>if(($row['ID']==\"$typeid\"&nbsp;||&nbsp;$row['ID']==\"$reID\"&nbsp;||&nbsp;$row['ID']==\"$parentID\")&nbsp;&amp;amp;&amp;amp;&nbsp;$myinnertext&nbsp;!=&nbsp;''){<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7ecf\u8fc73\u4e2a\u6b65\u9aa4\u7684\u4fee\u6539&nbsp;<\/p>\n<p>\u53ef\u4ee5\u5b9e\u73b02\u4e2a\u529f\u80fd\uff1a&nbsp;<\/p>\n<p>1\u3001\u8c03\u7528\u7236\u7ea7\u680f\u76ee\uff08\u4e0a\u7ea7\uff09\uff0c\u5bf9\u4e8e\u680f\u76ee\u5206\u7ea7\u592a\u6df1\u7684\u5f88\u6709\u7528&nbsp;<\/p>\n<p>\u65b9\u6cd5\uff1a&nbsp;<\/p>\n<pre>{dede:channel&nbsp;type='parent'}{dede:channel}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>2\u3001\u53ef\u4ee5\u8c03\u7528currentstyle\uff0c\u5bf9\u4e8e\u680f\u76ee\u5206\u7ea7\u592a\u6df1\uff0c\u8fd8\u60f3\u6539\u53d8\u5f53\u524d\u680f\u76ee\u6837\u5f0f\u7684\u5f88\u6709\u7528\uff01&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6DEDECMS\u4e2d\u600e\u4e48\u589e\u52a0\u7236\u680f\u76ee\u8c03\u7528\u53ca\u591a\u7ea7\u652f\u6301currentstyle\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\u4e2d\u600e\u4e48\u589e\u52a0\u7236\u680f\u76ee\u8c03\u7528\u53ca\u591a\u7ea7\u652f\u6301currentstyle\uff1f \u56e0\u4e3a\u672c\u4eba\u9700\u8981\uff0c\u81ea\u5df1\u5c31\u52a8\u624b\u4fee\u6539\u4e86\u5176\u4e2d\u4ee3\u7801\uff0c\u62ff\u6765\u5206\u4eab\uff0c\u80fd\u7528\u5230\u7684\u670b\u53cb\u53ef\u4ee5\u501f\u9274\u4e00\u4e0b\uff01&nbsp; \u63a8\u8350\u5b66\u4e60\uff1a includeinc_typelink.php&nbsp; 1\u3001\u5728\u8fd9\u6bb5\u4ee3\u7801\u540e\uff08\u5927\u6982263\u884c\uff09&nbsp; if($reID==0&nbsp;&amp;amp;&amp;amp;&nbsp;$typeid&amp;gt;0){&nbsp; $dbrow&nbsp;=&nbsp;$this-&amp;gt;dsql-&amp;gt;GetOne(&#8220;Select&nbsp;reID&nbsp;From&nbsp;dede_arctype&nbsp;where&nbsp;ID=&#8217;$typeid&#8217;&nbsp;&#8220;);&nbsp; if(is_array($dbrow))&nbsp;$reID&nbsp;=&nbsp;$dbrow[&#8216;reID&#8217;];&nbsp; } \u767b\u5f55\u540e\u590d\u5236 \u589e\u52a0&nbsp; \/\/&nbsp;\u65b0\u589e\u4ee3\u7801&nbsp; if($reID&amp;gt;0){&nbsp; $dbrow&nbsp;=&nbsp;$this-&amp;gt;dsql-&amp;gt;GetOne(&#8220;Select&nbsp;reID&nbsp;From&nbsp;dede_arctype&nbsp;where&nbsp;ID=&#8217;$reID'&#8221;);&nbsp; if(is_array($dbrow))&nbsp;$parentID&nbsp;=&nbsp;$dbrow[&#8216;reID&#8217;];&nbsp; }&nbsp; \/\/&nbsp;\u65b0\u589e\u4ee3\u7801\u7ed3\u675f\u7ed3\u675f \u767b\u5f55\u540e\u590d\u5236 &nbsp;2\u3001\u7136\u540e\u5728\u4ee5\u4e0b\u4ee3\u7801\u540e\uff1a&nbsp; else&nbsp;if($typetype==&#8221;self&#8221;){&nbsp; $sql&nbsp;=&nbsp;&#8220;Select&nbsp;ID,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl&nbsp;From&nbsp;dede_arctype&nbsp;where&nbsp;reID=&#8217;$reID&#8217;&nbsp;And&nbsp;ishidden1&nbsp;order&nbsp;by&nbsp;sortrank&nbsp;asc&nbsp;limit&nbsp;0,$row&#8221;;&nbsp; } \u767b\u5f55\u540e\u590d\u5236 \u589e\u52a0&nbsp; else&nbsp;if($typetype==&#8221;parent&#8221;){&nbsp;\/\/\u65b0\u589e\u4ee3\u7801&nbsp;\u83b7\u5f97\u4e0a\u7ea7\u680f\u76ee&nbsp; $sql&nbsp;=&nbsp;&#8220;Select&nbsp;ID,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl&nbsp;From&nbsp;dede_arctype&nbsp;where&nbsp;reID=&#8217;$parentID&#8217;&nbsp;And&nbsp;ishidden1&nbsp;order&nbsp;by&nbsp;sortrank&nbsp;asc&nbsp;limit&nbsp;0,$row&#8221;;&nbsp; }&nbsp; \/\/\u65b0\u589e\u4ee3\u7801\u7ed3\u675f&nbsp;\u83b7\u5f97\u4e0a\u7ea7\u680f\u76ee \u767b\u5f55\u540e\u590d\u5236 3\u3001\u4fee\u6539\u4e0b\u9762\u4e00\u53e5\u4ee3\u7801&nbsp; if($row[&#8216;ID&#8217;]==&#8221;$typeid&#8221;&nbsp;&amp;amp;&amp;amp;&nbsp;$myinnertext&nbsp;!=&nbsp;&#8221;){ \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539\u4e3a\uff1a&nbsp; if(($row[&#8216;ID&#8217;]==&#8221;$typeid&#8221;&nbsp;||&nbsp;$row[&#8216;ID&#8217;]==&#8221;$reID&#8221;&nbsp;||&nbsp;$row[&#8216;ID&#8217;]==&#8221;$parentID&#8221;)&nbsp;&amp;amp;&amp;amp;&nbsp;$myinnertext&nbsp;!=&nbsp;&#8221;){ \u767b\u5f55\u540e\u590d\u5236 \u7ecf\u8fc73\u4e2a\u6b65\u9aa4\u7684\u4fee\u6539&nbsp; \u53ef\u4ee5\u5b9e\u73b02\u4e2a\u529f\u80fd\uff1a&nbsp; 1\u3001\u8c03\u7528\u7236\u7ea7\u680f\u76ee\uff08\u4e0a\u7ea7\uff09\uff0c\u5bf9\u4e8e\u680f\u76ee\u5206\u7ea7\u592a\u6df1\u7684\u5f88\u6709\u7528&nbsp; \u65b9\u6cd5\uff1a&nbsp; {dede:channel&nbsp;type=&#8217;parent&#8217;}{dede:channel} \u767b\u5f55\u540e\u590d\u5236 2\u3001\u53ef\u4ee5\u8c03\u7528currentstyle\uff0c\u5bf9\u4e8e\u680f\u76ee\u5206\u7ea7\u592a\u6df1\uff0c\u8fd8\u60f3\u6539\u53d8\u5f53\u524d\u680f\u76ee\u6837\u5f0f\u7684\u5f88\u6709\u7528\uff01&nbsp; \u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6DEDECMS\u4e2d\u600e\u4e48\u589e\u52a0\u7236\u680f\u76ee\u8c03\u7528\u53ca\u591a\u7ea7\u652f\u6301currentstyle\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-30275","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30275","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=30275"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30275\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}