{"id":4160,"date":"2020-11-02T11:47:14","date_gmt":"2020-11-02T03:47:14","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=4160"},"modified":"2021-04-17T23:33:37","modified_gmt":"2021-04-17T15:33:37","slug":"%e7%bb%87%e6%a2%a6%e5%bd%93%e5%89%8d%e6%96%87%e6%a1%a3%e5%86%85%e5%ae%b9%e8%87%aa%e5%8a%a8%e5%85%b3%e8%81%94tag%e6%a0%87%e7%ad%be%e5%81%9a%e5%86%85%e9%93%be","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/4160.html","title":{"rendered":"\u7ec7\u68a6\u5f53\u524d\u6587\u6863\u5185\u5bb9\u81ea\u52a8\u5173\u8054tag\u6807\u7b7e\u505a\u5185\u94fe"},"content":{"rendered":"

\u6548\u679c<\/h2>\n

\"\"<\/a><\/h2>\n

<\/a>\u5b9e\u73b0\u6559\u7a0b<\/h2>\n

1\u3001\u540e\u53f0-\u7cfb\u7edf-\u6838\u5fc3\u8bbe\u7f6e-\u5173\u952e\u5b57\u66ff\u6362\uff0c\u9009\u62e9\u3010\u662f\u3011<\/strong><\/p>\n

\"\"<\/a><\/p>\n

2\u3001\u540e\u53f0-\u7cfb\u7edf-\u5176\u4ed6\u9009\u9879-\u5173\u952e\u8bcd\u66ff\u6362\u6b21\u6570\uff0c\u586b\u30101\u3011\u6216\u8005\u30100\u3011<\/strong><\/p>\n

1\uff1a\u8868\u793a\u6587\u6863\u5185\u5bb9\u91cc\u6709\u591a\u4e2a\u5173\u952e\u8bcd\uff0c\u53ea\u8ba91\u4e2a\u662f\u5185\u94fe<\/p>\n

0\uff1a\u8868\u793a\u6587\u6863\u5185\u5bb9\u91cc\u6709\u591a\u4e2a\u5173\u952e\u8bcd\uff0c\u90fd\u662f\u5185\u94fe<\/p>\n

\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u586b<\/p>\n

\"\"<\/a><\/p>\n

3\u3001\u6253\u5f00 \/include\/arc.archives.class.php \u627e\u5230\uff0c\u5927\u6982\u57281187\u884c\u81f31241\u884c\uff0c\u6574\u4e2a\u51fd\u6570<\/strong><\/p>\n

function ReplaceKeyword($kw,&$body)\r\n{\r\n\t...\u4e2d\u95f4\u4ee3\u7801\u7701\u7565\r\n}<\/code><\/pre>\n

\u6574\u4e2a\u4fee\u6539\u4e3a\uff1a<\/p>\n

function ReplaceKeyword($kw,&$body)\r\n{\r\n\tglobal $cfg_replace_num;\r\n\t$search = \"\/(alt\\s*=\\s*|title\\s*=\\s*|src\\s*=\\s*)[\\\"|\\'](.+?)[\\\"|\\']\/is\";\r\n\t$body = preg_replace_callback($search, array('Archives', '_base64_encode'), $body);\r\n\t$addsql = '';\r\n\tif(isset($this->Fields['tags']) && !empty($this->Fields['aid']))\r\n\t{\r\n\t\t$this->dsql->SetQuery(\"SELECT tid FROM `#@__taglist` WHERE aid = '{$this->Fields['aid']}' \");\r\n\t\t$this->dsql->Execute();\r\n\t\t$ids = '';\r\n\t\twhile($row = $this->dsql->GetArray())\r\n\t\t{\r\n\t\t\t$ids .= ( $ids=='' ? $row['tid'] : ','.$row['tid'] );\r\n\t\t}\r\n\t\tif($ids != '')\r\n\t\t{\r\n\t\t\t$addsql = \" WHERE id IN($ids) \";\r\n\t\t}\r\n\t\tif($addsql=='') return $body;\r\n\t}\r\n\t$query = \"SELECT * FROM `#@__tagindex` $addsql ORDER BY addtime DESC\";\r\n\t$this->dsql->SetQuery($query);\r\n\t$this->dsql->Execute();\r\n\t$linkdatas = array();\r\n\twhile($row = $this->dsql->GetArray())\r\n\t{\r\n\t\t$row['keyword'] = $row['tag'];\r\n\t\t$row['rpurl'] = $cfg_cmsurl.\"\/tags.php?\/\".urlencode($row['tag']).\"\/\";\r\n\t\t$linkdatas[] = $row;\r\n\t}\r\n\tif($linkdatas) {\r\n\t\t$word = $replacement = array();\r\n\t\tforeach($linkdatas as $v) {\r\n\t\t\t$word0[] = \"\/<a[^>]*>{$v['keyword']}<\\\/a>\/is\";\r\n\t\t\t$word1[] = '\/'.$v['keyword'].'\/is';\r\n\t\t\t$word2[] = $v['keyword'];\r\n\t\t\t$replacement[] = '<a href=\"'.$v['rpurl'].'\" target=\"_blank\">'.$v['keyword'].'<\/a>';\r\n\t\t}\r\n\t\tif($cfg_replace_num) {\r\n\t\t\t$body = preg_replace($word0, $word2, $body, $cfg_replace_num);\r\n\t\t\t$body = preg_replace($word1, $replacement, $body, $cfg_replace_num);\r\n\t\t} else {\r\n\t\t\t$body = str_replace($word2, $replacement, $body);\r\n\t\t}\r\n\t}\r\n\t$body = preg_replace_callback($search, array('Archives', '_base64_decode'), $body);\r\n\treturn $body;\r\n}\r\nfunction _base64_encode($matches) {\r\n\treturn $matches[1].\"\\\"\".base64_encode($matches[2]).\"\\\"\";\r\n}\r\nfunction _base64_decode($matches) {\r\n\treturn $matches[1].\"\\\"\".base64_decode($matches[2]).\"\\\"\";\r\n}<\/code><\/pre>\n

 <\/p>\n

\u5982\u56fe<\/p>\n

\"\"<\/a><\/p>\n

4\u3001\u5b8c\u6210\uff0c\u52a8\u6001\u7684\u76f4\u63a5\u770b\u6548\u679c\uff0c\u9759\u6001\u7684\u8bb0\u5f97\u91cd\u65b0\u751f\u6210\u6587\u6863\u770b\u6548\u679c<\/strong><\/p>\n

\u6ce8\u610f\uff1a\u8fd9\u4e2aTAGE\u94fe\u63a5\u5730\u5740\u662f\u52a8\u6001\u7684\uff0c\u6548\u679c\u5982\u4e0b<\/p>\n

https:\/\/www.xiangyangcity.com\/tags.php?\/\u8944\u9633\u57ce\/<\/p>\n

\u5982\u679c\u4f60\u7684\u5982\u679c\u4f60\u7684TAG\u94fe\u63a5\u662f\u8fd9\u79cd\u7684<\/p>\n

https:\/\/www.xiangyangcity.com\/tags\/\u8944\u9633\u57ce\/<\/p>\n

\u90a3\u4f60\u5c31\u5f97\u628a\u4e0a\u9762\u4ee3\u7801\u91cc\u9762\u7684\uff1f\u5220\u9664\u6389\u3002\u5982\u4e0b\u9762\u7684\u7ea2\u8272\u90e8\u5206<\/p>\n

$row['rpurl'] = $cfg_cmsurl.\"\/tags.php?<\/span>\/\".urlencode($row['tag']).\"\/\";<\/code><\/pre>\n

 <\/p>\n

 <\/p>\n

\u672c\u6587\u6765\u6e90\uff1ahttps:\/\/www.dedehtml.com\/notes\/dede-tag-keyword.html<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6548\u679c \u5b9e\u73b0\u6559\u7a0b 1\u3001\u540e\u53f0-\u7cfb\u7edf-\u6838\u5fc3\u8bbe\u7f6e-\u5173\u952e\u5b57\u66ff\u6362\uff0c\u9009\u62e9\u3010\u662f\u3011 2\u3001\u540e\u53f0-\u7cfb\u7edf-\u5176\u4ed6\u9009\u9879-\u5173\u952e\u8bcd\u66ff\u6362\u6b21\u6570\uff0c\u586b […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1329,1328,1330,180],"class_list":["post-4160","post","type-post","status-publish","format-standard","hentry","category-web","tag-tag","tag-1328","tag-1330","tag-180"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/4160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=4160"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/4160\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=4160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=4160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=4160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}