{"id":28730,"date":"2024-11-25T13:19:24","date_gmt":"2024-11-25T05:19:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28730\/"},"modified":"2024-11-25T13:19:24","modified_gmt":"2024-11-25T05:19:24","slug":"%e7%bb%87%e6%a2%a6dedecms-tag%e6%a0%87%e7%ad%be%e6%97%a0%e6%b3%95%e6%89%be%e5%88%b0%e5%92%8c%e5%ae%9e%e7%8e%b0%e5%bd%a9%e8%89%b2%e6%a0%87%e7%ad%be%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28730\/","title":{"rendered":"\u7ec7\u68a6dedecms TAG\u6807\u7b7e\u65e0\u6cd5\u627e\u5230\u548c\u5b9e\u73b0\u5f69\u8272\u6807\u7b7e\u65b9\u6cd5"},"content":{"rendered":"<p><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/029\/5de6051843e0f178.jpg\" class=\"aligncenter\" title=\"\u7ec7\u68a6dedecms TAG\u6807\u7b7e\u65e0\u6cd5\u627e\u5230\u548c\u5b9e\u73b0\u5f69\u8272\u6807\u7b7e\u65b9\u6cd5\u63d2\u56fe\" alt=\"\u7ec7\u68a6dedecms TAG\u6807\u7b7e\u65e0\u6cd5\u627e\u5230\u548c\u5b9e\u73b0\u5f69\u8272\u6807\u7b7e\u65b9\u6cd5\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>&nbsp;TAG \u9875\u627e\u4e0d\u5230\u6807\u7b7e\u7684\u95ee\u9898\u89e3\u51b3&nbsp;<\/strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \uff08\u63a8\u8350\u5b66\u4e60\uff1a\uff09<\/p>\n<p>&nbsp;\u5f53\u6211\u4eec\u70b9\u51fb tags.php \u9875\u7684\u67d0\u4e2a\u6807\u7b7e\u7684\u65f6\u5019\uff0c\u6709\u65f6\u4f1a\u63d0\u793a\uff1a\u201c\u7cfb\u7edf\u65e0\u6b64\u6807\u7b7e\uff0c\u53ef \u80fd\u5df2\u7ecf\u79fb\u9664\uff01\u201d&nbsp;<\/p>\n<p>\u4f46\u662f\u6211\u4eec\u68c0\u67e5\u7a0b\u5e8f\u540e\u53f0\uff0c\u4ee5\u53ca\u524d\u53f0\u663e\u793a\u9875\u9762\u3002\u8fd9\u4e2a\u6807\u7b7e\u786e\u5b9e\u5b58\u5728\uff0c\u5982\u679c\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u90a3\uff1f&nbsp;<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6cd5\uff1a&nbsp;<\/strong><\/p>\n<p>Dedecms \u7a0b\u5e8f\u7684\u6839\u76ee\u5f55\u6709\u4e00\u4e2atags.php \u7684\u6587\u4ef6&nbsp;<\/p>\n<p><strong>\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\uff1a&nbsp;<\/strong><\/p>\n<p>\u627e\u5230 $tag = FilterSearch(urldecode($tag));&nbsp;<\/p>\n<p>\u66f4\u6539\u4e3a $tag = urldecode($tag) ;&nbsp;<\/p>\n<p>\u5373\u53ef\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002&nbsp;<\/p>\n<p><strong>dedeTAG\u5f69\u8272\u6807\u7b7e\u5236\u4f5c\u65b9\u6cd5\uff1a<\/strong><\/p>\n<p>1.\u5728 \/include\/common.func.php \u4e2d\u52a0\u5165\u5982\u4e0b\u51fd\u6570&nbsp;<\/p>\n<pre>function&nbsp;getTagStyle()&nbsp;\n\n{&nbsp;\n\n$minFontSize=8;&nbsp;\/\/\u6700\u5c0f\u5b57\u4f53\u5927\u5c0f,\u53ef\u6839\u636e\u9700\u8981\u81ea\u884c\u66f4\u6539&nbsp;\n\n$maxFontSize=18;&nbsp;\/\/\u6700\u5927\u5b57\u4f53\u5927\u5c0f,\u53ef\u6839\u636e\u9700\u8981\u81ea\u884c\u66f4\u6539&nbsp;\n\nreturn&nbsp;'font-size:'.($minFontSize+lcg_value()*(abs($maxFontSize-$minFontSize))).'px;&nbsp;\n\ncolor:#'.dechex(rand(0,255)).dechex(rand(0,196)).dechex(rand(0,255));&nbsp;\n\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2.\u5728\u6a21\u677f\u4e2d\u7528\u5982\u4e0b\u4ee3\u7801\u8c03\u7528\u6807\u7b7e&nbsp;<\/strong><\/p>\n<pre>{dede:tag&nbsp;row='45'&nbsp;getall='1'&nbsp;sort='hot'}&nbsp;\n&nbsp;\n&lt;a gstyle&gt;[field:tag&nbsp;\/]&lt;\/a&gt;&nbsp;\n&nbsp;\n{\/dede:tag}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6dedecms TAG\u6807\u7b7e\u65e0\u6cd5\u627e\u5230\u548c\u5b9e\u73b0\u5f69\u8272\u6807\u7b7e\u65b9\u6cd5\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>&nbsp;TAG \u9875\u627e\u4e0d\u5230\u6807\u7b7e\u7684\u95ee\u9898\u89e3\u51b3&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \uff08\u63a8\u8350\u5b66\u4e60\uff1a\uff09 &nbsp;\u5f53\u6211\u4eec\u70b9\u51fb tags.php \u9875\u7684\u67d0\u4e2a\u6807\u7b7e\u7684\u65f6\u5019\uff0c\u6709\u65f6\u4f1a\u63d0\u793a\uff1a\u201c\u7cfb\u7edf\u65e0\u6b64\u6807\u7b7e\uff0c\u53ef \u80fd\u5df2\u7ecf\u79fb\u9664\uff01\u201d&nbsp; \u4f46\u662f\u6211\u4eec\u68c0\u67e5\u7a0b\u5e8f\u540e\u53f0\uff0c\u4ee5\u53ca\u524d\u53f0\u663e\u793a\u9875\u9762\u3002\u8fd9\u4e2a\u6807\u7b7e\u786e\u5b9e\u5b58\u5728\uff0c\u5982\u679c\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u90a3\uff1f&nbsp; \u89e3\u51b3\u65b9\u6cd5\uff1a&nbsp; Dedecms \u7a0b\u5e8f\u7684\u6839\u76ee\u5f55\u6709\u4e00\u4e2atags.php \u7684\u6587\u4ef6&nbsp; \u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\uff1a&nbsp; \u627e\u5230 $tag = FilterSearch(urldecode($tag));&nbsp; \u66f4\u6539\u4e3a $tag = urldecode($tag) ;&nbsp; \u5373\u53ef\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002&nbsp; dedeTAG\u5f69\u8272\u6807\u7b7e\u5236\u4f5c\u65b9\u6cd5\uff1a 1.\u5728 \/include\/common.func.php \u4e2d\u52a0\u5165\u5982\u4e0b\u51fd\u6570&nbsp; function&nbsp;getTagStyle()&nbsp; {&nbsp; $minFontSize=8;&nbsp;\/\/\u6700\u5c0f\u5b57\u4f53\u5927\u5c0f,\u53ef\u6839\u636e\u9700\u8981\u81ea\u884c\u66f4\u6539&nbsp; $maxFontSize=18;&nbsp;\/\/\u6700\u5927\u5b57\u4f53\u5927\u5c0f,\u53ef\u6839\u636e\u9700\u8981\u81ea\u884c\u66f4\u6539&nbsp; return&nbsp;&#8216;font-size:&#8217;.($minFontSize+lcg_value()*(abs($maxFontSize-$minFontSize))).&#8217;px;&nbsp; color:#&#8217;.dechex(rand(0,255)).dechex(rand(0,196)).dechex(rand(0,255));&nbsp; } \u767b\u5f55\u540e\u590d\u5236 2.\u5728\u6a21\u677f\u4e2d\u7528\u5982\u4e0b\u4ee3\u7801\u8c03\u7528\u6807\u7b7e&nbsp; {dede:tag&nbsp;row=&#8217;45&#8217;&nbsp;getall=&#8217;1&#8242;&nbsp;sort=&#8217;hot&#8217;}&nbsp; &nbsp; &lt;a gstyle&gt;[field:tag&nbsp;\/]&lt;\/a&gt;&nbsp; &nbsp; {\/dede:tag} \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6dedecms TAG\u6807\u7b7e\u65e0\u6cd5\u627e\u5230\u548c\u5b9e\u73b0\u5f69\u8272\u6807\u7b7e\u65b9\u6cd5\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-28730","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28730","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=28730"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28730\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}