$gallery_img[$key]['img_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], false, 'gallery'); $gallery_img[$key]['thumb_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], true, 'gallery'); } } else { foreach ($img_list as $key => $gallery_img) { $gallery_img[$key]['thumb_url'] = '../' . (empty($gallery_img['thumb_url']) ? $gallery_img['img_url'] : $gallery_img['thumb_url']); } } //dump($goods); } /* 拆分商品名称样式 */ $goods_name_style = explode('+', empty($goods['goods_name_style']) ? '+' : $goods['goods_name_style']); /* 创建 html editor */ $goods['goods_desc'] = preg_replace('/src=images/', 'src=/images', $goods['goods_desc']); create_html_editor('goods_desc', $goods['goods_desc']); create_html_editor2('goods_shipai', 'goods_shipai', $goods['goods_shipai']); /* 模板赋值 */ $smarty->assign('code', $code); $smarty->assign('ur_here', $is_add ? empty($code) ? $_LANG['02_goods_add'] : $_LANG['51_virtual_card_add'] : ($_REQUEST['act'] == 'edit' ? $_LANG['edit_goods'] : $_LANG['copy_goods'])); $smarty->assign('action_link', isset($link) ? $link : list_link($is_add, $code)); $smarty->assign('goods', $goods); $smarty->assign('goods_name_color', $goods_name_style[0]); $smarty->assign('goods_name_style', $goods_name_style[1]); //$smarty->assign('cat_list', cat_list(0, $goods['cat_id']));// 注释 2015-03-19 代理商跟主站的分类分开 /*ccx 2015-03-18 代理商显示代理商自己的商品分类 start */ $smarty->assign('cat_list', cat_list_ccx(0, $goods['cat_id'])); /*ccx 2015-03-18 代理商显示代理商自己的商品分类 end */ $smarty->assign('brand_list', get_brand_list()); $smarty->assign('unit_list', get_unit_list()); $smarty->assign('weight_unit', $is_add ? '1' : ($goods['goods_weight'] >= 1 ? '1' : '0.001')); $smarty->assign('cfg', $_CFG);
} if ($_POST['submit2']) { $FCKvalue = $_POST['index_top']; $sql = "select * from ecs_myconfig where name = 'myindex2'"; $result = mysql_query($sql); $num = mysql_num_rows($result); if ($num == 0) { $sql = "insert into ecs_myconfig set name = 'myindex2', value = '{$FCKvalue}'"; } else { $sql = "update ecs_myconfig set value = '{$FCKvalue}' where name = 'myindex2'"; } $query = mysql_query($sql); if ($query) { echo "<script>alert('保存成功!')</script>"; echo "<script>self.location='myindex.php'</script>"; exit; } } /*提取首页自定义区域内容*/ $sql = "select * from ecs_myconfig where name = 'myindex'"; $result = mysql_query($sql); $lin = mysql_fetch_array($result); /* 创建 html editor */ create_html_editor('goods_desc', $lin[1]); /*提取首页top内容 2009-9-20*/ $sql = "select * from ecs_myconfig where name = 'myindex2'"; $result = mysql_query($sql); $lin = mysql_fetch_array($result); /* 创建 html editor 2009-9-20*/ create_html_editor2('index_top', $lin[1]); $smarty->display('myindex.htm');
foreach ($img_list as $key => $gallery_img) { $gallery_img[$key]['img_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], false, 'gallery'); $gallery_img[$key]['thumb_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], true, 'gallery'); } } else { foreach ($img_list as $key => $gallery_img) { $gallery_img[$key]['thumb_url'] = '../' . (empty($gallery_img['thumb_url']) ? $gallery_img['img_url'] : $gallery_img['thumb_url']); } } } /* 拆分商品名称样式 */ $goods_name_style = explode('+', empty($goods['goods_name_style']) ? '+' : $goods['goods_name_style']); /* 创建 html editor */ create_html_editor('goods_desc', $goods['goods_desc']); /* 创建 html editor */ create_html_editor2('packing_list', $goods['packing_list']); /* 创建 html editor */ create_html_editor3('customer_service', $goods['customer_service']); /* 模板赋值 */ $smarty->assign('code', $code); $smarty->assign('ur_here', $is_add ? empty($code) ? $_LANG['02_goods_add'] : $_LANG['51_virtual_card_add'] : ($_REQUEST['act'] == 'edit' ? $_LANG['edit_goods'] : $_LANG['copy_goods'])); $smarty->assign('action_link', list_link($is_add, $code)); $smarty->assign('goods', $goods); $smarty->assign('goods_name_color', $goods_name_style[0]); $smarty->assign('goods_name_style', $goods_name_style[1]); $smarty->assign('cat_list', cat_list(0, $goods['cat_id'])); $smarty->assign('brand_list', get_brand_list()); $smarty->assign('unit_list', get_unit_list()); $smarty->assign('user_rank_list', get_user_rank_list()); $smarty->assign('weight_unit', $is_add ? '1' : ($goods['goods_weight'] >= 1 ? '1' : '0.001')); $smarty->assign('cfg', $_CFG);
foreach ($img_list as $key => $gallery_img) { $gallery_img[$key]['img_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], false, 'gallery'); $gallery_img[$key]['thumb_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], true, 'gallery'); } } else { foreach ($img_list as $key => $gallery_img) { $gallery_img[$key]['thumb_url'] = '../' . (empty($gallery_img['thumb_url']) ? $gallery_img['img_url'] : $gallery_img['thumb_url']); } } } /* 拆分商品名称样式 */ $goods_name_style = explode('+', empty($goods['goods_name_style']) ? '+' : $goods['goods_name_style']); /* 创建 html editor */ create_html_editor('goods_desc', $goods['goods_desc']); create_html_editor2('goods_shipai', 'goods_shipai', $goods['goods_shipai']); create_html_editor2('mobile_desc', 'mobile_desc', $goods['mobile_desc']); /* 模板赋值 */ $smarty->assign('code', $code); $smarty->assign('ur_here', $is_add ? empty($code) ? $_LANG['02_goods_add'] : $_LANG['51_virtual_card_add'] : ($_REQUEST['act'] == 'edit' ? $_LANG['edit_goods'] : $_LANG['copy_goods'])); $smarty->assign('action_link', list_link($is_add, $code)); $smarty->assign('goods', $goods); $smarty->assign('goods_name_color', $goods_name_style[0]); $smarty->assign('goods_name_style', $goods_name_style[1]); $smarty->assign('cat_list', cat_list(0, $goods['cat_id'])); $smarty->assign('brand_list', get_brand_list()); $smarty->assign('unit_list', get_unit_list()); $smarty->assign('user_rank_list', get_user_rank_list()); $smarty->assign('weight_unit', $is_add ? '1' : ($goods['goods_weight'] >= 1 ? '1' : '0.001')); $smarty->assign('cfg', $_CFG); $smarty->assign('form_act', $is_add ? 'insert' : ($_REQUEST['act'] == 'edit' ? 'update' : 'insert')); if ($_REQUEST['act'] == 'add' || $_REQUEST['act'] == 'edit') {