{"id":5040,"date":"2022-01-29T19:36:57","date_gmt":"2022-01-29T11:36:57","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=5040"},"modified":"2022-02-09T11:33:43","modified_gmt":"2022-02-09T03:33:43","slug":"%e5%b8%9d%e5%9b%bdcms%e5%a6%82%e4%bd%95%e9%80%9a%e8%bf%87tag%e8%b0%83%e7%94%a8%e7%9b%b8%e5%85%b3%e6%96%87%e7%ab%a0","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/5040.html","title":{"rendered":"\u5e1d\u56fdCMS\u5982\u4f55\u901a\u8fc7TAG\u8c03\u7528\u76f8\u5173\u6587\u7ae0"},"content":{"rendered":"
\u7528tag\u8c03\u7528\u76f8\u5173\u6587\u7ae0\u7684\u65b9\u6cd5\u5728\u5e1d\u56fd\u5b98\u65b9\u8bba\u575b\u4e0a\u6709\u4eba\u53d1\u8fc7\u65b9\u6cd5\uff0c\u4f46\u6240\u4f7f\u7528\u7684\u51fd\u6570\u6548\u7387\u592a\u4f4e\u800c\u4e14\u65e0\u6cd5\u5236\u5b9a\u53c2\u6570\uff0c\u4e0d\u597d\u7528\u3002\u4e0b\u9762\u4ecb\u7ecd\u7684\u65b9\u6cd5\u5c31\u662f\u5229\u7528tag\u8c03\u7528\u76f8\u5173\u6587\u7ae0\uff0c\u975e\u5e38\u597d\u7528\u3002<\/p>\n
\u5e1d\u56fdCMS\u5982\u4f55\u901a\u8fc7TAG\u8c03\u7528\u76f8\u5173\u6587\u7ae0\u7684\u65b9\u6cd5\uff1a<\/p>\n
\u81ea\u5b9a\u4e49\u51fd\u6570user_OtherLink \uff0c\u5c06\u6b64\u51fd\u6570\u653e\u5165 e\\class\\userfun.php \u6587\u4ef6\u4e2d\u3002<\/p>\n
\/\/\u6839\u636etag\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\r\nfunction user_OtherLink($num,$classid=0,$mid=0){\r\n\tglobal $dbtbpre,$empire,$navinfor,$class_r;\r\n\tif(empty($navinfor['infotags'])){\r\n\t\treturn '\u6682\u65e0\u76f8\u5173\u4fe1\u606f';\r\n\t}\r\n\tif($mid&&$classid&&$class_r[$classid]['modid']!=$mid){\r\n\t\treturn '\u6682\u65e0\u76f8\u5173\u4fe1\u606f';\r\n\t}\r\n\t$tr=$empire->fetch1(\"select otherlinktemp,otherlinktempsub,otherlinktempdate from \".GetTemptb(\"enewspubtemp\").\" limit 1\");\r\n\t$temp_r=explode(\"[!--empirenews.listtemp--]\",$tr['otherlinktemp']);\r\n\t$str='';\r\n\t$tagsql=$empire->query(\"select * from {$dbtbpre}enewstagsdata where id='$navinfor[id]' and classid='$navinfor[classid]'\");\r\n\t$i=0;\r\n\t$isprint=array();\r\n\twhile($tagr=$empire->fetch($tagsql)){\r\n\t\tif($i>=$num){\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t$gsql=$empire->query(\"select * from {$dbtbpre}enewstagsdata where tagid='$tagr[tagid]'\");\r\n\t\twhile($gr=$empire->fetch($gsql)){\r\n\t\t\t$myprint='id'.$gr['id'].'class'.$gr['classid'];\r\n\t\t\tif(array_search($myprint,$isprint)!==false){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$isprint[]=$myprint;\r\n\t\t\tif($classid&&$classid!=$gr['classid']){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif($mid&&$mid!=$gr['mid']){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif($gr['id']==$navinfor['id']&&$gr['classid']==$navinfor['classid']){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$tbname=$class_r[$gr['classid']]['tbname'];\r\n\t\t\tif(!$tbname||InfoIsInTable($tbname)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$r=$empire->fetch1(\"select * from {$dbtbpre}ecms_\".$tbname.\" where id='$gr[id]' limit 1\");\r\n\t\t\tif(!$r['id']){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$str.=RepOtherTemp($temp_r[1],$r,$tr);\r\n\t\t\t$i+=1;\r\n\t\t\tif($i>=$num){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t$keyboardtext=$temp_r[0].$str.$temp_r[2];\r\n\tif($str){\r\n\t\treturn $keyboardtext;\r\n\t}else{\r\n\t\treturn '\u6682\u65e0\u76f8\u5173\u4fe1\u606f';\r\n\t}\r\n}\r\n<\/code><\/pre>\n\u51fd\u6570\u4f7f\u7528\u8bf4\u660e\uff1auser_OtherLink(\u8c03\u7528\u6761\u6570\uff0c\u6307\u5b9a\u680f\u76eeid\uff0c\u6307\u5b9a\u6a21\u578bid) \uff1b<\/p>\n
\u76f8\u5173\u6587\u7ae0\u6a21\u677f\u91c7\u7528\u7684\u662f\u516c\u5171\u6a21\u677f\u91cc\u7684\u76f8\u5173\u4fe1\u606f\u6a21\u677f\u3002<\/p>\n
\u8c03\u7528\u4ee3\u7801\uff1a<\/p>\n
<?=user_OtherLink(10,0,1)?>\r\n<\/code><\/pre>\n <\/p>\n
<\/p>\n","protected":false},"excerpt":{"rendered":"
\u7528tag\u8c03\u7528\u76f8\u5173\u6587\u7ae0\u7684\u65b9\u6cd5\u5728\u5e1d\u56fd\u5b98\u65b9\u8bba\u575b\u4e0a\u6709\u4eba\u53d1\u8fc7\u65b9\u6cd5\uff0c\u4f46\u6240\u4f7f\u7528\u7684\u51fd\u6570\u6548\u7387\u592a\u4f4e\u800c\u4e14\u65e0\u6cd5\u5236\u5b9a\u53c2\u6570\uff0c\u4e0d\u597d\u7528\u3002\u4e0b\u9762\u4ecb […]<\/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":[340,1580,731,1603],"class_list":["post-5040","post","type-post","status-publish","format-standard","hentry","category-web","tag-tag","tag-cms","tag-731"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5040","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=5040"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5040\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=5040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=5040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=5040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}