{"id":30820,"date":"2024-11-25T13:22:02","date_gmt":"2024-11-25T05:22:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30820\/"},"modified":"2024-11-25T13:22:02","modified_gmt":"2024-11-25T05:22:02","slug":"%e7%bb%87%e6%a2%a6cms%e6%80%8e%e4%b9%88%e8%8e%b7%e5%8f%96%e5%bd%93%e5%89%8d%e6%a0%8f%e7%9b%ae%e8%b7%af%e5%be%84","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30820\/","title":{"rendered":"\u7ec7\u68a6cms\u600e\u4e48\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u8def\u5f84"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5e0ea05f741d3527.jpg\" class=\"aligncenter\" title=\"\u7ec7\u68a6cms\u600e\u4e48\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u8def\u5f84\u63d2\u56fe\" alt=\"\u7ec7\u68a6cms\u600e\u4e48\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u8def\u5f84\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>\u7ec7\u68a6cms\u600e\u4e48\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u8def\u5f84\uff1f<\/strong><\/p>\n<p>\u7ec7\u68a6cms\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u8def\u5f84\u53ca\u680f\u76ee\u540d\u79f0\u7684\u6807\u7b7e\u8c03\u7528\u53ca\u9876\u7ea7\u680f\u76ee<\/p>\n<p>\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>\u6807\u7b7e\u5982\u4e0b\uff1a<\/p>\n<p>\u5f53\u524d\uff1a<\/p>\n<pre>{dede:type}\n&lt;a&gt;&nbsp;[field:typename\/]&nbsp;&lt;\/a&gt;\n{\/dede:type}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u56e0\u4e3a{dede:field&nbsp; name=&#8217;arcurl&#8217;\/} \u8fd9\u4e2a\u83b7\u53d6\u5f53\u524d\u9875\u9762\u8def\u5f84\u7684\u6807\u7b7e\u53ea\u80fd\u5728\u5185\u5bb9\u9875\u4f7f\u7528\uff0c\u680f\u76ee\u9875\u6ca1\u6709\u6548\u679c\u7684\u3002\u6240\u4ee5\u5728\u680f\u76ee\u9875\u60f3\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u7684\u8def\u5f84\u53ca\u540d\u79f0\u7684\u8bdd\uff0c\u5c31\u8981\u7528\u4e0a\u9762\u8fd9\u4e2a\u6807\u7b7e\u3002&nbsp;<\/p>\n<p>\u800c\u83b7\u53d6\u7f51\u7ad9\u6240\u6709\u680f\u76ee\u540d\u79f0\u53ca\u8def\u5f84\u5217\u8868\u7684\u8bdd\uff0c\u5c31\u8981\u7528\u5230\u53e6\u4e00\u4e2a\u6807\u7b7e\uff1a {dede:channel}\uff0c\u8c03\u7528\u65b9\u5f0f\u5982\u4e0b\uff1a<\/p>\n<p>\u6240\u6709\u680f\u76ee<\/p>\n<pre><\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n  {dede:channel&nbsp;&nbsp;type=&#8217;top&#8217;&nbsp;row=&#8217;11&#8217;} <\/p>\n<li><\/li>\n<p> {\/dede:channel}\n<\/ul>\n<p>\u7ec7\u68a6dedeCMS\u7f51\u7ad9\u680f\u76ee\u9875\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u7684\u9876\u7ea7\u680f\u76ee\u540d\u79f0\u7684\u6807\u7b7e\u6559\u7a0b\uff1a&nbsp;<\/p>\n<p>\u6211\u4eec\u5728\u4f7f\u7528\u505a\u4e00\u4e9b\u7f51\u7ad9\u7684\u65f6\u5019\uff0c\u65f6\u5e38\u4f1a\u78b0\u5230\u9700\u8981\u8c03\u7528\u5f53\u524d\u680f\u76ee\u7684\u9876\u7ea7\u680f\u76ee\u540d\u79f0\u7684\u65f6\u5019\uff0c\u7ec7\u68a6\u9ed8\u8ba4{dede:field name=&#8217;typename&#8217; \/}&nbsp; \u53ef\u4ee5\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u9875\u4e0a\u4e00\u7ea7\u680f\u76ee\u7684\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u5f53\u524d\u680f\u76ee\u9876\u7ea7\u680f\u76ee\u540d\u79f0\u3002&nbsp;<\/p>\n<p>\u4e0b\u9762\u62d3\u5c55\u51fa\u4e00\u4e2a\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e2a\u6548\u679c\u3001:&nbsp;<\/p>\n<p>\u5728include\/common.func.php\u7684\u6700\u4e0b\u65b9\u52a0\u5165\uff1a&nbsp;<\/p>\n<p>\u5185\u5bb9\u6765\u81ea<\/p>\n<p>\u9876\u7ea7\u680f\u76ee\u540d<\/p>\n<pre>function&nbsp;GetTopTypename($id)\n{\n&nbsp;&nbsp;&nbsp;&nbsp;global&nbsp;$dsql;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$row&nbsp;=&nbsp;$dsql-&amp;gt;GetOne(\"SELECT&nbsp;typename,topid&nbsp;FROM&nbsp;jiemou_arctype&nbsp;WHERE&nbsp;id=&nbsp;&nbsp;$id\");\n&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($row['topid']&nbsp;==&nbsp;'0')\n&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;$row['typename'];\n&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;else\n&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$row1&nbsp;=&nbsp;&nbsp;$dsql-&amp;gt;GetOne(\"SELECT&nbsp;typename&nbsp;FROM&nbsp;jiemou_arctype&nbsp;WHERE&nbsp;id=&nbsp;&nbsp;$row[topid]\");\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$row1['typename'];\n&nbsp;&nbsp;&nbsp;&nbsp;}\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u6587\u7ae0\u9875\u6216\u8005\u680f\u76ee\u5217\u8868\u9875\u8c03\u7528\u65f6\uff0c\u5728\u6240\u8981\u8c03\u7528\u680f\u76ee\u540d\u79f0\u7684\u4f4d\u7f6e\u52a0\u4e0a\u4e0b\u9762\u8fd9\u884c\u4ee3\u7801\u5373\u53ef\u5b9e\u73b0\u3002 \u5185\u5bb9\u6765\u81ea&nbsp;<\/p>\n<pre>{dede:field&nbsp;name='typeid'&nbsp;function=\"GetTopTypename(@me)\"&nbsp;\/}&nbsp;\u5185\u5bb9\u6765\u81ea<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u6587\u7ae0\u9875\u4e2d\u7528\u4e0b\u9762\u8fd9\u4e2a\u65b9\u6cd5\u6765\u8c03\u7528&nbsp;<\/p>\n<p>\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u7684\u7236\u680f\u76ee<\/p>\n<p>\u5199\u6210\u4e00\u4e2a\u51fd\u6570\u653e\u5165include\/extend.func.php\u6587\u4ef6\u4e2d<\/p>\n<pre>function&nbsp;GetParentCategoryNameByID($CurrentID){\n$tsql&nbsp;=&nbsp;new&nbsp;DedeSql(false);&nbsp;\n$typelink2&nbsp;=&nbsp;'';\n$tsql-&amp;gt;SetQuery(\"Select&nbsp;i.typedir,i.typename&nbsp;From&nbsp;zz5unet_arctype&nbsp;t&nbsp;left&nbsp;join&nbsp;zz5unet_arctype&nbsp;i&nbsp;on&nbsp;i.id=t.reid&nbsp;where&nbsp;t.id='$CurrentID'\");\n$tsql-&amp;gt;Execute('t');&nbsp;&nbsp;&nbsp;\nwhile($row&nbsp;=&nbsp;$tsql-&amp;gt;GetArray('t',MYSQL_ASSOC))&nbsp;&nbsp;\n{\n$typelink2&nbsp;.=&nbsp;$row['typename'];&nbsp;&nbsp;\n}\nreturn&nbsp;$typelink2;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8c03\u7528\u65b9\u6cd5\uff1a{dede:field name=&#8217;id&#8217; function=&#8217;GetParentCategoryNameByID(@me)&#8217; \/}<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6cms\u600e\u4e48\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u8def\u5f84\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\u68a6cms\u600e\u4e48\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u8def\u5f84\uff1f \u7ec7\u68a6cms\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u8def\u5f84\u53ca\u680f\u76ee\u540d\u79f0\u7684\u6807\u7b7e\u8c03\u7528\u53ca\u9876\u7ea7\u680f\u76ee \u63a8\u8350\u5b66\u4e60\uff1a \u6807\u7b7e\u5982\u4e0b\uff1a \u5f53\u524d\uff1a {dede:type} &lt;a&gt;&nbsp;[field:typename\/]&nbsp;&lt;\/a&gt; {\/dede:type} \u767b\u5f55\u540e\u590d\u5236 \u56e0\u4e3a{dede:field&nbsp; name=&#8217;arcurl&#8217;\/} \u8fd9\u4e2a\u83b7\u53d6\u5f53\u524d\u9875\u9762\u8def\u5f84\u7684\u6807\u7b7e\u53ea\u80fd\u5728\u5185\u5bb9\u9875\u4f7f\u7528\uff0c\u680f\u76ee\u9875\u6ca1\u6709\u6548\u679c\u7684\u3002\u6240\u4ee5\u5728\u680f\u76ee\u9875\u60f3\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u7684\u8def\u5f84\u53ca\u540d\u79f0\u7684\u8bdd\uff0c\u5c31\u8981\u7528\u4e0a\u9762\u8fd9\u4e2a\u6807\u7b7e\u3002&nbsp; \u800c\u83b7\u53d6\u7f51\u7ad9\u6240\u6709\u680f\u76ee\u540d\u79f0\u53ca\u8def\u5f84\u5217\u8868\u7684\u8bdd\uff0c\u5c31\u8981\u7528\u5230\u53e6\u4e00\u4e2a\u6807\u7b7e\uff1a {dede:channel}\uff0c\u8c03\u7528\u65b9\u5f0f\u5982\u4e0b\uff1a \u6240\u6709\u680f\u76ee \u767b\u5f55\u540e\u590d\u5236 {dede:channel&nbsp;&nbsp;type=&#8217;top&#8217;&nbsp;row=&#8217;11&#8217;} {\/dede:channel} \u7ec7\u68a6dedeCMS\u7f51\u7ad9\u680f\u76ee\u9875\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u7684\u9876\u7ea7\u680f\u76ee\u540d\u79f0\u7684\u6807\u7b7e\u6559\u7a0b\uff1a&nbsp; \u6211\u4eec\u5728\u4f7f\u7528\u505a\u4e00\u4e9b\u7f51\u7ad9\u7684\u65f6\u5019\uff0c\u65f6\u5e38\u4f1a\u78b0\u5230\u9700\u8981\u8c03\u7528\u5f53\u524d\u680f\u76ee\u7684\u9876\u7ea7\u680f\u76ee\u540d\u79f0\u7684\u65f6\u5019\uff0c\u7ec7\u68a6\u9ed8\u8ba4{dede:field name=&#8217;typename&#8217; \/}&nbsp; \u53ef\u4ee5\u83b7\u53d6\u5f53\u524d\u680f\u76ee\u9875\u4e0a\u4e00\u7ea7\u680f\u76ee\u7684\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u5f53\u524d\u680f\u76ee\u9876\u7ea7\u680f\u76ee\u540d\u79f0\u3002&nbsp; \u4e0b\u9762\u62d3\u5c55\u51fa\u4e00\u4e2a\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e2a\u6548\u679c\u3001:&nbsp; \u5728include\/common.func.php\u7684\u6700\u4e0b\u65b9\u52a0\u5165\uff1a&nbsp; \u5185\u5bb9\u6765\u81ea \u9876\u7ea7\u680f\u76ee\u540d function&nbsp;GetTopTypename($id) { &nbsp;&nbsp;&nbsp;&nbsp;global&nbsp;$dsql; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$row&nbsp;=&nbsp;$dsql-&amp;gt;GetOne(&#8220;SELECT&nbsp;typename,topid&nbsp;FROM&nbsp;jiemou_arctype&nbsp;WHERE&nbsp;id=&nbsp;&nbsp;$id&#8221;); &nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($row[&#8216;topid&#8217;]&nbsp;==&nbsp;&#8216;0&#8217;) &nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;$row[&#8216;typename&#8217;]; &nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;else &nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$row1&nbsp;=&nbsp;&nbsp;$dsql-&amp;gt;GetOne(&#8220;SELECT&nbsp;typename&nbsp;FROM&nbsp;jiemou_arctype&nbsp;WHERE&nbsp;id=&nbsp;&nbsp;$row[topid]&#8221;); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$row1[&#8216;typename&#8217;]; &nbsp;&nbsp;&nbsp;&nbsp;} } \u767b\u5f55\u540e\u590d\u5236 \u5728\u6587\u7ae0\u9875\u6216\u8005\u680f\u76ee\u5217\u8868\u9875\u8c03\u7528\u65f6\uff0c\u5728\u6240\u8981\u8c03\u7528\u680f\u76ee\u540d\u79f0\u7684\u4f4d\u7f6e\u52a0\u4e0a\u4e0b\u9762\u8fd9\u884c\u4ee3\u7801\u5373\u53ef\u5b9e\u73b0\u3002 \u5185\u5bb9\u6765\u81ea&nbsp; {dede:field&nbsp;name=&#8217;typeid&#8217;&nbsp;function=&#8221;GetTopTypename(@me)&#8221;&nbsp;\/}&nbsp;\u5185\u5bb9\u6765\u81ea \u767b\u5f55\u540e\u590d\u5236 \u5728\u6587\u7ae0\u9875\u4e2d\u7528\u4e0b\u9762\u8fd9\u4e2a\u65b9\u6cd5\u6765\u8c03\u7528&nbsp; \u83b7\u53d6\u5f53\u524d\u680f\u76ee\u7684\u7236\u680f\u76ee \u5199\u6210\u4e00\u4e2a\u51fd\u6570\u653e\u5165include\/extend.func.php\u6587\u4ef6\u4e2d function&nbsp;GetParentCategoryNameByID($CurrentID){ $tsql&nbsp;=&nbsp;new&nbsp;DedeSql(false);&nbsp; $typelink2&nbsp;=&nbsp;&#8221;; $tsql-&amp;gt;SetQuery(&#8220;Select&nbsp;i.typedir,i.typename&nbsp;From&nbsp;zz5unet_arctype&nbsp;t&nbsp;left&nbsp;join&nbsp;zz5unet_arctype&nbsp;i&nbsp;on&nbsp;i.id=t.reid&nbsp;where&nbsp;t.id=&#8217;$CurrentID'&#8221;); $tsql-&amp;gt;Execute(&#8216;t&#8217;);&nbsp;&nbsp;&nbsp; while($row&nbsp;=&nbsp;$tsql-&amp;gt;GetArray(&#8216;t&#8217;,MYSQL_ASSOC))&nbsp;&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-30820","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30820","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=30820"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30820\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}