{"id":5042,"date":"2022-01-30T12:51:48","date_gmt":"2022-01-30T04:51:48","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=5042"},"modified":"2022-02-18T10:59:28","modified_gmt":"2022-02-18T02:59:28","slug":"%e5%b8%9d%e5%9b%bdcms%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0tagid%e4%bc%aa%e9%9d%99%e6%80%81tag%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/5042.html","title":{"rendered":"\u5e1d\u56fdCMS\u5982\u4f55\u5b9e\u73b0tagid\u4f2a\u9759\u6001TAG\u7684\u65b9\u6cd5"},"content":{"rendered":"
\u5e1d\u56fdCMS\u9ed8\u8ba4\u7684tag\u4f2a\u9759\u6001\u65b9\u6cd5\u662ftagname\u65b9\u5f0f\u7684\uff0c\u90a3\u4e48\u600e\u4e48\u5b9e\u73b0\u4ee5tagid\u6765\u5b9e\u73b0tag\u7684\u4f2a\u9759\u6001\u5462?\u7528\u4e0b\u9762\u65b9\u6cd5\u5373\u53ef\u5b9e\u73b0\uff01<\/p>\n
\u4fee\u6539 e\\class\\connect.php\u6587\u4ef6
\n\u641c\u7d22<\/p>\n
function eReturnRewriteTagsUrl($tagid,$tagname,$ecms=0){\r\n<\/code><\/pre>\n\u627e\u5230\u51fd\u6570eReturnRewriteTagsUrl\uff0c\u5c06\u6b64\u51fd\u6570\u5220\u9664\u6216\u6ce8\u91ca\u6389\uff0c\u6362\u6210\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n
\/\/\u8fd4\u56deTAGS\u5217\u8868\u4f2a\u9759\u6001\r\nfunction eReturnRewriteTagsUrl($tagid,$tagname,$ecms=0){\r\n\tglobal $public_r,$empire,$dbtbpre;\r\n\tif(!$tagid){\r\n\t\t$tagname=RepPostVar($tagname);\r\n\t\tif(!$tagname)\r\n\t\t{\r\n\t\t\t$r['pageurl']=$public_r['newsurl'];\r\n\t\t\t$r['rewrite']=0;\r\n\t\t\treturn $r;\r\n\t\t}\r\n\t\t$tagr=$empire->fetch1(\"select tagid,num from {$dbtbpre}enewstags where tagname='$tagname' limit 1\");\r\n\t\tif(!$tagr['tagid'])\r\n\t\t{\r\n\t\t\t$r['pageurl']=$public_r['newsurl'];\r\n\t\t\t$r['rewrite']=0;\r\n\t\t\treturn $r;\r\n\t\t}\r\n\t\t$tagid=$tagr['tagid'];\r\n\t}\r\n\tif(empty($public_r['rewritetags']))\r\n\t{\r\n\t\t$r['pageurl']=$public_r['newsurl'].\"e\/tags\/?tagid=\".$tagid;\r\n\t\t$r['rewrite']=0;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif($ecms==1)\r\n\t\t{\r\n\t\t\t$r['pageurl']=$public_r['newsurl'].str_replace(array('[!--tagname--]','[!--page--]'),array($tagid,0),$public_r['rewritetags']);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$r['pageurl']=$public_r['newsurl'].str_replace('[!--tagname--]',$tagid,$public_r['rewritetags']);\r\n\t\t}\r\n\t\t$r['rewrite']=1;\r\n\t}\r\n\treturn $r;\r\n}\r\n<\/code><\/pre>\n\u7b2c\u4e8c\u6b65\uff1a<\/h2>\n
\u4fee\u6539e\\tags\\index.php\u6587\u4ef6
\n\u8fd9\u91cc\u4e3b\u8981\u662f\u4fee\u6539\u5206\u9875\u51fd\u6570\uff0c\u627e\u5230\u5982\u4e0b\u6240\u793a\u4ee3\u7801\uff0c\u6309\u7167\u4ee5\u4e0b\u4ee3\u7801\u5c06\u539f\u6765\u7684\u90e8\u5206\u4ee3\u7801\u6ce8\u91ca\u6389\u3002<\/p>\n
\/*\r\nif($tagr['tagid']&&empty($add)&&$search=='&tagname='.$tagname.'&line='.$public_r['tagslistnum'].'&tempid='.$public_r['tagstempid'])\r\n{\r\n*\/\r\n\t\/\/\u4f2a\u9759\u6001\r\n\t$pagefunr=eReturnRewriteTagsUrl($tagid,$tagname,0);\r\n\t$pagefunr['repagenum']=0;\r\n\t\/\/\u5206\u9875\r\n\tif($pagefunr['rewrite']==1)\r\n\t{\r\n\t\t$listpage=InfoUsePage($num,$line,$page_line,$start,$page,$search,$pagefunr);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$listpage=page1($num,$line,$page_line,$start,$page,$search);\r\n\t}\r\n\r\n\/*\r\n}\r\nelse\r\n{\r\n\t$listpage=page1($num,$line,$page_line,$start,$page,$search);\/\/\u5206\u9875\r\n}\r\n*\/\r\n<\/code><\/pre>\n\u7b2c\u4e09\u6b65\uff1a<\/h2>\n
\u540e\u53f0\u8bbe\u7f6etag\u4f2a\u9759\u6001
\n\u6309\u7167\u9ed8\u8ba4\uff0c\u8bbe\u7f6e\u6210\uff1atags-[!--tagname--]-[!--page--].html \u5373\u53ef\u3002<\/p>\n
\u7b2c\u56db\u6b65\uff1a<\/h2>\n
\u670d\u52a1\u5668\u4f2a\u9759\u6001\u89c4\u5219
\napache\u7684\u4f2a\u9759\u6001\u89c4\u5219\u5982\u4e0b\uff0c\u5176\u5b83\u7c7b\u578b\u670d\u52a1\u5668\u8bf7\u5bf9\u7167\u6b64\u81ea\u884c\u4fee\u6539\uff1a<\/p>\n
RewriteRule ^tags-(.*)-(.*)$ e\/tags\/index.php?tagid=$1&page=$2\r\n<\/code><\/pre>\n <\/p>\n","protected":false},"excerpt":{"rendered":"
\u5e1d\u56fdCMS\u9ed8\u8ba4\u7684tag\u4f2a\u9759\u6001\u65b9\u6cd5\u662ftagname\u65b9\u5f0f\u7684\uff0c\u90a3\u4e48\u600e\u4e48\u5b9e\u73b0\u4ee5tagid\u6765\u5b9e\u73b0tag\u7684\u4f2a\u9759\u6001\u5462?\u7528\u4e0b\u9762 […]<\/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":[1598,1599,1580],"class_list":["post-5042","post","type-post","status-publish","format-standard","hentry","category-web","tag-tagid","tag-tag","tag-cms"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5042","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=5042"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5042\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=5042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=5042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=5042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}