{"id":33594,"date":"2024-11-25T16:12:41","date_gmt":"2024-11-25T08:12:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/33594\/"},"modified":"2024-11-25T16:12:41","modified_gmt":"2024-11-25T08:12:41","slug":"dedecms%e6%80%8e%e4%b9%88%e5%ae%9e%e7%8e%b0%e6%a8%a1%e6%9d%bf%e6%9b%bf%e6%8d%a2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/33594\/","title":{"rendered":"dedecms\u600e\u4e48\u5b9e\u73b0\u6a21\u677f\u66ff\u6362"},"content":{"rendered":"<blockquote><p>\n  \u5728 dedecms \u4e2d\u5b9e\u73b0\u6a21\u677f\u66ff\u6362\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u4fee\u6539 global.cfg \u6587\u4ef6\uff0c\u8bbe\u7f6e\u6240\u9700\u7684\u8bed\u8a00\u5305\u3002\u4fee\u6539 taglib.inc.php \u94a9\u5b50\u6587\u4ef6\uff0c\u6dfb\u52a0\u5bf9\u8bed\u8a00\u540e\u7f00\u6a21\u677f\u6587\u4ef6\u7684\u652f\u6301\u3002\u521b\u5efa\u5e26\u6709\u8bed\u8a00\u540e\u7f00\u7684\u65b0\u6a21\u677f\u6587\u4ef6\uff0c\u4fee\u6539\u6240\u9700\u5185\u5bb9\u3002\u6e05\u9664 dedecms \u7f13\u5b58\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/16\/2024041612121541047.jpg\" class=\"aligncenter\" title=\"dedecms\u600e\u4e48\u5b9e\u73b0\u6a21\u677f\u66ff\u6362\u63d2\u56fe\" alt=\"dedecms\u600e\u4e48\u5b9e\u73b0\u6a21\u677f\u66ff\u6362\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5b9e\u73b0 Dedecms \u6a21\u677f\u66ff\u6362<\/strong><\/p>\n<p><strong>\u5feb\u901f\u56de\u7b54\uff1a<\/strong><\/p>\n<p>\u8981\u5728 Dedecms \u4e2d\u5b9e\u73b0\u6a21\u677f\u66ff\u6362\uff0c\u60a8\u9700\u8981\u4f7f\u7528 global.cfg \u6587\u4ef6\u548c ~include\/hook\/taglib.inc.php \u94a9\u5b50\u6587\u4ef6\u3002<\/p>\n<p><strong>\u8be6\u7ec6\u8bf4\u660e\uff1a<\/strong><\/p>\n<p><strong>1. \u4fee\u6539 global.cfg \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 \/data\/admin\/config.cache.inc.php \u6587\u4ef6\u3002<\/li>\n<li>\u5728 $cfg_soft_lang \u53d8\u91cf\u4e0b\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<pre>$cfg_soft_lang = 'en';  \/\/ \u66ff\u6362\u4e3a\u6240\u9700\u7684\u8bed\u8a00\u5305<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06\u6587\u4ef6\u4fdd\u5b58\u5e76\u5173\u95ed\u3002<\/li>\n<\/ul>\n<p><strong>2. \u4fee\u6539 taglib.inc.php \u94a9\u5b50\u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 \/~include\/hook\/taglib.inc.php \u6587\u4ef6\u3002<\/li>\n<li>\u641c\u7d22\u4ee5\u4e0b\u4ee3\u7801\u5757\uff1a<\/li>\n<\/ul>\n<pre>@include_once DedeInclude('templets\/'.ereg_replace(\"[^a-z0-9_\\\/.]+\",\"\",$tname).'.htm');<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06\u5176\u66ff\u6362\u4e3a\uff1a<\/li>\n<\/ul>\n<pre>if(file_exists(DEDEROOT.'\/templets\/'.ereg_replace(\"[^a-z0-9_\\\/.]+\",\"\",$tname).'_'.$cfg_soft_lang.'.htm'))\n@include_once DedeInclude('templets\/'.ereg_replace(\"[^a-z0-9_\\\/.]+\",\"\",$tname).'_'.$cfg_soft_lang.'.htm');\nelse\n@include_once DedeInclude('templets\/'.ereg_replace(\"[^a-z0-9_\\\/.]+\",\"\",$tname).'.htm');<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u51c6\u5907\u66ff\u6362\u6a21\u677f<\/strong><\/p>\n<ul>\n<li>\u521b\u5efa\u4e00\u4e2a\u4e0e\u539f\u59cb\u6a21\u677f\u540c\u540d\u7684\u6a21\u677f\uff0c\u5e76\u5728\u6587\u4ef6\u540d\u540e\u6dfb\u52a0\u8bed\u8a00\u540e\u7f00\uff08\u4f8b\u5982\uff1a_en.htm\uff09\u3002<\/li>\n<li>\u5728\u66ff\u6362\u6a21\u677f\u6587\u4ef6\u4e2d\uff0c\u4fee\u6539\u6587\u672c\u3001\u56fe\u50cf\u6216\u5176\u4ed6\u5143\u7d20\u4ee5\u9002\u5e94\u4e0d\u540c\u7684\u8bed\u8a00\u3002<\/li>\n<\/ul>\n<p><strong>4. \u6e05\u9664\u7f13\u5b58<\/strong><\/p>\n<ul>\n<li>\u6e05\u9664 Dedecms \u7f13\u5b58\uff0c\u4ee5\u786e\u4fdd\u66f4\u6539\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u66ff\u6362\u6a21\u677f\u7684\u8bed\u8a00\u540e\u7f00\u4e0e global.cfg \u6587\u4ef6\u4e2d\u6307\u5b9a\u7684\u8bed\u8a00\u76f8\u5339\u914d\u3002<\/li>\n<li>\u5982\u679c\u6709\u4e0d\u540c\u7684\u6a21\u677f\u6587\u4ef6\u9700\u8981\u66ff\u6362\uff0c\u8bf7\u4e3a\u6bcf\u4e2a\u6a21\u677f\u91cd\u590d\u4e0a\u8ff0\u6b65\u9aa4\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5b9e\u73b0\u6a21\u677f\u66ff\u6362\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>\u5728 dedecms \u4e2d\u5b9e\u73b0\u6a21\u677f\u66ff\u6362\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u4fee\u6539 global.cfg \u6587\u4ef6\uff0c\u8bbe\u7f6e\u6240\u9700\u7684\u8bed\u8a00\u5305\u3002\u4fee\u6539 taglib.inc.php \u94a9\u5b50\u6587\u4ef6\uff0c\u6dfb\u52a0\u5bf9\u8bed\u8a00\u540e\u7f00\u6a21\u677f\u6587\u4ef6\u7684\u652f\u6301\u3002\u521b\u5efa\u5e26\u6709\u8bed\u8a00\u540e\u7f00\u7684\u65b0\u6a21\u677f\u6587\u4ef6\uff0c\u4fee\u6539\u6240\u9700\u5185\u5bb9\u3002\u6e05\u9664 dedecms \u7f13\u5b58\u3002 \u5982\u4f55\u5b9e\u73b0 Dedecms \u6a21\u677f\u66ff\u6362 \u5feb\u901f\u56de\u7b54\uff1a \u8981\u5728 Dedecms \u4e2d\u5b9e\u73b0\u6a21\u677f\u66ff\u6362\uff0c\u60a8\u9700\u8981\u4f7f\u7528 global.cfg \u6587\u4ef6\u548c ~include\/hook\/taglib.inc.php \u94a9\u5b50\u6587\u4ef6\u3002 \u8be6\u7ec6\u8bf4\u660e\uff1a 1. \u4fee\u6539 global.cfg \u6587\u4ef6 \u6253\u5f00 \/data\/admin\/config.cache.inc.php \u6587\u4ef6\u3002 \u5728 $cfg_soft_lang \u53d8\u91cf\u4e0b\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a $cfg_soft_lang = &#8216;en&#8217;; \/\/ \u66ff\u6362\u4e3a\u6240\u9700\u7684\u8bed\u8a00\u5305 \u767b\u5f55\u540e\u590d\u5236 \u5c06\u6587\u4ef6\u4fdd\u5b58\u5e76\u5173\u95ed\u3002 2. \u4fee\u6539 taglib.inc.php \u94a9\u5b50\u6587\u4ef6 \u6253\u5f00 \/~include\/hook\/taglib.inc.php \u6587\u4ef6\u3002 \u641c\u7d22\u4ee5\u4e0b\u4ee3\u7801\u5757\uff1a @include_once DedeInclude(&#8216;templets\/&#8217;.ereg_replace(&#8220;[^a-z0-9_\\\/.]+&#8221;,&#8221;&#8221;,$tname).&#8217;.htm&#8217;); \u767b\u5f55\u540e\u590d\u5236 \u5c06\u5176\u66ff\u6362\u4e3a\uff1a if(file_exists(DEDEROOT.&#8217;\/templets\/&#8217;.ereg_replace(&#8220;[^a-z0-9_\\\/.]+&#8221;,&#8221;&#8221;,$tname).&#8217;_&#8217;.$cfg_soft_lang.&#8217;.htm&#8217;)) @include_once DedeInclude(&#8216;templets\/&#8217;.ereg_replace(&#8220;[^a-z0-9_\\\/.]+&#8221;,&#8221;&#8221;,$tname).&#8217;_&#8217;.$cfg_soft_lang.&#8217;.htm&#8217;); else @include_once [&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-33594","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33594","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=33594"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33594\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=33594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=33594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=33594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}