function show_api_message($content, $links = '', $hrefs = '', $type = 'info', $auto_redirect = true) { assign_template(); $msg['content'] = $content; if (is_array($links) && is_array($hrefs)) { if (!empty($links) && count($links) == count($hrefs)) { foreach ($links as $key => $val) { $msg['url_info'][$val] = $hrefs[$key]; } $msg['back_url'] = $hrefs['0']; } } else { $link = empty($links) ? $GLOBALS['_LANG']['back_up_page'] : $links; $href = empty($hrefs) ? 'javascript:history.back()' : $hrefs; $msg['url_info'][$link] = $href; $msg['back_url'] = $href; } $msg['type'] = $type; $position = assign_ur_here(0, $GLOBALS['_LANG']['sys_msg']); $GLOBALS['smarty']->assign('page_title', $position['title']); // 页面标题 $GLOBALS['smarty']->assign('ur_here', $position['ur_here']); // 当前位置 $GLOBALS['smarty']->assign('auto_redirect', $auto_redirect); $GLOBALS['smarty']->assign('act', 'message'); $GLOBALS['smarty']->assign('message', $msg); die($GLOBALS['smarty']->fetch($GLOBALS['api_tpl'])); }
function show_login_message($content, $links = '', $hrefs = '', $type = 'info', $auto_redirect = true) { assign_template(); $msg['content'] = $content; if (is_array($links) && is_array($hrefs)) { if (!empty($links) && count($links) == count($hrefs)) { foreach ($links as $key => $val) { $msg['url_info'][$val] = $hrefs[$key]; } $msg['back_url'] = $hrefs['0']; } } else { $link = empty($links) ? $GLOBALS['_LANG']['back_up_page'] : $links; $href = empty($hrefs) ? 'javascript:history.back()' : $hrefs; $msg['url_info'][$link] = $href; $msg['back_url'] = $href; } $msg['type'] = $type; $position = ''; if (isset($GLOBALS['_LANG']['sys_msg'])) { $position = assign_ur_here(0, $GLOBALS['_LANG']['sys_msg']); $GLOBALS['smarty']->assign('page_title', $position['title']); // 页面标题 $GLOBALS['smarty']->assign('ur_here', $position['ur_here']); // 当前位置 } if (is_null($GLOBALS['smarty']->get_template_vars('helps'))) { $GLOBALS['smarty']->assign('helps', get_shop_help()); // 网店帮助 } $GLOBALS['smarty']->assign('auto_redirect', $auto_redirect); $GLOBALS['smarty']->assign('message', $msg); $GLOBALS['smarty']->assign('jhy_web_url', "http://www.dream-gardens.com.cn/index.php?login="******"&n=" . $_SESSION['user_name'] . "&rankid=" . $_SESSION['rankid'] . "&rankname=" . $_SESSION['rankname'] . "&img=" . $_SESSION['avatar'] . "&alias=" . $_SESSION['alias']); $GLOBALS['smarty']->assign('sns_web_url', "http://112.124.110.58:8084/index.php?app=public&mod=Register&act=loginByJHY&uname=" . $_SESSION['user_name'] . '&id=' . $_SESSION['user_id']); $GLOBALS['smarty']->assign('sns_web_login_url', "http://112.124.110.58:8084/index.php?app=public&mod=Passport&act=doLoginByJHY&login_email=" . $_SESSION['user_id']); $GLOBALS['smarty']->display('message_login.dwt'); exit; }
// 推荐商品 $smarty->assign('cat_rec_sign', 1); $result['content'] = $smarty->fetch('library/recommend_' . $rec_array[$rec_type] . '.lbi'); die($json->encode($result)); } /*------------------------------------------------------ */ //-- 判断是否存在缓存,如果存在则调用缓存,反之读取相应内容 /*------------------------------------------------------ */ /* 缓存编号 */ $cache_id = sprintf('%X', crc32($_SESSION['user_rank'] . '-' . $_CFG['lang'] . '-' . $_GET['suppId'])); if (!$smarty->is_cached('mall.dwt', $cache_id)) { //echo "<pre>"; //print_r($_CFG); assign_template(); assign_template_supplier(); $position = assign_ur_here(); $smarty->assign('page_title', $position['title']); // 页面标题 //$smarty->assign('ur_here', $position['ur_here']); // 当前位置 //$smarty->assign('feed_url', ($_CFG['rewrite'] == 1) ? 'feed.xml' : 'feed.php'); // RSS URL $smarty->assign('categories', get_categories_tree_supplier()); // 分类树 //1,2,3对应店铺商品分类中的精品,最新,热门 $smarty->assign('best_goods', get_supplier_goods(1)); // 精品商品 $smarty->assign('new_goods', get_supplier_goods(2)); // 最新商品 $smarty->assign('hot_goods', get_supplier_goods(3)); // 热门商品 //$smarty->assign('top_goods', get_top10()); // 销售排行 //$smarty->assign('new_articles', index_get_new_articles()); // 最新文章
if (!empty($_GET['id'])) { $cat_id = intval($_GET['id']); } elseif (!empty($_GET['category'])) { $cat_id = intval($_GET['category']); } /* 获得当前页码 */ $page = !empty($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1; /*------------------------------------------------------ */ //-- PROCESSOR /*------------------------------------------------------ */ /* 获得页面的缓存ID */ $cache_id = sprintf('%X', crc32($cat_id . '-' . $page . '-' . $_CFG['lang'])); if (!$smarty->is_cached('article_cat.dwt', $cache_id)) { /* 如果页面没有被缓存则重新获得页面的内容 */ assign_template('a', array($cat_id)); $position = assign_ur_here($cat_id); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree(0)); // 分类树 $smarty->assign('article_categories', article_categories_tree($cat_id)); //文章分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('best_goods', get_recommend_goods('best')); $smarty->assign('new_goods', get_recommend_goods('new')); $smarty->assign('hot_goods', get_recommend_goods('hot'));
$promote_price = 0; } $goods[$idx]['id'] = $row['goods_id']; $goods[$idx]['name'] = $row['goods_name']; $goods[$idx]['short_name'] = $_CFG['goods_name_length'] > 0 ? sub_str($row['goods_name'], $_CFG['goods_name_length']) : $row['goods_name']; $goods[$idx]['market_price'] = $row['market_price']; $goods[$idx]['shop_price'] = price_format($row['shop_price']); $goods[$idx]['promote_price'] = $promote_price > 0 ? price_format($promote_price) : ''; $goods[$idx]['brief'] = $row['goods_brief']; $goods[$idx]['thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); $goods[$idx]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']); $idx++; } $picks[] = array('name' => $_LANG['remove_all'], 'url' => 'pick_out.php'); assign_template(); $position = assign_ur_here(0, $_LANG['pick_out']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('brand_list', $brand_list); //品牌 $smarty->assign('cat_list', $cat_list); //分类列表 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('data_dir', DATA_DIR);
$choose['country'] = isset($_POST['country']) ? $_POST['country'] : $consignee_list[0]['country']; $choose['province'] = isset($_POST['province']) ? $_POST['province'] : $consignee_list[0]['province']; $choose['city'] = isset($_POST['city']) ? $_POST['city'] : $consignee_list[0]['city']; $choose['district'] = isset($_POST['district']) ? $_POST['district'] : (isset($consignee_list[0]['district']) ? $consignee_list[0]['district'] : 0); } else { $choose['country'] = isset($_POST['country']) ? $_POST['country'] : $_CFG['shop_country']; $choose['province'] = isset($_POST['province']) ? $_POST['province'] : 2; $choose['city'] = isset($_POST['city']) ? $_POST['city'] : 35; $choose['district'] = isset($_POST['district']) ? $_POST['district'] : 417; } /*------------------------------------------------------ */ //-- PROCESSOR /*------------------------------------------------------ */ assign_template(); assign_dynamic('myship'); $position = assign_ur_here(0, $_LANG['shopping_myship']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('lang', $_LANG); $smarty->assign('choose', $choose); $province_list[NULL] = get_regions(1, $choose['country']); $city_list[NULL] = get_regions(2, $choose['province']); $district_list[NULL] = get_regions(3, $choose['city']); $smarty->assign('province_list', $province_list); $smarty->assign('city_list', $city_list); $smarty->assign('district_list', $district_list); /* 取得国家列表、商店所在国家、商店所在国家的省列表 */
/** * 显示一个提示信息 * * @access public * @param string $content * @param string $link * @param string $href * @param string $type 信息类型:warning, error, info * @param string $auto_redirect 是否自动跳转 * @return void */ function show_message($content, $links = '', $hrefs = '', $type = 'info', $auto_redirect = true) { assign_template(); $msg['content'] = $content; if (is_array($links) && is_array($hrefs)) { if (!empty($links) && count($links) == count($hrefs)) { foreach ($links as $key => $val) { $msg['url_info'][$val] = $hrefs[$key]; } $msg['back_url'] = $hrefs['0']; } } else { $link = empty($links) ? $GLOBALS['_LANG']['back_up_page'] : $links; $href = empty($hrefs) ? 'javascript:history.back()' : $hrefs; $msg['url_info'][$link] = $href; $msg['back_url'] = $href; } $msg['type'] = $type; $position = assign_ur_here(0, $GLOBALS['_LANG']['sys_msg']); $GLOBALS['smarty']->assign('page_title', $position['title']); // 页面标题 $GLOBALS['smarty']->assign('ur_here', $position['ur_here']); // 当前位置 if (is_null($GLOBALS['smarty']->get_template_vars('helps'))) { $GLOBALS['smarty']->assign('helps', get_shop_help()); // 网店帮助 } $GLOBALS['smarty']->assign('auto_redirect', $auto_redirect); $GLOBALS['smarty']->assign('message', $msg); $GLOBALS['smarty']->display('message.dwt'); exit; }
define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; if ((DEBUG_MODE & 2) != 2) { $smarty->caching = true; } if (!$smarty->is_cached('catalog.dwt')) { /* 取出所有分类 */ $cat_list = cat_list(0, 0, false); foreach ($cat_list as $key => $val) { if ($val['is_show'] == 0) { unset($cat_list[$key]); } } assign_template(); assign_dynamic('catalog'); $position = assign_ur_here(0, $_LANG['catalog']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('cat_list', $cat_list); // 分类列表 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('brand_list', get_brands()); // 所以品牌赋值 $smarty->assign('promotion_info', get_promotion_info()); } $smarty->display('catalog.dwt');
} require dirname(__FILE__) . '/includes/init.php'; $_REQUEST = array_merge($_REQUEST, addslashes_deep($string)); $_REQUEST['act'] = !empty($_REQUEST['act']) ? trim($_REQUEST['act']) : ''; /*------------------------------------------------------ */ //-- 高级搜索 /*------------------------------------------------------ */ if ($_REQUEST['act'] == 'advanced_search') { $goods_type = !empty($_REQUEST['goods_type']) ? intval($_REQUEST['goods_type']) : 0; $attributes = get_seachable_attributes($goods_type); $smarty->assign('goods_type_selected', $goods_type); $smarty->assign('goods_type_list', $attributes['cate']); $smarty->assign('goods_attributes', $attributes['attr']); assign_template(); assign_dynamic('search'); $position = assign_ur_here(0, $_LANG['advanced_search']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('promotion_info', get_promotion_info()); $smarty->assign('cat_list', cat_list(0, 0, true, 2, false)); $smarty->assign('brand_list', get_brand_list()); $smarty->assign('action', 'form'); $smarty->assign('use_storage', $_CFG['use_storage']);
* $Id: activity.php 16056 2009-05-21 05:44:14Z liubo $ */ define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; require_once ROOT_PATH . 'includes/lib_order.php'; include_once ROOT_PATH . 'includes/lib_transaction.php'; /* 载入语言文件 */ require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/shopping_flow.php'; require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/user.php'; require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/package.php'; /*------------------------------------------------------ */ //-- PROCESSOR /*------------------------------------------------------ */ assign_template(); assign_dynamic('package'); $position = assign_ur_here(0, $_LANG['shopping_package']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 /* 读出所有礼包信息 */ $now = gmtime(); $sql = "SELECT * FROM " . $ecs->table('goods_activity') . " WHERE `start_time` <= '{$now}' AND `end_time` >= '{$now}' AND `act_type` = '4' ORDER BY `end_time`"; $res = $db->query($sql); $list = array(); while ($row = $db->fetchRow($res)) { $row['start_time'] = local_date('Y-m-d H:i', $row['start_time']); $row['end_time'] = local_date('Y-m-d H:i', $row['end_time']); $ext_arr = unserialize($row['ext_info']); unset($row['ext_info']); if ($ext_arr) {
$url_format .= "&intro=" . $_REQUEST['intro']; } if (isset($_REQUEST['pickout'])) { $url_format .= '&pickout=1'; } $url_format .= "&min_price=" . $_REQUEST['min_price'] . "&max_price=" . $_REQUEST['max_price'] . "&sort={$sort}"; $url_format .= "{$attr_url}&order={$order}&page="; $pager['search'] = array('keywords' => stripslashes(urlencode($_REQUEST['keywords'])), 'category' => $category, 'brand' => $_REQUEST['brand'], 'sort' => $sort, 'order' => $order, 'min_price' => $_REQUEST['min_price'], 'max_price' => $_REQUEST['max_price'], 'action' => $action, 'intro' => empty($_REQUEST['intro']) ? '' : trim($_REQUEST['intro']), 'goods_type' => $_REQUEST['goods_type'], 'sc_ds' => $_REQUEST['sc_ds']); $pager['search'] = array_merge($pager['search'], $attr_arg); $pager = get_pager('search.php', $pager['search'], $count, $page, $size); $pager['display'] = $display; $smarty->assign('url_format', $url_format); $smarty->assign('pager', $pager); assign_template(); assign_dynamic('search'); $position = assign_ur_here(0, $ur_here); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('intromode', $intromode); $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 assign_dynamic('search_result'); $smarty->display('search.dwt'); } /*------------------------------------------------------ */
include_once ROOT_PATH . 'includes/lib_transaction.php'; $oid = empty($_GET['order_id']) ? 0 : $_GET['order_id']; $gid = empty($_GET['goods_id']) ? 0 : $_GET['goods_id']; $order_id_arr = $db->getAll("SELECT order_id FROM " . $ecs->table('order_info') . "WHERE user_id = '{$user_id}' AND order_status = 5"); $sql = "SELECT order_id FROM " . $ecs->table('single') . " WHERE goods_id='{$gid}' AND order_id='{$oid}'"; if ($db->getRow($sql)) { show_message($_LANG['is_single'], $_LANG['back_page_up'], "user.php?act=single_list", 'error'); } $orders = get_user_orders_goods($user_id); $arr = array(); foreach ($orders as $key => $val) { if ($val['is_single'] == 0) { $arr[] = array('order_id' => $val['order_id'], 'goods_name' => $val['goods_name'], 'goods_thumb' => $val['goods_thumb'], 'goods_attr' => $val['goods_attr'], 'goods_number' => $val['goods_number'], 'order_sn' => $val['order_sn'], 'order_time' => local_date($GLOBALS['_CFG']['time_format'], $val['add_time']), 'order_status' => $val['order_status'], 'total_fee' => price_format($val['total_fee'], false), 'handler' => $val['handler'], 'single_sun' => $val['single_sun'], 'is_single' => $val['is_single'], 'goods_id' => $val['goods_id'], 'cat_id' => $val['cat_id'], 'single_order_time' => $val['add_time']); } } $position = assign_ur_here(0, '发表晒单'); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); $smarty->assign('oid', $oid); $smarty->assign('gid', $gid); $smarty->assign('orders', $arr); $smarty->display('user_single.dwt'); } elseif ($action == 'single_sun_insert') { include_once ROOT_PATH . 'includes/lib_transaction.php'; // 相册图片 if (empty($_POST['order_id'])) { show_message('请选择晒单订单', $_LANG['back_page_up'], "user.php?act=single_sun&order_id={$order_id}", 'error'); } if (empty($_POST['title_sn'])) { show_message('请填写晒单标题', $_LANG['back_page_up'], "user.php?act=single_sun&order_id={$order_id}", 'error');
function action_view() { $smarty = $GLOBALS['smarty']; $db = $GLOBALS['db']; $ecs = $GLOBALS['ecs']; /* 取得参数:预售活动id */ $pre_sale_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; if ($pre_sale_id <= 0) { ecs_header("Location: pre_sale.php\n"); exit; } /* 取得预售活动信息 */ $pre_sale = pre_sale_info($pre_sale_id); if (empty($pre_sale)) { ecs_header("Location: pre_sale.php\n"); exit; } // elseif ($pre_sale['is_on_sale'] == 0 || $pre_sale['is_alone_sale'] == 0) // { // header("Location: ./\n"); // exit; // } /* 评价数量 */ $pre_sale['comment_count'] = goods_comment_count($pre_sale['goods_id']); /* 累计销量 */ $pre_sale['sale_count'] = goods_sale_count($pre_sale['goods_id']); /* 赠送积分 */ $pre_sale['give_integral'] = $pre_sale['gift_integral']; /* 缓存id:语言,预售活动id,状态,(如果是进行中)当前数量和是否登录 */ $cache_id = $_CFG['lang'] . '-' . $pre_sale_id . '-' . $pre_sale['status']; // 活动进行中 if ($pre_sale['status'] == PSS_UNDER_WAY) { $cache_id = $cache_id . '-' . $pre_sale['valid_goods'] . '-' . intval($_SESSION['user_id'] > 0); } $cache_id = sprintf('%X', crc32($cache_id)); /* 如果没有缓存,生成缓存 */ if (!$smarty->is_cached('pre_sale_goods.dwt', $cache_id) || true) { $pre_sale['gmt_end_date'] = $pre_sale['end_date']; $smarty->assign('pre_sale', $pre_sale); /* 取得预售商品信息 */ $goods_id = $pre_sale['goods_id']; $goods = get_goods_info($goods_id); if (empty($goods)) { ecs_header("Location: pre_sale.php\n"); exit; } $goods['url'] = build_uri('goods', array('gid' => $goods_id), $goods['goods_name']); $goods = array_merge($goods, $pre_sale); $gift_integral = $pre_sale['gift_integral']; $goods['give_integral'] = $pre_sale['gift_integral']; // $parent_cat_id = get_parent_cat_id($goods['cat_id']); // $goods['child_cat'] = get_child_cat($parent_cat_id); // 相关分类 // $goods['get_cat_brands'] = get_cat_brands($parent_cat_id);; // 同类品牌 $smarty->assign('url', $_SERVER["REQUEST_URI"]); $smarty->assign('volume_price', $goods_volume_price); $smarty->assign('goods_id', $goods['goods_id']); $smarty->assign('promote_end_time', $goods['gmt_end_time']); $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('promotion_info', get_promotion_info()); // yyy添加start $count1 = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " where comment_type=0 and id_value ='{$goods_id}' and status=1"); $smarty->assign('review_count', $count1); // 评论数 // 评价晒单 增加 by www.68ecshop.com $rank_num['rank_a'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank in (5,4)"); $rank_num['rank_b'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank in (3,2)"); $rank_num['rank_c'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank = 1"); $rank_num['rank_total'] = $rank_num['rank_a'] + $rank_num['rank_b'] + $rank_num['rank_c']; $rank_num['rank_pa'] = $rank_num['rank_a'] > 0 ? round($rank_num['rank_a'] / $rank_num['rank_total'] * 100, 1) : 0; $rank_num['rank_pb'] = $rank_num['rank_b'] > 0 ? round($rank_num['rank_b'] / $rank_num['rank_total'] * 100, 1) : 0; $rank_num['rank_pc'] = $rank_num['rank_c'] > 0 ? round($rank_num['rank_c'] / $rank_num['rank_total'] * 100, 1) : 0; $rank_num['shaidan_num'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('shaidan') . " WHERE goods_id = '{$goods_id}' AND status = 1"); $smarty->assign('rank_num', $rank_num); $res = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('goods_tag') . " WHERE goods_id = '{$goods_id}' AND state = 1"); foreach ($res as $v) { $v['tag_num'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND FIND_IN_SET({$v['tag_id']},comment_tag)"); $tag_arr[] = $v; } require_once 'includes/lib_comment.php'; $tag_arr = array_sort($tag_arr, 'tag_num', 'desc'); if ($tag_arr) { foreach ($tag_arr as $key => $val) { if ($_CFG['tag_show_num'] > 0) { if ($key + 1 <= $_CFG['tag_show_num']) { $comment_tags[] = $val; } } else { $comment_tags[] = $val; } } } $smarty->assign('comment_tags', $comment_tags); /* meta */ $smarty->assign('keywords', htmlspecialchars($goods['keywords'])); $smarty->assign('description', htmlspecialchars($goods['goods_brief'])); $goods['goods_style_name'] = add_style($goods['goods_name'], $goods['goods_name_style']); $smarty->assign('goods', $goods); $smarty->assign('goods_id', $goods['goods_id']); /* 取得商品的规格 */ $properties = get_goods_properties($goods_id); $smarty->assign('specification', $properties['spe']); // 商品规格 $smarty->assign('pictures', get_goods_gallery_attr_2($goods_id, $goods_attr_id)); // 商品相册 $smarty->assign('new_goods', get_recommend_goods('new')); // 最新商品 $smarty->assign('shop_country', $_CFG['shop_country']); /* 代码增加_start By www.ecshop68.com */ $sql_attr = "SELECT a.attr_id, ga.goods_attr_id FROM " . $GLOBALS['ecs']->table('attribute') . " AS a left join " . $GLOBALS['ecs']->table('goods_attr') . " AS ga on a.attr_id=ga.attr_id WHERE a.is_attr_gallery=1 and ga.goods_id='" . $goods_id . "' order by ga.goods_attr_id "; $goods_attr = $GLOBALS['db']->getRow($sql_attr); if ($goods_attr) { $goods_attr_id = $goods_attr['goods_attr_id']; $smarty->assign('attr_id', $goods_attr['attr_id']); } else { $smarty->assign('attr_id', 0); } $prod_exist_arr = array(); $sql_prod = "select goods_attr from " . $GLOBALS['ecs']->table('products') . " where product_number>0 and goods_id='{$goods_id}' order by goods_attr"; $res_prod = $GLOBALS['db']->query($sql_prod); while ($row_prod = $GLOBALS['db']->fetchRow($res_prod)) { $prod_exist_arr[] = "|" . $row_prod['goods_attr'] . "|"; } $smarty->assign('prod_exist_arr', $prod_exist_arr); // 模板赋值 $smarty->assign('cfg', $_CFG); assign_template(); $position = assign_ur_here(0, $goods['goods_name']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 /* 代码增加_start By www.68ecshop.com */ $goods['supplier_name'] = "网站自营"; if ($goods['supplier_id'] > 0) { $sql_supplier = "SELECT s.supplier_id,s.supplier_name,s.add_time,sr.rank_name FROM " . $ecs->table("supplier") . " as s left join " . $ecs->table("supplier_rank") . " as sr ON s.rank_id=sr.rank_id WHERE s.supplier_id=" . $goods[supplier_id] . " AND s.status=1"; $shopuserinfo = $db->getRow($sql_supplier); $goods['supplier_name'] = $shopuserinfo['supplier_name']; get_dianpu_baseinfo($goods['supplier_id'], $shopuserinfo); } assign_dynamic('pre_sale_goods'); } // 更新商品点击次数 $sql = 'UPDATE ' . $GLOBALS['ecs']->table('goods') . ' SET click_count = click_count + 1 ' . "WHERE goods_id = '" . $pre_sale['goods_id'] . "'"; $GLOBALS['db']->query($sql); $smarty->assign('now_time', gmtime()); // 当前系统时间 $smarty->display('pre_sale_goods.dwt', $cache_id); }
/* 获得商品的信息 */ $goods = get_goods_info($goods_id); if ($goods === false) { /* 如果没有找到任何记录则跳回到首页 */ ecs_header("Location: ./\n"); exit; } $catlist = array(); foreach (get_parent_cats($goods['cat_id']) as $k => $v) { $catlist[] = $v['cat_id']; } assign_template('c', $catlist); /* meta */ $smarty->assign('keywords', htmlspecialchars($goods['keywords'])); $smarty->assign('description', htmlspecialchars($goods['goods_brief'])); $position = assign_ur_here($goods['cat_id'], substr($goods['goods_name'], 0, 30) . "..."); $position['ur_here'] .= ' <code>></code> Show'; /* current position */ $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('goods', $goods); $smarty->assign('goods_id', $goods['goods_id']); $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']);
$next_gid = $db->getOne("SELECT max(goods_id) FROM " . $ecs->table('goods') . " WHERE cat_id=" . $goods['cat_id'] . " AND goods_id < " . $goods['goods_id'] . " AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0"); if (!empty($next_gid)) { $next_good['url'] = build_uri('goods', array('gid' => $next_gid), $goods['goods_name']); $smarty->assign('next_good', $next_good); //下一个商品 } $brand_info = get_brand_info($goods['brand_id']); $brand_cat_arr = get_brand_cat($brand_info['brand_cat']); $brand_cat_str = ''; if (!empty($brand_info) && !empty($brand_info['brand_cat'])) { $brand_cat_str = ' <code>></code> <a href="' . build_uri('brand_cat', array('bid' => $brand_cat_arr['cat_id']), $val['cat_name']) . '">' . htmlspecialchars($brand_cat_arr['cat_name']) . '</a>'; } if (!empty($brand_info['brand_name'])) { $brand_cat_str .= ' <code>></code> <a href="' . build_uri('brand', array('bid' => $brand_info['brand_id']), $val['brand_name']) . '">' . htmlspecialchars($brand_info['brand_name']) . '</a>'; } $position = assign_ur_here(0, $goods['goods_name'], $brand_cat_str); /* current position */ $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $properties = get_goods_properties($goods_id); // 获得商品的规格和属性 $smarty->assign('properties', $properties['pro']); // 商品属性 //增加同分类同品牌下的商品 $smarty->assign('category_related_brand_goods', category_related_brand_goods($goods['cat_id'], $goods['brand_id'])); /* 代码增加_start By www.ecshop68.com */ $sql_zhyh_qq = "select attr_id from " . $ecs->table('attribute') . " where cat_id='" . $goods['goods_type'] . "' and is_attr_gallery='1' "; $attr_id_gallery = $db->getOne($sql_zhyh_qq); $sql = "SELECT goods_attr_id, attr_value FROM " . $GLOBALS['ecs']->table('goods_attr') . " WHERE goods_id = '{$goods_id}'";
require ROOT_PATH . 'includes/lib_order.php'; /* 载入语言文件 */ require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/user.php'; require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/shopping_flow.php'; /*------------------------------------------------------ */ //-- INPUT /*------------------------------------------------------ */ if (!isset($_REQUEST['step'])) { $_REQUEST['step'] = "cart"; } /*------------------------------------------------------ */ //-- PROCESSOR /*------------------------------------------------------ */ assign_template(); assign_dynamic('flow'); $position = assign_ur_here(0, $_LANG['shopping_flow']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('lang', $_LANG); $smarty->assign('show_marketprice', $_CFG['show_marketprice']); $smarty->assign('data_dir', DATA_DIR); // 数据目录 /*------------------------------------------------------ */ //-- 添加商品到购物车 /*------------------------------------------------------ */
/** * 标签云 * ============================================================================ * * 版权所有 2005-2012 广州新泛联数码有限公司,并保留所有权利。 * 网站地址: http://www..com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liubo $ * $Id: tag_cloud.php 17217 2011-01-19 06:29:08Z liubo $ */ define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; assign_template(); $position = assign_ur_here(0, $_LANG['tag_cloud']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('categories_pro', get_categories_tree_pro()); // 分类树加强版/* 周改 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('promotion_info', get_promotion_info()); /* 调查 */ $vote = get_vote();
} $user_rank = $db->getAll("SELECT * FROM " . $ecs->table('user_rank') . "WHERE show_price = 1 OR rank_id = '{$_SESSION['user_rank']}'"); $rank_point = 0; if (!empty($_SESSION['user_id'])) { $rank_point = $db->getOne("SELECT rank_points FROM " . $ecs->table('users') . " WHERE user_id = '{$_SESSION['user_id']}'"); } $user_rank = calc_user_rank($user_rank, $rank_point); $user_men = serve_user($goods_list); $smarty->assign('extend_price', $user_rank['ext_price']); $smarty->assign('extend_rank', $user_men); $smarty->assign('goods_list', $goods_list); $html = $smarty->fetch('quotation_print.html'); exit($html); } assign_template(); $position = assign_ur_here(0, $_LANG['quotation']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('cat_list', cat_list()); $smarty->assign('brand_list', get_brand_list()); if (is_null($smarty->get_template_vars('helps'))) { $smarty->assign('helps', get_shop_help()); // 网店帮助 } $smarty->display('quotation.dwt'); function get_quotation_where($filter) { include_once ROOT_PATH . ADMIN_PATH_M . '/includes/lib_main.php'; $_filter = new StdClass();
//-- PROCESSOR /*------------------------------------------------------ */ /* 页面的缓存ID */ $cache_id = sprintf('%X', crc32($brand_id . '-' . $display . '-' . $sort . '-' . $order . '-' . $page . '-' . $size . '-' . $_SESSION['user_rank'] . '-' . $_CFG['lang'] . '-' . $cate)); if (!$smarty->is_cached('brand.dwt', $cache_id)) { $brand_info = get_brand_info($brand_id); if (empty($brand_info)) { ecs_header("Location: ./\n"); exit; } $smarty->assign('data_dir', DATA_DIR); $smarty->assign('keywords', htmlspecialchars($brand_info['brand_desc'])); $smarty->assign('description', htmlspecialchars($brand_info['brand_desc'])); /* 赋值固定内容 */ assign_template(); $position = assign_ur_here($cate, $brand_info['brand_name']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('brand_id', $brand_id); $smarty->assign('category', $cate); $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('show_marketprice', $_CFG['show_marketprice']); $smarty->assign('brand_cat_list', brand_related_cat($brand_id)); // 相关分类
$message = array('user_id' => $user_id, 'user_name' => $user_name, 'user_email' => isset($_POST['user_email']) ? htmlspecialchars(trim($_POST['user_email'])) : '', 'msg_type' => isset($_POST['msg_type']) ? intval($_POST['msg_type']) : 0, 'msg_title' => isset($_POST['msg_title']) ? trim($_POST['msg_title']) : '', 'msg_content' => isset($_POST['msg_content']) ? trim($_POST['msg_content']) : '', 'order_id' => 0, 'msg_area' => 1, 'upload' => array()); if (add_message($message)) { if (intval($_CFG['captcha']) & CAPTCHA_MESSAGE) { unset($_SESSION[$validator->session_word]); } else { $_SESSION['send_time'] = $cur_time; } $msg_info = $_CFG['message_check'] ? $_LANG['message_submit_wait'] : $_LANG['message_submit_done']; show_message($msg_info, $_LANG['message_list_lnk'], 'message.php'); } else { $err->show($_LANG['message_list_lnk'], 'message.php'); } } if ($action == 'default') { assign_template(); $position = assign_ur_here(0, $_LANG['message_board']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('cat_list', cat_list(0, 0, true, 2, false)); $smarty->assign('brand_list', get_brand_list()); $smarty->assign('promotion_info', get_promotion_info()); $smarty->assign('enabled_mes_captcha', intval($_CFG['captcha']) & CAPTCHA_MESSAGE); $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " WHERE STATUS =1 AND comment_type =0 ";
$smarty->assign('type', '1'); $smarty->assign('promotion_info', get_promotion_info()); /* 验证码相关设置 */ if (intval($_CFG['captcha']) & CAPTCHA_COMMENT && gd_version() > 0) { $smarty->assign('enabled_captcha', 1); $smarty->assign('rand', mt_rand()); } $smarty->assign('article', $article); $smarty->assign('keywords', htmlspecialchars($article['keywords'])); $smarty->assign('description', htmlspecialchars($article['description'])); $catlist = array(); foreach (get_article_parent_cats($article['cat_id']) as $k => $v) { $catlist[] = $v['cat_id']; } assign_template('a', $catlist); $position = assign_ur_here($article['cat_id'], $article['title']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('comment_type', 1); if ($type == 'sjs') { $table = 'ecs_article_sjs'; } else { if ($type == 'jg') { $table = 'ecs_article_jg'; } else { if ($type = 'fu') { $table = 'ecs_ssj'; } else { $table = 'ecs_article';
} $all_attr_list[$key_attr_qq]['attr_list'] = $attr_list_qq; break; } } } //echo '<pre>'; //print_r($all_attr_list); //echo '</pre>'; $smarty->assign('filter_attr_list', $all_attr_list); } $filter_info = array(0 => array('id' => 0, 'name' => '全部', 'selected' => 0, 'url' => build_uri('category', array_merge($attr_url_value, array('filter' => 0)), '全部')), 1 => array('id' => 1, 'name' => '网站自营', 'selected' => 0, 'url' => build_uri('category', array_merge($attr_url_value, array('filter' => 1)), '网站自营')), 2 => array('id' => 2, 'name' => '入驻商店铺', 'selected' => 0, 'url' => build_uri('category', array_merge($attr_url_value, array('filter' => 2)), '入驻商店铺'))); $filter_info[$filter]['selected'] = 1; $smarty->assign('filterinfo', $filter_info); assign_template('c', array($cat_id)); $position = assign_ur_here($cat_id, $brand_name); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('current_cat_id', $cat_id); //取得当前的id /*取得顶级ID*/ $catlist = array(); foreach (get_parent_cats($cat_id) as $k => $v) { $catlist[] = $v['cat_id']; } $smarty->assign('current_cat_pr_id', $catlist[count($catlist) - 1]); /*取得顶级ID*/ $smarty->assign('current_cat_pr2_id', $catlist[count($catlist) - 2]); /*取得二级分类ID*/
$sql = "SELECT eg.goods_id FROM " . $ecs->table('exchange_goods') . " AS eg," . $GLOBALS['ecs']->table('goods') . " AS g WHERE eg.goods_id = g.goods_id AND eg.goods_id > " . $goods['goods_id'] . " AND eg.is_exchange = 1 AND g.is_delete = 0 LIMIT 1"; $prev_gid = $db->getOne($sql); if (!empty($prev_gid)) { $prev_good['url'] = build_uri('exchange_goods', array('gid' => $prev_gid), $goods['goods_name']); $smarty->assign('prev_good', $prev_good); //上一个商品 } $sql = "SELECT max(eg.goods_id) FROM " . $ecs->table('exchange_goods') . " AS eg," . $GLOBALS['ecs']->table('goods') . " AS g WHERE eg.goods_id = g.goods_id AND eg.goods_id < " . $goods['goods_id'] . " AND eg.is_exchange = 1 AND g.is_delete = 0"; $next_gid = $db->getOne($sql); if (!empty($next_gid)) { $next_good['url'] = build_uri('exchange_goods', array('gid' => $next_gid), $goods['goods_name']); $smarty->assign('next_good', $next_good); //下一个商品 } /* current position */ $position = assign_ur_here('exchange', $goods['goods_name']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $properties = get_goods_properties($goods_id); // 获得商品的规格和属性 $smarty->assign('properties', $properties['pro']); // 商品属性 $smarty->assign('specification', $properties['spe']); // 商品规格 $smarty->assign('pictures', get_goods_gallery($goods_id)); // 商品相册 assign_dynamic('exchange_goods'); } }
$url_format .= "&intro=" . $intromode; } if (isset($_REQUEST['pickout'])) { $url_format .= '&pickout=1'; } $url_format .= "&min_price=" . $_REQUEST['min_price'] . "&max_price=" . $_REQUEST['max_price'] . "&sort={$sort}"; $url_format .= "{$attr_url}&order={$order}&page="; $pager['search'] = array('keywords' => stripslashes(urlencode($_REQUEST['keywords'])), 'category' => $category, 'brand' => $_REQUEST['brand'], 'sort' => $sort, 'order' => $order, 'min_price' => $_REQUEST['min_price'], 'max_price' => $_REQUEST['max_price'], 'action' => $action, 'intro' => empty($intromode) ? '' : trim($intromode), 'goods_type' => $_REQUEST['goods_type'], 'sc_ds' => $_REQUEST['sc_ds'], 'outstock' => $_REQUEST['outstock']); $pager['search'] = array_merge($pager['search'], $attr_arg); $pager = get_pager('search.php', $pager['search'], $count, $page, $size); $pager['display'] = $display; $smarty->assign('url_format', $url_format); $smarty->assign('pager', $pager); assign_template(); assign_dynamic('search'); $position = assign_ur_here(0, $ur_here . ($_REQUEST['keywords'] ? '_' . $_REQUEST['keywords'] : '')); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('intromode', $intromode); $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('promotion_info', get_promotion_info()); $smarty->display('search.dwt'); } /*------------------------------------------------------ */
if ($id) { $page = build_uri('snatch', array('sid' => $id)); ecs_header("Location: {$page}\n"); exit; } else { /* 当前没有任何可默认的活动 */ $id = 0; } } else { $id = intval($_REQUEST['id']); } /* 显示页面部分 */ if ($_REQUEST['act'] == 'main') { $goods = get_snatch($id); if ($goods) { $position = assign_ur_here(0, $goods['snatch_name']); $myprice = get_myprice($id); if ($goods['is_end']) { //如果活动已经结束,获取活动结果 $smarty->assign('result', get_snatch_result($id)); } $smarty->assign('id', $id); $smarty->assign('snatch_goods', $goods); // 竞价商品 $smarty->assign('myprice', get_myprice($id)); if ($goods['product_id'] > 0) { $goods_specifications = get_specifications_list($goods['goods_id']); $good_products = get_good_products($goods['goods_id'], 'AND product_id = ' . $goods['product_id']); $_good_products = explode('|', $good_products[0]['goods_attr']); $products_info = ''; foreach ($_good_products as $value) {
/* 取得商品的规格 */ $properties = get_goods_properties($goods_id); $smarty->assign('properties', $properties['pro']); // 商品属性 $smarty->assign('specification', $properties['spe']); // 商品规格 $gb_list = group_buy_list2(10,$group_buy_id); $smarty->assign('gb_list', $gb_list); //模板赋值 $smarty->assign('cfg', $_CFG); assign_template(); $smarty->assign('script_name', 'group'); $position = assign_ur_here(0, $goods['goods_name']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('hot_goods', get_recommend_goods('hot')); // 最热商品 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('promotion_info', get_promotion_info()); assign_dynamic('group_buy_goods'); } //更新商品点击次数 $sql = 'UPDATE ' . $ecs->table('goods') . ' SET click_count = click_count + 1 '. "WHERE goods_id = '" . $group_buy['goods_id'] . "'"; $db->query($sql);
assign_template('c', $catlist); /* 上一个商品下一个商品 */ /*$prev_gid = $db->getOne("SELECT goods_id FROM " .$ecs->table('goods'). " WHERE cat_id=" . $goods['cat_id'] . " AND goods_id > " . $goods['goods_id'] . " AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 LIMIT 1"); if (!empty($prev_gid)) { $prev_good['url'] = build_uri('goods', array('gid' => $prev_gid), $goods['goods_name']); $smarty->assign('prev_good', $prev_good);//上一个商品 } $next_gid = $db->getOne("SELECT max(goods_id) FROM " . $ecs->table('goods') . " WHERE cat_id=".$goods['cat_id']." AND goods_id < ".$goods['goods_id'] . " AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0"); if (!empty($next_gid)) { $next_good['url'] = build_uri('goods', array('gid' => $next_gid), $goods['goods_name']); $smarty->assign('next_good', $next_good);//下一个商品 }*/ $position = assign_ur_here($goods['cat_id'], $goods['goods_name']); /* current position */ $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $properties = get_goods_properties($goods_id); // 获得商品的规格和属性 $smarty->assign('properties', $properties['pro']); // 商品属性 $smarty->assign('specification', $properties['spe']); // 商品规格 $smarty->assign('attribute_linked', get_same_attribute_goods($properties)); // 相同属性的关联商品 $smarty->assign('related_goods', $linked_goods); // 关联商品
* $Author: liubo $ * $Id: activity.php 17217 2011-01-19 06:29:08Z liubo $ */ define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; require_once ROOT_PATH . 'includes/lib_order.php'; include_once ROOT_PATH . 'includes/lib_transaction.php'; /* 载入语言文件 */ require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/shopping_flow.php'; require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/user.php'; /*------------------------------------------------------ */ //-- PROCESSOR /*------------------------------------------------------ */ assign_template(); assign_dynamic('activity'); $position = assign_ur_here(0, $_LANG['shopping_activity']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 // 数据准备 /* 取得用户等级 */ $user_rank_list = array(); $user_rank_list[0] = $_LANG['not_user']; $sql = "SELECT rank_id, rank_name FROM " . $ecs->table('user_rank'); $res = $db->query($sql); while ($row = $db->fetchRow($res)) { $user_rank_list[$row['rank_id']] = $row['rank_name']; } // 开始工作 $sql = "SELECT * FROM " . $ecs->table('favourable_activity') . " ORDER BY `sort_order` ASC,`end_time` DESC";
else {}*/ if (!empty($_SERVER['QUERY_STRING'])) { $back_act = 'user.php?' . $_SERVER['QUERY_STRING']; } $action = 'login'; } else { //未登录提交数据。非正常途径提交数据! die($_LANG['require_login']); } } } /* 如果是显示页面,对页面进行相应赋值 */ if (in_array($action, $ui_arr)) { assign_template(); $position = assign_ur_here(0, $_LANG['user_center']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); /* 是否显示积分兑换 */ if (!empty($_CFG['points_rule']) && unserialize($_CFG['points_rule'])) { $smarty->assign('show_transform_points', 1); } $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('data_dir', DATA_DIR); // 数据目录 $smarty->assign('action', $action); $smarty->assign('lang', $_LANG); } //用户中心欢迎页
$tmp = $ids; $key = array_search($goods_id, $tmp); if ($key !== null && $key !== false) { unset($tmp[$key]); } $arr[$goods_id]['ids'] = !empty($tmp) ? "goods[]=" . implode('&goods[]=', $tmp) : ''; } $sql = "SELECT attr_id,attr_name FROM " . $ecs->table('attribute') . " WHERE cat_id='{$type_id}' ORDER BY attr_id"; $attribute = array(); $query = $db->query($sql); while ($rt = $db->fetch_array($query)) { $attribute[$rt['attr_id']] = $rt['attr_name']; } $smarty->assign('attribute', $attribute); $smarty->assign('goods_list', $arr); } else { show_message($_LANG['compare_no_goods']); exit; } assign_template(); $position = assign_ur_here(0, $_LANG['goods_compare']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 assign_dynamic('compare'); $smarty->display('compare.dwt');