本文整理汇总了PHP中assign_ur_here函数的典型用法代码示例。如果您正苦于以下问题:PHP assign_ur_here函数的具体用法?PHP assign_ur_here怎么用?PHP assign_ur_here使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assign_ur_here函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_api_message
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']));
}
示例2: show_login_message
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=" . $_SESSION['user_id'] . "&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;
}
示例3: die
// 推荐商品
$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()); // 最新文章
示例4: intval
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'));
示例5: sub_str
$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);
示例6: isset
$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);
/* 取得国家列表、商店所在国家、商店所在国家的省列表 */
示例7: show_message
/**
* 显示一个提示信息
*
* @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;
}
示例8: define
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');
示例9: dirname
}
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']);
示例10: define
* $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) {
示例11: array
$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');
}
/*------------------------------------------------------ */
示例12: empty
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');
示例13: action_view
//.........这里部分代码省略.........
// $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);
}
示例14: get_goods_info
/* 获得商品的信息 */
$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']);
示例15: max
$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}'";