{"id":30359,"date":"2024-11-25T10:22:17","date_gmt":"2024-11-25T02:22:17","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30359\/"},"modified":"2024-11-25T10:22:17","modified_gmt":"2024-11-25T02:22:17","slug":"%e7%bb%87%e6%a2%a6dedecms5-7%e6%95%b4%e7%ab%99%e6%80%8e%e4%b9%88%e8%b0%83%e7%94%a8%e8%b4%ad%e7%89%a9%e8%bd%a6%e8%ae%a2%e5%8d%95%e6%95%b0%e9%87%8f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30359\/","title":{"rendered":"\u7ec7\u68a6Dedecms5.7\u6574\u7ad9\u600e\u4e48\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5df6dd1c577a5122.jpg\" class=\"aligncenter\" title=\"\u7ec7\u68a6Dedecms5.7\u6574\u7ad9\u600e\u4e48\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf\u63d2\u56fe\" alt=\"\u7ec7\u68a6Dedecms5.7\u6574\u7ad9\u600e\u4e48\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>\u7ec7\u68a6dedecms5.7\u6574\u7ad9\u600e\u4e48\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf\uff1f<\/strong><\/p>\n<p>\u5728\u5356\u7ec7\u68a6Dedecms5.7 GBK\/UTF-8 \u8d22\u4ed8\u901a\u63a5\u53e3\u63d2\u4ef6\u6a21\u5757\u7684\u65f6\u5019\uff0c\u7f51\u53cb\u5411\u6211\u54a8\u8be2\u4e00\u4e2a\u7ec7\u68a6Dedecms5.7\u6574\u7ad9\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf\u7684\u95ee\u9898\uff0c\u6211\u67e5\u4e86\u4e00\u4e0b\u624b\u518c\uff0c\u6ca1\u627e\u5230\u76f8\u5173\u77e5\u8bc6<\/p>\n<p>&nbsp;&nbsp;\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>\u540e\u6765\u60f3\u60f3\uff0c\u5176\u5b9e\u4e5f\u633a\u7b80\u5355\u7684\uff0c\u5c31\u662f\u8c03\u7528cookie\u6570\u636e\uff0c\u540e\u6765\u770b\u4e86\u4e00\u4e0bDedecms\u7684\u8d2d\u7269\u8f66\u7c7bshopcar.class.php\uff0c\u6709\u73b0\u6210\u7684\u51fd\u6570cartCount\u53ef\u7528\uff0c\u4e3a\u4e86\u4e0d\u5f71\u54cd\u6a21\u677f\u8c03\u7528\uff0c\u5c31\u81ea\u5df1\u5199\u4e86\u4e2a\u7b80\u5355\u7684\u6587\u4ef6\uff0c\u7528javascript\u8c03\u7528\u3002<\/p>\n<p>\u65b9\u6cd5\u5b9e\u73b0\u5982\u4e0b\uff1a<\/p>\n<p>\u4e00\u3001\u5efa\u7acb\u4e00\u4e2amy_car_count.php\u6587\u4ef6\uff0c\u653e\u5728\/plus\/\u76ee\u5f55\u4e0b\u9762\uff1b<\/p>\n<p>\u4e8c\u3001\u5199\u4e0a\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>&lt;?php \/**\n* my_car_count.php\n* \/plus\n* \u663e\u793a\u8d2d\u7269\u8f66\u7684\u5546\u54c1\u6570\u91cf\n* https:\/\/www.jb51.net\/cms\n* QQ: 834114969\n*\/\nrequire_once (dirname(__FILE__) . \"\/..\/include\/common.inc.php\");\ndefine(&#039;_PLUS_TPL_&#039;, DEDEROOT.&#039;\/templets\/plus&#039;);\nrequire_once(DEDEINC.&#039;\/dedetemplate.class.php&#039;);\nrequire_once DEDEINC.&#039;\/shopcar.class.php&#039;;\n$cart = new MemberShops();&lt;\/p&gt;&nbsp;&lt;p&gt;$car_count&nbsp;=&nbsp;0;&lt;\/p&gt;&nbsp;&lt;p&gt;if($cart-&amp;gt;cartCount()&nbsp;&amp;gt;=&nbsp;1)\n{\n$car_count&nbsp;=&nbsp;$cart-&amp;gt;cartCount();\n}\necho&nbsp;('document.write(\"'&nbsp;.&nbsp;$car_count&nbsp;.&nbsp;'\");&nbsp;');\nexit;\n?&amp;gt;&lt;\/p&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4e09\u3001\u5728\u4f60\u9700\u8981\u8c03\u7528\u7684\u5730\u65b9\u5199\u4e0a\u8c03\u7528\u4ee3\u7801\uff0c\u6bd4\u5982\uff1a\u8d2d\u7269\u8f66\u5546\u54c1\u6570 <\/p>\n<p>\u5927\u529f\u544a\uff0c\u662f\u4e0d\u662f\u975e\u5e38\u7b80\u5355\u554a\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6Dedecms5.7\u6574\u7ad9\u600e\u4e48\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf\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>\u7ec7\u68a6dedecms5.7\u6574\u7ad9\u600e\u4e48\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf\uff1f \u5728\u5356\u7ec7\u68a6Dedecms5.7 GBK\/UTF-8 \u8d22\u4ed8\u901a\u63a5\u53e3\u63d2\u4ef6\u6a21\u5757\u7684\u65f6\u5019\uff0c\u7f51\u53cb\u5411\u6211\u54a8\u8be2\u4e00\u4e2a\u7ec7\u68a6Dedecms5.7\u6574\u7ad9\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf\u7684\u95ee\u9898\uff0c\u6211\u67e5\u4e86\u4e00\u4e0b\u624b\u518c\uff0c\u6ca1\u627e\u5230\u76f8\u5173\u77e5\u8bc6 &nbsp;&nbsp;\u63a8\u8350\u5b66\u4e60\uff1a \u540e\u6765\u60f3\u60f3\uff0c\u5176\u5b9e\u4e5f\u633a\u7b80\u5355\u7684\uff0c\u5c31\u662f\u8c03\u7528cookie\u6570\u636e\uff0c\u540e\u6765\u770b\u4e86\u4e00\u4e0bDedecms\u7684\u8d2d\u7269\u8f66\u7c7bshopcar.class.php\uff0c\u6709\u73b0\u6210\u7684\u51fd\u6570cartCount\u53ef\u7528\uff0c\u4e3a\u4e86\u4e0d\u5f71\u54cd\u6a21\u677f\u8c03\u7528\uff0c\u5c31\u81ea\u5df1\u5199\u4e86\u4e2a\u7b80\u5355\u7684\u6587\u4ef6\uff0c\u7528javascript\u8c03\u7528\u3002 \u65b9\u6cd5\u5b9e\u73b0\u5982\u4e0b\uff1a \u4e00\u3001\u5efa\u7acb\u4e00\u4e2amy_car_count.php\u6587\u4ef6\uff0c\u653e\u5728\/plus\/\u76ee\u5f55\u4e0b\u9762\uff1b \u4e8c\u3001\u5199\u4e0a\u5982\u4e0b\u4ee3\u7801\uff1a \u4ee3\u7801\u5982\u4e0b: &lt;?php \/** * my_car_count.php * \/plus * \u663e\u793a\u8d2d\u7269\u8f66\u7684\u5546\u54c1\u6570\u91cf * https:\/\/www.jb51.net\/cms * QQ: 834114969 *\/ require_once (dirname(__FILE__) . &#8220;\/..\/include\/common.inc.php&#8221;); define(&#039;_PLUS_TPL_&#039;, DEDEROOT.&#039;\/templets\/plus&#039;); require_once(DEDEINC.&#039;\/dedetemplate.class.php&#039;); require_once DEDEINC.&#039;\/shopcar.class.php&#039;; $cart = new MemberShops();&lt;\/p&gt;&nbsp;&lt;p&gt;$car_count&nbsp;=&nbsp;0;&lt;\/p&gt;&nbsp;&lt;p&gt;if($cart-&amp;gt;cartCount()&nbsp;&amp;gt;=&nbsp;1) { $car_count&nbsp;=&nbsp;$cart-&amp;gt;cartCount(); } echo&nbsp;(&#8216;document.write(&#8220;&#8216;&nbsp;.&nbsp;$car_count&nbsp;.&nbsp;&#8216;&#8221;);&nbsp;&#8216;); exit; ?&amp;gt;&lt;\/p&gt; \u767b\u5f55\u540e\u590d\u5236 \u4e09\u3001\u5728\u4f60\u9700\u8981\u8c03\u7528\u7684\u5730\u65b9\u5199\u4e0a\u8c03\u7528\u4ee3\u7801\uff0c\u6bd4\u5982\uff1a\u8d2d\u7269\u8f66\u5546\u54c1\u6570 \u5927\u529f\u544a\uff0c\u662f\u4e0d\u662f\u975e\u5e38\u7b80\u5355\u554a\uff01 \u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6Dedecms5.7\u6574\u7ad9\u600e\u4e48\u8c03\u7528\u8d2d\u7269\u8f66\u8ba2\u5355\u6570\u91cf\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-30359","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30359","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=30359"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30359\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}