本文整理汇总了PHP中assign_dynamic函数的典型用法代码示例。如果您正苦于以下问题:PHP assign_dynamic函数的具体用法?PHP assign_dynamic怎么用?PHP assign_dynamic使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assign_dynamic函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
$smarty->assign('page_count', $shop_list['page_count']);
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$start_array = range(1, $page);
$end_array = range($page, $shop_list['page_count']);
if ($page - 5 > 0) {
$smarty->assign('start', $page - 3);
$start_array = range($page, $page - 2);
}
if ($shop_list['page_count'] - $page > 5) {
$smarty->assign('end', $page + 3);
$end_array = range($page, $page + 2);
}
$page_array = array_merge($start_array, $end_array);
sort($page_array);
$smarty->assign('page_array', array_unique($page_array));
assign_dynamic('stores');
}
/* 显示模板 */
$smarty->display($tpl, $cache_id);
/**
* 获取所有店铺分类
*/
function get_all_category()
{
$sql = "select * from " . $GLOBALS['ecs']->table('street_category') . " where is_show=1 order by sort_order";
$all = $GLOBALS['db']->getAll($sql);
$ret1 = $ret = array();
foreach ($all as $key => $val) {
$val['url'] = build_uri('stores', array('cid' => $val['str_id']), $val['str_name']);
if ($val['is_groom'] > 0) {
$ret[$val['str_id']] = $val;
示例2: unset
$products_info .= ' ' . $goods_specifications[$value]['attr_name'] . ':' . $goods_specifications[$value]['attr_value'];
}
$smarty->assign('products_info', $products_info);
unset($goods_specifications, $good_products, $_good_products, $products_info);
}
} else {
show_message($_LANG['now_not_snatch']);
}
/* 调查 */
$vote = get_vote();
if (!empty($vote)) {
$smarty->assign('vote_id', $vote['id']);
$smarty->assign('vote', $vote['content']);
}
assign_template();
assign_dynamic('snatch');
$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('snatch_list', get_snatch_list());
//所有有效的夺宝奇兵列表
$smarty->assign('price_list', get_price_list($id));
$smarty->assign('promotion_info', get_promotion_info());
$smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? "feed-typesnatch.xml" : 'feed.php?type=snatch');
// RSS URL
$smarty->display('snatch.dwt');
exit;
}
示例3: index_get_links
$links = index_get_links();
$smarty->assign('img_links', $links['img']);
$smarty->assign('txt_links', $links['txt']);
$smarty->assign('data_dir', DATA_DIR);
// 数据目录
/* 首页推荐分类 */
$cat_recommend_res = $db->getAll("SELECT c.cat_id, c.cat_name, cr.recommend_type FROM " . $ecs->table("cat_recommend") . " AS cr INNER JOIN " . $ecs->table("category") . " AS c ON cr.cat_id=c.cat_id");
if (!empty($cat_recommend_res)) {
$cat_rec_array = array();
foreach ($cat_recommend_res as $cat_recommend_data) {
$cat_rec[$cat_recommend_data['recommend_type']][] = array('cat_id' => $cat_recommend_data['cat_id'], 'cat_name' => $cat_recommend_data['cat_name']);
}
$smarty->assign('cat_rec', $cat_rec);
}
/* 页面中的动态内容 */
assign_dynamic('index');
}
/*甜心100修改*/
$userid = $_SESSION['user_id'];
if (!empty($userid)) {
$affiliate = unserialize($GLOBALS['_CFG']['affiliate']);
$level_register_up = (double) $affiliate['config']['level_register_up'];
$rank_points = $GLOBALS['db']->getOne("SELECT rank_points FROM " . $GLOBALS['ecs']->table('users') . "where user_id=" . $_SESSION["user_id"]);
if ($rank_points > $level_register_up || $rank_points == $level_register_up) {
$url = $config['site_url'] . "mobile/index.php?u=" . $userid;
//20141204新增分享返积分
$dourl = $config['site_url'] . "mobile/re_url.php?user_id=" . $userid;
} else {
$url = "";
//20141204新增分享返积分
$dourl = "";
示例4: get_consignee_list
$consignee_list = get_consignee_list($_SESSION['user_id']);
$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);
示例5: assign_ur_here
}
/* 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');
}
}
$smarty->display('exchange_goods.dwt', $cache_id);
} elseif ($_REQUEST['act'] == 'buy') {
/* 查询:判断是否登录 */
if (!isset($back_act) && isset($GLOBALS['_SERVER']['HTTP_REFERER'])) {
$back_act = strpos($GLOBALS['_SERVER']['HTTP_REFERER'], 'exchange') ? $GLOBALS['_SERVER']['HTTP_REFERER'] : './index.php';
}
/* 查询:判断是否登录 */
if ($_SESSION['user_id'] <= 0) {
show_message($_LANG['eg_error_login'], array($_LANG['back_up_page']), array($back_act), 'error');
}
/* 查询:取得参数:商品id */
$goods_id = isset($_POST['goods_id']) ? intval($_POST['goods_id']) : 0;
if ($goods_id <= 0) {
示例6: define
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();
if (!empty($vote)) {
$smarty->assign('vote_id', $vote['id']);
$smarty->assign('vote', $vote['content']);
}
assign_dynamic('tag_cloud');
$tags = get_tags();
if (!empty($tags)) {
include_once ROOT_PATH . 'includes/lib_clips.php';
color_tag($tags);
}
$smarty->assign('tags', $tags);
$smarty->display('tag_cloud.dwt');
示例7: brand_recommend_goods
$smarty->assign('best_goods', brand_recommend_goods('best', $brand_id, $cate));
$smarty->assign('promotion_goods', brand_recommend_goods('promote', $brand_id, $cate));
$smarty->assign('brand', $brand_info);
$smarty->assign('promotion_info', get_promotion_info());
$count = goods_count_by_brand($brand_id, $cate);
$goodslist = brand_get_goods($brand_id, $cate, $size, $page, $sort, $order);
if ($display == 'grid') {
if (count($goodslist) % 2 != 0) {
$goodslist[] = array();
}
}
$smarty->assign('goods_list', $goodslist);
$smarty->assign('script_name', 'brand');
assign_pager('brand', $cate, $count, $size, $sort, $order, $page, '', $brand_id, 0, 0, $display);
// 分页
assign_dynamic('brand');
// 动态内容
}
$smarty->display('brand.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
* 获得指定品牌的详细信息.
*
* @param int $id
*/
function get_brand_info($id)
{
$sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('brand') . " WHERE brand_id = '{$id}'";
return $GLOBALS['db']->getRow($sql);
示例8: get_flash_xml
$smarty->assign('data_dir', DATA_DIR);
// 数据目录
/*jdy add 0816 添加首页幻灯插件*/
$smarty->assign("flash", get_flash_xml());
$smarty->assign('flash_count', count(get_flash_xml()));
/* 首页推荐分类 */
$cat_recommend_res = $db->getAll("SELECT c.cat_id, c.cat_name, cr.recommend_type FROM " . $ecs->table("cat_recommend") . " AS cr INNER JOIN " . $ecs->table("category") . " AS c ON cr.cat_id=c.cat_id");
if (!empty($cat_recommend_res)) {
$cat_rec_array = array();
foreach ($cat_recommend_res as $cat_recommend_data) {
$cat_rec[$cat_recommend_data['recommend_type']][] = array('cat_id' => $cat_recommend_data['cat_id'], 'cat_name' => $cat_recommend_data['cat_name']);
}
$smarty->assign('cat_rec', $cat_rec);
}
/* 页面中的动态内容 */
assign_dynamic($tpl);
}
$smarty->display($tpl . '.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTIONS
/*------------------------------------------------------ */
/**
* 调用发货单查询
*
* @access private
* @return array
*/
function index_get_invoice_query()
{
$sql = 'SELECT o.order_sn, o.invoice_no, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' . ' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping') . ' AS s ON s.shipping_id = o.shipping_id' . " WHERE invoice_no > '' AND shipping_status = " . SS_SHIPPED . ' ORDER BY shipping_time DESC LIMIT 10';
$all = $GLOBALS['db']->getAll($sql);
示例9: get_top10
$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 ";
$record_count = $db->getOne($sql);
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('feedback') . " WHERE `msg_area`='1' AND `msg_status` = '1' ";
$record_count += $db->getOne($sql);
/* 获取留言的数量 */
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$pagesize = get_library_number('message_list', 'message_board');
$pager = get_pager('message.php', array(), $record_count, $page, $pagesize);
$msg_lists = get_msg_list($pagesize, $pager['start']);
assign_dynamic('message_board');
$smarty->assign('rand', mt_rand());
$smarty->assign('msg_lists', $msg_lists);
$smarty->assign('pager', $pager);
$smarty->display('message_board.dwt');
}
/**
* 获取留言的详细信息
*
* @param integer $num
* @param integer $start
*
* @return array
*/
function get_msg_list($num, $start)
{
示例10: elseif
$order = $db->getRow($sql);
if (empty($order)) {
$msg = $_LANG['order_not_exists'];
} elseif ($order['shipping_status'] == SS_RECEIVED) {
$msg = $_LANG['order_already_received'];
} elseif ($order['shipping_status'] != SS_SHIPPED) {
$msg = $_LANG['order_invalid'];
} elseif ($order['consignee'] != $consignee) {
$msg = $_LANG['order_invalid'];
} else {
/* 修改订单发货状态为“确认收货” */
$sql = "UPDATE " . $ecs->table('order_info') . " SET shipping_status = '" . SS_RECEIVED . "' WHERE order_id = '{$order_id}'";
$db->query($sql);
/* 记录日志 */
order_action($order['order_sn'], $order['order_status'], SS_RECEIVED, $order['pay_status'], '', $_LANG['buyer']);
$msg = $_LANG['act_ok'];
}
/* 显示模板 */
assign_template();
$position = assign_ur_here();
$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('receive');
$smarty->assign('msg', $msg);
$smarty->display('receive.dwt');
示例11: isset
}
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'insert_dianpu') {
$GLOBALS['db']->query("DELETE FROM " . $GLOBALS['ecs']->table('dianpu') . " WHERE user_id = '" . $_SESSION['user_id'] . "'");
$dianpu_name = isset($_POST['dianpu_name']) ? $_POST['dianpu_name'] : '';
$phone = isset($_POST['phone']) ? $_POST['phone'] : '';
$sql = "INSERT INTO " . $GLOBALS['ecs']->table('dianpu') . "(`dianpu_name`,`phone`,`user_id`) values('{$dianpu_name}','{$phone}','" . $_SESSION['user_id'] . "')";
$num = $GLOBALS['db']->query($sql);
if ($num > 0) {
show_message('店铺设置成功!', '返回分销中心', 'v_user.php');
} else {
ecs_header("Location: v_user_dianpu.php\n");
exit;
}
}
if (!$smarty->is_cached('v_user_dianpu.dwt', $cache_id)) {
assign_template();
$position = assign_ur_here();
$smarty->assign('page_title', $position['title']);
// 页面标题
$smarty->assign('ur_here', $position['ur_here']);
// 当前位置
/* meta information */
$smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords']));
$smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
$smarty->assign('user_info', get_user_info_by_user_id($_SESSION['user_id']));
$smarty->assign('dianpu', get_dianpu_by_user_id($_SESSION['user_id']));
$smarty->assign('user_id', $_SESSION['user_id']);
/* 页面中的动态内容 */
assign_dynamic('v_user_dianpu');
}
$smarty->display('v_user_dianpu.dwt', $cache_id);
示例12: define
* $Author: liubo $
* $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']);
示例13: assign_template
$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');
}
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
*
*
* @access public
* @param
*
* @return void
*/
function is_not_null($value)
{
示例14: assign_template_supplier
// 当前位置
$smarty->assign('comment_type', 1);
assign_template_supplier();
/* 上一篇下一篇文章 */
$next_article = $db->getRow("SELECT article_id, title FROM " . $ecs->table('supplier_article') . " WHERE article_id > {$article_id} AND cat_id={$article['cat_id']} AND is_open=1 AND supplier_id=" . $_GET['suppId'] . " LIMIT 1");
if (!empty($next_article)) {
$next_article['url'] = build_uri('supplier', array('go' => 'article', 'suppid' => $_GET['suppId'], 'aid' => $next_article['supplier_article']), $next_article['title']);
$smarty->assign('next_article', $next_article);
}
$prev_aid = $db->getOne("SELECT max(article_id) FROM " . $ecs->table('supplier_article') . " WHERE article_id < {$article_id} AND cat_id={$article['cat_id']} AND is_open=1 AND supplier_id=" . $_GET['suppId']);
if (!empty($prev_aid)) {
$prev_article = $db->getRow("SELECT article_id, title FROM " . $ecs->table('supplier_article') . " WHERE article_id = {$prev_aid}");
$prev_article['url'] = build_uri('supplier', array('go' => 'article', 'suppid' => $_GET['suppId'], 'aid' => $prev_article['article_id']), $prev_article['title']);
$smarty->assign('prev_article', $prev_article);
}
assign_dynamic('article_pro');
}
//if(isset($article) && $article['cat_id'] > 2)
//{
// $smarty->display('article.dwt', $cache_id);
//}
//else
//{
$smarty->display('article_pro.dwt', $cache_id);
//}
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
* 获得指定的文章的详细信息
*
示例15: array_search
$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');