{"id":28734,"date":"2024-11-25T12:11:04","date_gmt":"2024-11-25T04:11:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28734\/"},"modified":"2024-11-25T12:11:04","modified_gmt":"2024-11-25T04:11:04","slug":"dedecms%e6%80%8e%e4%b9%88%e8%8e%b7%e5%8f%96%e5%9b%be%e7%89%87%e9%9b%86%e5%a4%9a%e5%bc%a0%e5%9b%be%e7%89%87","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28734\/","title":{"rendered":"dedecms\u600e\u4e48\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5dfc2786442d0714.jpg\" class=\"aligncenter\" title=\"dedecms\u600e\u4e48\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247\u63d2\u56fe\" alt=\"dedecms\u600e\u4e48\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>\u600e\u4e48\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247\uff1f<\/strong><\/p>\n<p><strong>dedecms\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247\u5b9e\u73b0\u65b9\u6cd5(\u5faa\u73af\u8f93\u51fa)<\/strong><\/p>\n<p>\u6bcf\u4e2a\u6848\u4f8b\u90fd\u8981\u5f88\u591a\u56fe\u7247\uff0c\u5e76\u4e14\u7528\u4e00\u5b9a\u7684\u6548\u679c\u8fdb\u884c\u5c55\u793a\uff0c\u7ec7\u68a6\u81ea\u5e26\u7684\u8c03\u53d6\u65b9\u6cd5\u5b9e\u73b0\u7684\u6548\u679c\u662f\u4e00\u6b21\u6027\u8c03\u53d6\u591a\u4e2a\u53c2\u6570\uff0c\u5e76\u4e14\u5c55\u73b0\u7684\u6548\u679c\u4e0d\u662f\u6211\u9700\u8981\u7684\uff0c\u4e0b\u9762\u662f\u4ece\u767e\u5ea6\u641c\u7d22\u7684\u65b9\u6cd5\uff0c\u5927\u5bb6\u53ef\u4ee5\u53c2\u8003\u4e0b<\/p>\n<p>&nbsp;&nbsp;<\/p>\n<p>\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>\u5728\u4e3a\u5ba2\u6237\u505a\u7f51\u7ad9\u7684\u65f6\u5019\u9700\u8981\u505a\u5230\u7684\u6548\u679c\u662f\u6bcf\u4e2a\u6848\u4f8b\u90fd\u8981\u5f88\u591a\u56fe\u7247\uff0c\u5e76\u4e14\u7528\u4e00\u5b9a\u7684\u6548\u679c\u8fdb\u884c\u5c55\u793a\u3002\u4f46\u662f\u53d1\u73b0\u7ec7\u68a6\u672c\u8eab\u81ea\u5e26\u7684\u8c03\u53d6\u65b9\u6cd5\u5b9e\u73b0\u7684\u6548\u679c\u662f\u4e00\u6b21\u6027\u8c03\u53d6\u591a\u4e2a\u53c2\u6570\uff0c\u5e76\u4e14\u5c55\u73b0\u7684\u6548\u679c\u4e0d\u662f\u6211\u9700\u8981\u7684\uff0c\u5f53\u65f6\u5f88\u7ea0\u7ed3\u3002\u540e\u6765\u81ea\u5df1\u7422\u78e8\u7422\u78e8\uff0c\u53ef\u60dc\u6ca1\u6210\u529f\u3002\u6700\u540e\u901a\u8fc7\u7f51\u7edc\u767e\u5ea6\u641c\u7d22\u627e\u5230\u4e86\u5b9e\u73b0\u65b9\u6cd5\u3002&nbsp;<\/p>\n<p>\u5b9e\u73b0\u7684\u65b9\u6cd5\u4e00\u5171\u6709\u4e24\u4e2a\u6b65\u9aa4\uff1a&nbsp;<\/p>\n<p>1\u3001\u5728\/include\/common.func.php \u91cc\u52a0\u4e0a\u65b9\u6cd5 \/\/\u5faa\u73af\u8f93\u51fa\u591a\u5f20\u56fe\u7247function&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>function&nbsp;Getimgs($aid,&nbsp;$imgwith&nbsp;=&nbsp;300,&nbsp;$imgheight&nbsp;=&nbsp;270,&nbsp;$num&nbsp;=&nbsp;0,&nbsp;$style&nbsp;=&nbsp;''){&nbsp;\nglobal&nbsp;$dsql;&nbsp;\n$imgurls&nbsp;=&nbsp;'';&nbsp;\n$row&nbsp;=&nbsp;$dsql&nbsp;-&amp;gt;&nbsp;getone(\"Select&nbsp;imgurls&nbsp;From`dede_addonimages`&nbsp;where&nbsp;aid='$aid'\");&nbsp;\/\/&nbsp;\n$imgurls&nbsp;=&nbsp;$row['imgurls'];&nbsp;\npreg_match_all(\"\/{dede:img&nbsp;(.*)}(.*){\/dede:img\/isU\",&nbsp;$imgurls,&nbsp;$wordcount);&nbsp;\n$count&nbsp;=&nbsp;count($wordcount[2]);&nbsp;\nif&nbsp;($num&nbsp;&amp;gt;&nbsp;$count&nbsp;||&nbsp;$num&nbsp;==&nbsp;0){&nbsp;\n$num&nbsp;=&nbsp;$count;&nbsp;\n}&nbsp;\nfor($i&nbsp;=&nbsp;0;$i&nbsp;&lt;ahref&gt;@@##@@\";&nbsp;\n}else{&nbsp;\n$imglist&nbsp;.=&nbsp;\"@@##@@\";&nbsp;\n}&nbsp;\n}&nbsp;\nreturn&nbsp;$imglist;&nbsp;\n}&lt;\/ahref&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>2\u3001\u5728\u6a21\u677f\u91cc\u8c03\u7528\u65b9\u6cd5{dede:field.id function=&#8221;Getimgs(@me,400,400,10)&#8221; \/}<\/p>\n<p><img src><br \/>\n<img> <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247\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>\u600e\u4e48\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247\uff1f dedecms\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247\u5b9e\u73b0\u65b9\u6cd5(\u5faa\u73af\u8f93\u51fa) \u6bcf\u4e2a\u6848\u4f8b\u90fd\u8981\u5f88\u591a\u56fe\u7247\uff0c\u5e76\u4e14\u7528\u4e00\u5b9a\u7684\u6548\u679c\u8fdb\u884c\u5c55\u793a\uff0c\u7ec7\u68a6\u81ea\u5e26\u7684\u8c03\u53d6\u65b9\u6cd5\u5b9e\u73b0\u7684\u6548\u679c\u662f\u4e00\u6b21\u6027\u8c03\u53d6\u591a\u4e2a\u53c2\u6570\uff0c\u5e76\u4e14\u5c55\u73b0\u7684\u6548\u679c\u4e0d\u662f\u6211\u9700\u8981\u7684\uff0c\u4e0b\u9762\u662f\u4ece\u767e\u5ea6\u641c\u7d22\u7684\u65b9\u6cd5\uff0c\u5927\u5bb6\u53ef\u4ee5\u53c2\u8003\u4e0b &nbsp;&nbsp; \u63a8\u8350\u5b66\u4e60\uff1a \u5728\u4e3a\u5ba2\u6237\u505a\u7f51\u7ad9\u7684\u65f6\u5019\u9700\u8981\u505a\u5230\u7684\u6548\u679c\u662f\u6bcf\u4e2a\u6848\u4f8b\u90fd\u8981\u5f88\u591a\u56fe\u7247\uff0c\u5e76\u4e14\u7528\u4e00\u5b9a\u7684\u6548\u679c\u8fdb\u884c\u5c55\u793a\u3002\u4f46\u662f\u53d1\u73b0\u7ec7\u68a6\u672c\u8eab\u81ea\u5e26\u7684\u8c03\u53d6\u65b9\u6cd5\u5b9e\u73b0\u7684\u6548\u679c\u662f\u4e00\u6b21\u6027\u8c03\u53d6\u591a\u4e2a\u53c2\u6570\uff0c\u5e76\u4e14\u5c55\u73b0\u7684\u6548\u679c\u4e0d\u662f\u6211\u9700\u8981\u7684\uff0c\u5f53\u65f6\u5f88\u7ea0\u7ed3\u3002\u540e\u6765\u81ea\u5df1\u7422\u78e8\u7422\u78e8\uff0c\u53ef\u60dc\u6ca1\u6210\u529f\u3002\u6700\u540e\u901a\u8fc7\u7f51\u7edc\u767e\u5ea6\u641c\u7d22\u627e\u5230\u4e86\u5b9e\u73b0\u65b9\u6cd5\u3002&nbsp; \u5b9e\u73b0\u7684\u65b9\u6cd5\u4e00\u5171\u6709\u4e24\u4e2a\u6b65\u9aa4\uff1a&nbsp; 1\u3001\u5728\/include\/common.func.php \u91cc\u52a0\u4e0a\u65b9\u6cd5 \/\/\u5faa\u73af\u8f93\u51fa\u591a\u5f20\u56fe\u7247function&nbsp; \u4ee3\u7801\u5982\u4e0b: function&nbsp;Getimgs($aid,&nbsp;$imgwith&nbsp;=&nbsp;300,&nbsp;$imgheight&nbsp;=&nbsp;270,&nbsp;$num&nbsp;=&nbsp;0,&nbsp;$style&nbsp;=&nbsp;&#8221;){&nbsp; global&nbsp;$dsql;&nbsp; $imgurls&nbsp;=&nbsp;&#8221;;&nbsp; $row&nbsp;=&nbsp;$dsql&nbsp;-&amp;gt;&nbsp;getone(&#8220;Select&nbsp;imgurls&nbsp;From`dede_addonimages`&nbsp;where&nbsp;aid=&#8217;$aid'&#8221;);&nbsp;\/\/&nbsp; $imgurls&nbsp;=&nbsp;$row[&#8216;imgurls&#8217;];&nbsp; preg_match_all(&#8220;\/{dede:img&nbsp;(.*)}(.*){\/dede:img\/isU&#8221;,&nbsp;$imgurls,&nbsp;$wordcount);&nbsp; $count&nbsp;=&nbsp;count($wordcount[2]);&nbsp; if&nbsp;($num&nbsp;&amp;gt;&nbsp;$count&nbsp;||&nbsp;$num&nbsp;==&nbsp;0){&nbsp; $num&nbsp;=&nbsp;$count;&nbsp; }&nbsp; for($i&nbsp;=&nbsp;0;$i&nbsp;&lt;ahref&gt;@@##@@&#8221;;&nbsp; }else{&nbsp; $imglist&nbsp;.=&nbsp;&#8220;@@##@@&#8221;;&nbsp; }&nbsp; }&nbsp; return&nbsp;$imglist;&nbsp; }&lt;\/ahref&gt; \u767b\u5f55\u540e\u590d\u5236 2\u3001\u5728\u6a21\u677f\u91cc\u8c03\u7528\u65b9\u6cd5{dede:field.id function=&#8221;Getimgs(@me,400,400,10)&#8221; \/} \u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u83b7\u53d6\u56fe\u7247\u96c6\u591a\u5f20\u56fe\u7247\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-28734","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28734","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=28734"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28734\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}