{"id":560,"date":"2010-12-04T17:55:54","date_gmt":"2010-12-04T17:55:54","guid":{"rendered":""},"modified":"2010-12-04T17:55:54","modified_gmt":"2010-12-04T17:55:54","slug":"560","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=560","title":{"rendered":"\u7b80\u5355\u4f18\u5316ecshop-\u4fee\u6539\u4e09\u5904\u4ee3\u7801"},"content":{"rendered":"<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u521d\u7528Ecshop\u53d1\u89c9\u4e0d\u662f\u4e00\u822c\u7684\u590d\u6742\uff0c\u8bbe\u8ba1\u4e00\u5957\u597d\u7684Ecshop\u6a21\u677f\uff0c\u7edd\u5bf9\u5f97\u5455\u5fc3\u6ca5\u8840\uff0c\u50cf\u6211\u7b49\u83dc\u9e1f\u80af\u5b9a\u662f\u505a\u4e0d\u6765\u7684\u4e8b\uff0c\u6211\u53c8\u662f\u4e00\u4e2a\u5341\u8db3\u5341\u7684\u7a77\u4eba\uff0c\u4e70\u5546\u4e1a\u6a21\u677f\u90a3\u4e5f\u662f\u4e0d\u53ef\u80fd\u7684\uff0c\u6240\u4ee5\u552f\u6709\u627e\u4e00\u4e9b\u514d\u8d39\u6a21\u677f\uff0c\u4f5c\u4e00\u4e0b\u5c0f\u8c03\u6574\u5148\u5c06\u5c31\u7740\u7528\u4e86\uff0c\u4e0d\u8fc7\u9ed8\u8ba4\u8981\u6539\u7684\u5730\u65b9\u8fd8\u4e0d\u53ea\u662f\u6a21\u677f\u7684\u95ee\u9898\uff0c\u8fd8\u6709\u4e0b\u9762\u7684\u4e00\u70b9\u70b9\uff0c\u7565\u4f5c\u8bb0\u5f55\u4ee5\u5907\u4e0d\u65f6\u4e4b\u9700\u3002<\/p>\n<p>1\u3001ECShop\u6807\u9898\u4f18\u5316<\/p>\n<p>\u5982\u4f55\u4fee\u6539ECShop\u6807\u9898\uff0c\u73b0\u5728\u8981\u5c06\u7f51\u7ad9\u6807\u9898\u4fee\u6539\u4e00\u4e0b\uff0c\u8fbe\u5230\u4e0b\u9762\u7684\u6548\u679c\u7f51\u7ad9\u9996\u9875\u6807\u9898\u663e\u793a\u7684\u662f\u4e3aECSHOP\u7ba1\u7406\u4e2d\u5fc3\u7684[\u5546\u5e97\u6807\u9898]\u3002\u800c\u9891\u9053\u9875\u9762\uff0c\u663e\u793a\u7684\u662f[\u9891\u9053\u540d+\u5546\u5e97\u540d\u79f0]\uff0c\u5f53\u7136\u5546\u54c1\u9875\u9762\u663e\u793a\u7684\u662f[\u5546\u54c1\u540d+\u5546\u5e97\u540d\u79f0]<br \/>\u7b2c\u4e00\u6b65\uff0c\u53bb\u6389\u6807\u9898\u4e0a\u7684Powered by Ecshop\u5b57\u6837\u3002\u5728includes\/lib_main.php\u627e\u5230lib_main.php\u6587\u4ef6\uff0c\u53bb\u6389\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\u3002<br \/>. \u2018 &#8211; \u2018 . \u2018Powered by ECShop\u2019 <br \/>\u7b2c\u4e8c\u6b65\uff0c\u6253\u5f00\u6a21\u677f\u6587\u4ef6\u5939\u7684goods.dwt\u6587\u4ef6\uff0c\u627e\u5230{$page_title}\uff0c\u5c06\u5b83\u4fee\u6539\u4e3a{$goods.goods_style_name}_{$shop_name}<br \/>\u7b2c\u4e09\u6b65\uff0c\u627e\u5230includes\/lib_main.php\u7b2c143\u884c\u3002\u5c06<br \/>$page_title=$GLOBALS[&#8216;_CFG&#8217;][&#8216;shop_title&#8217;];<br \/>\u6539\u4e3a\uff1a<br \/>$page_title=$GLOBALS[&#8216;_CFG&#8217;][&#8216;shop_name&#8217;]; <\/p>\n<p>\u7136\u540e\u627e\u5230241\u884c\u5de6\u53f3\uff0c\u627e\u5230\u4e0b\u9762\u8fd9\u6837\u7684\u4ee3\u7801<br \/>if (!empty($str)) <br \/>{ <br \/>$page_title&nbsp;&nbsp;= $str . &#8216;_&#8217; . $page_title; <br \/>$ur_here .= &#8216; &lt;code&gt;&gt; &#8216; . $str;<br \/>} <\/p>\n<p>\u6211\u4eec\u9700\u8981\u5728\u8fd9\u6bb5\u4ee3\u7801\u7684\u524d\u9762\uff0c\u52a0\u5165<br \/>if ($filename == &#8216;index&#8217;) $page_title=$GLOBALS[&#8216;_CFG&#8217;][&#8216;shop_title&#8217;];&nbsp;&nbsp;<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5373\u53ef\u3002<br \/>\u597d\u4e86\uff0c\u8fd9\u4e2aECShop\u6807\u9898\u6211\u4eec\u5c31\u4fee\u6539\u5b8c\u4e86\uff0c\u8fd9\u6837\u6bd4\u8f83\u7b26\u5408seo\u3002<\/p>\n<p>2\u3001\u53bb\u6389 ecshop head \u4e4b\u95f4\u7684Generator&#8221; content=&#8221;ECSHOP v2.7.1&#8243;<\/p>\n<p>ecshop \u628aGenerator\u653e\u5728title\u524d\u9762\u770b\u7740\u5f88\u4e0d\u723d\uff0c\u51b3\u5b9a\u53bb\u6389\uff0c\u4fdd\u7559\u9875\u811a\u7684\u5e95\u90e8\u7248\u6743\u5c31\u53ef\u4ee5\u4e86<\/p>\n<p>&lt;meta name=&#8221;Generator&#8221; content=&#8221;ECSHOP v2.7.1&#8243; \/&gt; <br \/>\u4e0b\u9762\u8bb2\u4e00\u4e0b\u600e\u4e48\u5220\u9664\u8fd9\u884c\u4ee3\u7801\uff0c\u8ba9\u7cfb\u7edf\u4e0d\u518d\u81ea\u52a8\u4ea7\u751f\u3002<\/p>\n<p>\u6253\u5f00 includes\/cls_template.php \u6587\u4ef6\uff0c<br \/>\u5927\u6982\u57281087\u884c\u5de6\u53f3\uff0c\u627e\u5230<\/p>\n<p>$source = preg_replace(&#8216;\/&lt;head&gt;\/i&#8217;, &#8220;&lt;head&gt;<br \/>\n&lt;meta name=&#8221;Generator&#8221; content=&#8221;&#8221; . APPNAME .&#8217; &#8216; . VERSION . &#8220;&#8221; \/&gt;&#8221;, $source);&nbsp;&nbsp;<\/p>\n<p>\u5c06\u4e4b\u5220\u9664\u6216\u8005\u6ce8\u91ca\u6389\u5373\u53ef\u3002<\/p>\n<p>3\u3001Ecshop\u5206\u7c7b\u6811\u5728\u6240\u6709\u9875\u9762\u663e\u793a\u5168\u90e8\u7684\u65b9\u6cd5<\/p>\n<p>\u6211\u7684\u7f51\u5e97\u5546\u54c1\u5206\u7c7b\u6bd4\u8f83\u5c11\uff0c\u60f3\u5728\u6240\u6709\u9875\u9762\u628a\u5206\u7c7b\u6811\u5168\u90e8\u663e\u793a\u51fa\u6765\uff0c\u4e0b\u9762\u662f\u4fee\u6539\u65b9\u6cd5<\/p>\n<p>\u6253\u5f00includes\/lib_goods.php\uff0c\u627e\u5230get_categories_tree()\u51fd\u6570\u90e8\u5206\uff0c\u627e\u5230\u8fd9\u4e00\u6bb5\uff1a<\/p>\n<p>function get_categories_tree($cat_id = 0) <br \/>{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;if ($cat_id &gt; 0) <br \/>&nbsp;&nbsp;&nbsp;&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sql = &#8216;Select parent_id FROM &#8216; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;category&#8217;) . &#8221; Where cat_id = &#8216;$cat_id'&#8221;; <\/p>\n<p>&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$parent_id = $GLOBALS[&#8216;db&#8217;]-&gt;getOne($sql); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;else <br \/>&nbsp;&nbsp;&nbsp;&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$parent_id = 0; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <\/p>\n<p>\u4fee\u6539\u6210\uff1a<\/p>\n<p>function get_categories_tree($cat_id = 0) <br \/>{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;if ($cat_id &gt; 0) <br \/>&nbsp;&nbsp;&nbsp;&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sql = &#8216;Select parent_id FROM &#8216; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;category&#8217;) . &#8221; Where cat_id = &#8216;$cat_id'&#8221;; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;<\/p>\n<p>\u6ce8\uff1a\u4fee\u6539\u524d \u8bf7\u505a\u597d\u539f\u6587\u4ef6\u5907\u4efd\uff0c\u4ee5\u4fbf\u4e8e\u9700\u8981\u65f6\u6062\u590d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#038;nbs&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-560","post","type-post","status-publish","format-standard","hentry","category-SEO"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=560"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/560\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}