{"id":353,"date":"2016-04-20T02:57:09","date_gmt":"2016-04-20T02:57:09","guid":{"rendered":"http:\/\/www.nywzjs.com\/?p=353"},"modified":"2016-04-20T02:59:24","modified_gmt":"2016-04-20T02:59:24","slug":"ecshop%e5%95%86%e5%93%81%e5%88%86%e7%b1%bb%e6%89%b9%e9%87%8f%e5%a2%9e%e5%8a%a0","status":"publish","type":"post","link":"http:\/\/www.nywzjs.com\/?p=353","title":{"rendered":"ECSHOP\u5546\u54c1\u5206\u7c7b\u6279\u91cf\u589e\u52a0"},"content":{"rendered":"<p>1\u3001\u4fee\u6539\u7a0b\u5e8f<\/p>\n<p>\/admin\/category.php\u6587\u4ef6\u6253\u5f00<\/p>\n<p>\u7ea6104\u884c<\/p>\n<p>$cat['cat_name'] \u00a0 \u00a0 = !empty($_POST['cat_name']) \u00a0 \u00a0 ? trim($_POST['cat_name']) \u00a0 \u00a0 : '';<\/p>\n<p>\u4e0b\u6dfb\u52a0<\/p>\n<p><span style=\"color: #ff0000;\"> $isall = (stristr($cat['cat_name'],\",\") &lt;&gt; \"\") ? 1 : 0;<\/span><\/p>\n<p>\u7ea6133\u884c<\/p>\n<p>if ($db-&gt;autoExecute($ecs-&gt;table('category'), $cat) !== false)<br \/>\n{<br \/>\n$cat_id = $db-&gt;insert_id();<br \/>\nif($cat['show_in_nav'] == 1)<br \/>\n{<br \/>\n$vieworder = $db-&gt;getOne(\"SELECT max(vieworder) FROM \". $ecs-&gt;table('nav') . \" WHERE type = 'middle'\");<br \/>\n$vieworder += 2;<br \/>\n\/\/\u663e\u793a\u5728\u81ea\u5b9a\u4e49\u5bfc\u822a\u680f\u4e2d<br \/>\n$sql = \"INSERT INTO \" . $ecs-&gt;table('nav') .<br \/>\n\" (name,ctype,cid,ifshow,vieworder,opennew,url,type)\".<br \/>\n\" VALUES('\" . $cat['cat_name'] . \"', 'c', '\".$db-&gt;insert_id().\"','1','$vieworder','0', '\" . build_uri('category', array('cid'=&gt; $cat_id), $cat['cat_name']) . \"','middle')\";<br \/>\n$db-&gt;query($sql);<br \/>\n}<br \/>\ninsert_cat_recommend($cat['cat_recommend'], $cat_id);<\/p>\n<p>admin_log($_POST['cat_name'], 'add', 'category'); \/\/ \u8bb0\u5f55\u7ba1\u7406\u5458\u64cd\u4f5c<br \/>\nclear_cache_files(); \/\/ \u6e05\u9664\u7f13\u5b58<\/p>\n<p><strong>\u6539\u4e3a\uff1a<\/strong><\/p>\n<p><span style=\"color: #ff0000;\">\/* \u5165\u5e93\u7684\u64cd\u4f5c *\/<\/span><br \/>\n<span style=\"color: #ff0000;\"> if ($isall)<\/span><br \/>\n<span style=\"color: #ff0000;\"> {<\/span><br \/>\n<span style=\"color: #ff0000;\"> $cat_name = $cat['cat_name'];<\/span><br \/>\n<span style=\"color: #ff0000;\"> $cat_name = explode(\",\",$cat_name);<\/span><br \/>\n<span style=\"color: #ff0000;\"> foreach ($cat_name AS $k)<\/span><br \/>\n<span style=\"color: #ff0000;\"> {<\/span><br \/>\n<span style=\"color: #ff0000;\"> $cat['cat_name'] = $k;<\/span><br \/>\n<span style=\"color: #ff0000;\"> if ($db-&gt;autoExecute($ecs-&gt;table('category'), $cat) !== false)<\/span><br \/>\n<span style=\"color: #ff0000;\"> {<\/span><br \/>\n<span style=\"color: #ff0000;\"> $cat_id = $db-&gt;insert_id();<\/span><br \/>\n<span style=\"color: #ff0000;\"> if($cat['show_in_nav'] == 1)<\/span><br \/>\n<span style=\"color: #ff0000;\"> {<\/span><br \/>\n<span style=\"color: #ff0000;\"> $vieworder = $db-&gt;getOne(\"SELECT max(vieworder) FROM \". $ecs-&gt;table('nav') . \" WHERE type = 'middle'\");<\/span><br \/>\n<span style=\"color: #ff0000;\"> $vieworder += 2;<\/span><br \/>\n<span style=\"color: #ff0000;\"> \/\/\u663e\u793a\u5728\u81ea\u5b9a\u4e49\u5bfc\u822a\u680f\u4e2d<\/span><br \/>\n<span style=\"color: #ff0000;\"> $sql = \"INSERT INTO \" . $ecs-&gt;table('nav') .<\/span><br \/>\n<span style=\"color: #ff0000;\"> \" (name,ctype,cid,ifshow,vieworder,opennew,url,type)\".<\/span><br \/>\n<span style=\"color: #ff0000;\"> \" VALUES('\" . $cat['cat_name'] . \"', 'c', '\".$db-&gt;insert_id().\"','1','$vieworder','0', '\" . build_uri('category', array('cid'=&gt; $cat_id), $cat['cat_name']) . \"','middle')\";<\/span><br \/>\n<span style=\"color: #ff0000;\"> $db-&gt;query($sql);<\/span><br \/>\n<span style=\"color: #ff0000;\"> }<\/span><br \/>\n<span style=\"color: #ff0000;\"> insert_cat_recommend($cat['cat_recommend'], $cat_id);<\/span><\/p>\n<p><span style=\"color: #ff0000;\">}\/\/\u7ed3\u675f<\/span><br \/>\n<span style=\"color: #ff0000;\"> }<\/span><br \/>\n<span style=\"color: #ff0000;\"> admin_log($_POST['cat_name'], 'add', 'category'); \/\/ \u8bb0\u5f55\u7ba1\u7406\u5458\u64cd\u4f5c<\/span><br \/>\n<span style=\"color: #ff0000;\"> clear_cache_files(); \/\/ \u6e05\u9664\u7f13\u5b58<\/span><br \/>\n<span style=\"color: #ff0000;\"> \/*\u6dfb\u52a0\u94fe\u63a5*\/<\/span><br \/>\n<span style=\"color: #ff0000;\"> $link[0]['text'] = $_LANG['continue_add'];<\/span><br \/>\n<span style=\"color: #ff0000;\"> $link[0]['href'] = 'category.php?act=add';<\/span><\/p>\n<p><span style=\"color: #ff0000;\">$link[1]['text'] = $_LANG['back_list'];<\/span><br \/>\n<span style=\"color: #ff0000;\"> $link[1]['href'] = 'category.php?act=list';<\/span><\/p>\n<p><span style=\"color: #ff0000;\">sys_msg($_LANG['catadd_succed'], 0, $link);<\/span><\/p>\n<p><span style=\"color: #ff0000;\">}<\/span><br \/>\n<span style=\"color: #ff0000;\"> else<\/span><br \/>\n<span style=\"color: #ff0000;\"> {<\/span><br \/>\n<span style=\"color: #ff0000;\"> if ($db-&gt;autoExecute($ecs-&gt;table('category'), $cat) !== false)<\/span><br \/>\n<span style=\"color: #ff0000;\"> {<\/span><br \/>\n<span style=\"color: #ff0000;\"> $cat_id = $db-&gt;insert_id();<\/span><br \/>\n<span style=\"color: #ff0000;\"> if($cat['show_in_nav'] == 1)<\/span><br \/>\n<span style=\"color: #ff0000;\"> {<\/span><br \/>\n<span style=\"color: #ff0000;\"> $vieworder = $db-&gt;getOne(\"SELECT max(vieworder) FROM \". $ecs-&gt;table('nav') . \" WHERE type = 'middle'\");<\/span><br \/>\n<span style=\"color: #ff0000;\"> $vieworder += 2;<\/span><br \/>\n<span style=\"color: #ff0000;\"> \/\/\u663e\u793a\u5728\u81ea\u5b9a\u4e49\u5bfc\u822a\u680f\u4e2d<\/span><br \/>\n<span style=\"color: #ff0000;\"> $sql = \"INSERT INTO \" . $ecs-&gt;table('nav') .<\/span><br \/>\n<span style=\"color: #ff0000;\"> \" (name,ctype,cid,ifshow,vieworder,opennew,url,type)\".<\/span><br \/>\n<span style=\"color: #ff0000;\"> \" VALUES('\" . $cat['cat_name'] . \"', 'c', '\".$db-&gt;insert_id().\"','1','$vieworder','0', '\" . build_uri('category', array('cid'=&gt; $cat_id), $cat['cat_name']) . \"','middle')\";<\/span><br \/>\n<span style=\"color: #ff0000;\"> $db-&gt;query($sql);<\/span><br \/>\n<span style=\"color: #ff0000;\"> }<\/span><br \/>\n<span style=\"color: #ff0000;\"> insert_cat_recommend($cat['cat_recommend'], $cat_id);<\/span><\/p>\n<p><span style=\"color: #ff0000;\">admin_log($_POST['cat_name'], 'add', 'category'); \/\/ \u8bb0\u5f55\u7ba1\u7406\u5458\u64cd\u4f5c<\/span><br \/>\n<span style=\"color: #ff0000;\"> clear_cache_files(); \/\/ \u6e05\u9664\u7f13\u5b58<\/span><\/p>\n<p><span style=\"color: #ff0000;\">\/*\u6dfb\u52a0\u94fe\u63a5*\/<\/span><br \/>\n<span style=\"color: #ff0000;\"> $link[0]['text'] = $_LANG['continue_add'];<\/span><br \/>\n<span style=\"color: #ff0000;\"> $link[0]['href'] = 'category.php?act=add';<\/span><\/p>\n<p><span style=\"color: #ff0000;\">$link[1]['text'] = $_LANG['back_list'];<\/span><br \/>\n<span style=\"color: #ff0000;\"> $link[1]['href'] = 'category.php?act=list';<\/span><\/p>\n<p><span style=\"color: #ff0000;\">sys_msg($_LANG['catadd_succed'], 0, $link);<\/span><br \/>\n<span style=\"color: #ff0000;\"> }<\/span><br \/>\n<span style=\"color: #ff0000;\"> }<\/span><\/p>\n<p>2\u3001\u4fee\u6539\u6a21\u677f<\/p>\n<p>\u6253\u5f00admin\\templates\\category_info.htm\u6587\u4ef6\uff0c\u7ea610\u884c<\/p>\n<p>&lt;input type='text' name='cat_name' maxlength=\"20\" value='{$cat_info.cat_name|escape:html}' size='27' \/&gt;<\/p>\n<p>\u6539\u4e3a<\/p>\n<p><span style=\"color: #ff0000;\">{if $form_act==\"insert\"}<\/span><br \/>\n<span style=\"color: #ff0000;\"> &lt;textarea name=\"cat_name\" cols=\"35\" rows=\"3\"&gt;{$cat_info.cat_name|escape:html}&lt;\/textarea&gt; \u591a\u4e2a\u5206\u7c7b\u4ee5,\u5206\u5f00<\/span><br \/>\n<span style=\"color: #ff0000;\"> {else}<\/span><br \/>\n<span style=\"color: #ff0000;\"> &lt;input type='text' name='cat_name' maxlength=\"20\" value='{$cat_info.cat_name|escape:html}' size='27' \/&gt;{\/if}<\/span><\/p>\n<p>\u4fdd\u5b58\uff0cOK\u3002<\/p>\n<p>\u5df2\u4fee\u6539\u6587\u4ef6<\/p>\n<p><a href=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/admin.rar\">admin<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u4fee\u6539\u7a0b\u5e8f \/admin\/category.php\u6587\u4ef6\u6253\u5f00 \u7ea6104\u884c $cat[&#8216;cat_name&#8217;] \u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[85],"_links":{"self":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/353"}],"collection":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=353"}],"version-history":[{"count":0,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/353\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}