/** * 夺宝奇兵详情 */ public function info() { $goods = model('Snatch')->get_snatch($this->id); if ($goods) { if ($goods['is_end']) { //如果活动已经结束,获取活动结果 $this->assign('result', model('ActivityBase')->get_snatch_result($this->id)); } $this->assign('id', $this->id); $this->assign('snatch_goods', $goods); // 竞价商品 $this->assign('pictures', model('GoodsBase')->get_goods_gallery($goods['goods_id'])); $this->assign('myprice', model('Snatch')->get_myprice($this->id)); if ($goods['product_id'] > 0) { $goods_specifications = model('goodsBase')->get_specifications_list($goods['goods_id']); $good_products = model('ProductsBase')->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) { $products_info .= ' ' . $goods_specifications[$value]['attr_name'] . ':' . $goods_specifications[$value]['attr_value']; } $this->assign('products_info', $products_info); unset($goods_specifications, $good_products, $_good_products, $products_info); } } else { show_message(L('now_not_snatch')); } /* 调查 */ $vote = get_vote(); if (!empty($vote)) { $this->assign('vote_id', $vote['id']); $this->assign('vote', $vote['content']); } $this->assign('price_list', model('Snatch')->get_price_list($this->id)); $this->assign('promotion_info', model('GoodsBase')->get_promotion_info()); $this->assign('feed_url', C('rewrite') == 1 ? "feed-typesnatch.xml" : 'feed.php?type=snatch'); // RSS URL $this->display('snatch.dwt'); }
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) { $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));
/** * 调用在线调查信息 * * @access public * @return string */ function insert_vote() { $vote = get_vote(); if (!empty($vote)) { $GLOBALS['smarty']->assign('vote_id', $vote['id']); $GLOBALS['smarty']->assign('vote', $vote['content']); } $val = $GLOBALS['smarty']->fetch('library/vote.lbi'); return $val; }
require ROOT_PATH . 'includes/cls_json.php'; if (!isset($_REQUEST['vote']) || !isset($_REQUEST['options']) || !isset($_REQUEST['type'])) { ecs_header("Location: ./\n"); exit; } $res = array('error' => 0, 'message' => '', 'content' => ''); $vote_id = intval($_POST['vote']); $options = trim($_POST['options']); $type = intval($_POST['type']); $ip_address = real_ip(); if (vote_already_submited($vote_id, $ip_address)) { $res['error'] = 1; $res['message'] = $_LANG['vote_ip_same']; } else { save_vote($vote_id, $ip_address, $options); $vote = get_vote($vote_id); if (!empty($vote)) { $smarty->assign('vote_id', $vote['id']); $smarty->assign('vote', $vote['content']); } $str = $smarty->fetch("library/vote.lbi"); $pattern = '/(?:<(\\w+)[^>]*> .*?)?<div\\s+id="ECS_VOTE">(.*)<\\/div>(?:.*?<\\/\\1>)?/is'; if (preg_match($pattern, $str, $match)) { $res['content'] = $match[2]; } $res['message'] = $_LANG['vote_success']; } $json = new JSON(); echo $json->encode($res); /*------------------------------------------------------ */ //-- PRIVATE FUNCTION
/** * 调用在线调查信息 * * @access public * @return string */ function insert_vote() { $vote = get_vote(); if (!empty($vote)) { ECTouch::view()->assign('vote_id', $vote['id']); ECTouch::view()->assign('vote', $vote['content']); } $val = ECTouch::view()->fetch('library/vote.lbi'); return $val; }
if (get_the_excerpt()) { ?> <div class="description-single"> <strong>Điểm nổi bật:</strong><br> <?php echo the_excerpt_max_charlength(40); ?> </div> <?php } ?> <?php //if($category[0]->slug == 'am-thuc-tiec'): $result = get_vote(get_the_ID()); if ($result) { ?> <div class="share-voted share-voted-comment"> <ul> <li> <div id="view-quality" class="number-voted"><?php echo $result['quality']; ?> </div> <div class="content-voted">Chất lượng</div> </li> <li> <div id="view-price" class="number-voted"><?php echo $result['price']; ?>