コード例 #1
0
 public function index()
 {
     /*$ZhixiaCityTwoList=M('common_district')->where(array('level'=>2,'upid in (1,2,9,22)'))->select();
       foreach($ZhixiaCityTwoList as $k=>$v){
           $CIDList[]=$v['id'];
       }
       $CityThreeList=M('common_district')->where(array('level'=>3,'upid not in ('.implode(',',$CIDList).')'))->select();
       set_time_limit(0);
       foreach($CityThreeList as $k=>$v){
           //$name=str_replace(array('区','县'),'',$v['name']);
           $name=$v['name'];
           $KeyInfo=M('common_district')->where(array('`id` = '.$v['upid'].''))->find();
           $keyname=str_replace(array('区','县','省','市'),'',$KeyInfo['name']);
           $Url='http://localhost/'.U('Mongo/Index/Index').'&name='.urlencode($name).'&keyname='.urlencode($keyname);
           //echo file_get_contents($Url,);die;
           //header('Location:'.$Url);die;
           if(function_exists('file_get_contents')){
               $content=file_get_contents($Url);
           }else if(function_exists('curl_init')){
               $ch = curl_init();
               $timeout = 5;
               curl_setopt($ch, CURLOPT_URL, $Url);
               curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
               curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
               $content=curl_exec($ch);
               curl_close($ch);
           }else{
               $this->get_admin_msg($_SERVER['HTTP_REFERER'],"请开启CURL模块或者file_get_contents函数");
           }
           //echo $content;die;
       }die;*/
     $categories_tree = $this->get_categories_tree();
     $this->assign('categories', $categories_tree);
     // 分类树
     $navigator_list = $this->get_navigator($ctype, $catlist);
     $this->assign('navigator_list', $navigator_list);
     $category_list = $this->cat_list(0, 0, true, 2, false);
     $this->assign('category_list', $category_list);
     $promotion_info = get_promotion_info();
     $this->assign('promotion_info', $promotion_info);
     $this->assign('shop_notice', C('shop_notice'));
     $new_articles = index_get_new_articles();
     $this->assign('new_articles', $new_articles);
     // 最新文章
     $brand_list = get_brands();
     $this->assign('brand_list', $brand_list);
     $this->display();
 }
コード例 #2
0
        $promote_goods[$key]['shop_price'] = encode_output($promote_data['shop_price']);
        $promote_goods[$key]['name'] = encode_output($promote_data['name']);
        /*if ($i > 2)
          {
              break;
          }*/
        $i++;
    }
    $smarty->assign('promote_goods', $promote_goods);
}
$pcat_array = get_categories_tree();
foreach ($pcat_array as $key => $pcat_data) {
    $pcat_array[$key]['name'] = encode_output($pcat_data['name']);
}
$smarty->assign('pcat_array', $pcat_array);
$brands_array = get_brands();
if (!empty($brands_array)) {
    foreach ($brands_array as $key => $brands_data) {
        $brands_array[$key]['brand_name'] = encode_output($brands_data['brand_name']);
    }
    $smarty->assign('brand_array', $brands_array);
}
$article_array = $db->GetALLCached("SELECT article_id, title FROM " . $ecs->table("article") . " WHERE cat_id != 0 AND is_open = 1 AND open_type = 0 ORDER BY article_id DESC LIMIT 0,4");
if (!empty($article_array)) {
    foreach ($article_array as $key => $article_data) {
        $article_array[$key]['title'] = encode_output($article_data['title']);
    }
    $smarty->assign('article_array', $article_array);
}
if ($_SESSION['user_id'] > 0) {
    $smarty->assign('user_name', $_SESSION['user_name']);
コード例 #3
0
 // RSS URL
 $smarty->assign('categories', get_categories_tree());
 // 分类树
 $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'));
 // 热点文章
 $smarty->assign('promotion_goods', get_promote_goods());
 // 特价商品
 $smarty->assign('brand_list', get_brands());
 $smarty->assign('promotion_info', get_promotion_info());
 // 增加一个动态显示所有促销信息的标签栏
 $smarty->assign('invoice_list', index_get_invoice_query());
 // 发货查询
 $smarty->assign('new_articles', index_get_new_articles());
 // 最新文章
 $smarty->assign('group_buy_goods', index_get_group_buy());
 // 团购商品
 $smarty->assign('auction_list', index_get_auction());
 // 拍卖活动
 $smarty->assign('shop_notice', $_CFG['shop_notice']);
 // 商店公告
 /* 首页主广告设置 */
 $smarty->assign('index_ad', $_CFG['index_ad']);
 if ($_CFG['index_ad'] == 'cus') {
コード例 #4
0
ファイル: category.php プロジェクト: seanguo166/yinoos
 $smarty->assign('show_marketprice', $_CFG['show_marketprice']);
 $smarty->assign('category', $cat_id);
 $smarty->assign('brand_id', $brand);
 $smarty->assign('price_max', $price_max);
 $smarty->assign('price_min', $price_min);
 $smarty->assign('filterid', $filter);
 $smarty->assign('filter_attr', $filter_attr_str);
 $smarty->assign('filter_attr_value', $filter_attr_str);
 $smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? "feed-c{$cat_id}.xml" : 'feed.php?cat=' . $cat_id);
 // RSS URL
 if ($brand > 0) {
     $arr['all'] = array('brand_id' => 0, 'brand_name' => $GLOBALS['_LANG']['all_goods'], 'brand_logo' => '', 'goods_num' => '', 'url' => build_uri('category', array('cid' => $cat_id), $cat['cat_name']));
 } else {
     $arr = array();
 }
 $brand_list = array_merge($arr, get_brands($cat_id, 'category'));
 $smarty->assign('data_dir', DATA_DIR);
 $smarty->assign('brand_list', $brand_list);
 $smarty->assign('promotion_info', get_promotion_info('', 0));
 /* 调查 */
 $vote = get_vote();
 if (!empty($vote)) {
     $smarty->assign('vote_id', $vote['id']);
     $smarty->assign('vote', $vote['content']);
 }
 $smarty->assign('best_goods', get_category_recommend_goods('best', $children, $brand, $price_min, $price_max, $ext));
 $smarty->assign('promotion_goods', get_category_recommend_goods('promote', $children, $brand, $price_min, $price_max, $ext));
 $smarty->assign('hot_goods', get_category_recommend_goods('hot', $children, $brand, $price_min, $price_max, $ext));
 $smarty->assign('new_goods', get_category_recommend_goods('new', $children, $brand, $price_min, $price_max, $ext));
 $count = get_cagtegory_goods_count($children, $brand, $price_min, $price_max, $ext);
 $max_page = $count > 0 ? ceil($count / $size) : 1;
コード例 #5
0
post_class();
?>
>
	<?php 
/**
 * woocommerce_before_single_product_summary hook
 *
 * @hooked woocommerce_show_product_sale_flash - 10
 * @hooked woocommerce_show_product_images - 20
 */
do_action('woocommerce_before_single_product_summary');
?>

	<div class="summary entry-summary">
		<h2 class="brand"><?php 
echo get_brands($post->ID, ' ');
?>
</h2>
		<?php 
/**
 * woocommerce_single_product_summary hook
 *
 * @hooked woocommerce_template_single_title - 5
 * @hooked woocommerce_template_single_rating - 10
 * @hooked woocommerce_template_single_price - 10
 * @hooked woocommerce_template_single_excerpt - 20
 * @hooked woocommerce_template_single_add_to_cart - 30
 * @hooked woocommerce_template_single_meta - 40
 * @hooked woocommerce_template_single_sharing - 50
 */
do_action('woocommerce_single_product_summary');
コード例 #6
0
ファイル: category.php プロジェクト: shaoslu/jumei
 $smarty->assign('category', $cat_id);
 $smarty->assign('brand_id', $brand);
 $smarty->assign('price_max', $price_max);
 $smarty->assign('price_min', $price_min);
 $smarty->assign('filter_attr', $filter_attr_str);
 $smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? "feed-c{$cat_id}.xml" : 'feed.php?cat=' . $cat_id);
 // RSS URL
 if ($brand > 0) {
     $arr['all'] = array('brand_id' => 0, 'brand_name' => $GLOBALS['_LANG']['all_goods'], 'brand_logo' => '', 'goods_num' => '', 'url' => build_uri('category', array('cid' => $cat_id), $cat['cat_name']));
 } else {
     $arr = array();
 }
 $brand_list = array_merge($arr, get_brands($cat_id, 'category'));
 $smarty->assign('data_dir', DATA_DIR);
 $smarty->assign('brand_list', $brand_list);
 $brand_list = array_merge($arr, get_brands($cat_id, 'brand', $dwt_name));
 $smarty->assign('brand_list_top', $brand_list);
 $smarty->assign('promotion_info', get_promotion_info());
 /* 调查 */
 $vote = get_vote();
 if (!empty($vote)) {
     $smarty->assign('vote_id', $vote['id']);
     $smarty->assign('vote', $vote['content']);
 }
 $smarty->assign('best_goods', get_category_recommend_goods('best', $children, $brand, $price_min, $price_max, $ext));
 $smarty->assign('promotion_goods', get_category_recommend_goods('promote', $children, $brand, $price_min, $price_max, $ext));
 $smarty->assign('hot_goods', get_category_recommend_goods('hot', $children, $brand, $price_min, $price_max, $ext));
 $count = get_cagtegory_goods_count($children, $brand, $price_min, $price_max, $ext);
 $max_page = $count > 0 ? ceil($count / $size) : 1;
 if ($page > $max_page) {
     $page = $max_page;
コード例 #7
0
ファイル: category.php プロジェクト: mrj0909/sf
    </style> 
<?php 
}
$per_page = $this->input->get("per_page");
$get_min_price = 0;
$get_min_price = $this->input->get("min_price");
$get_max_price = 0;
$get_max_price = $this->input->get("max_price");
$get_brand = '';
$get_brand = $this->input->get("brand");
if ($get_brand != '') {
    $selected_brands = explode(".", $get_brand);
} else {
    $selected_brands = array();
}
$brands = get_brands($cat_id);
$price_ranges = array();
$price_ranges = get_price_range_filters($cat_id);
if (isset($category_name)) {
    $cat_name = end(explode(">", $category_name));
}
?>
    <?php 
if ($cat_id != '') {
    ?>
  
      <div class="category_header">
     
      <h4> &nbsp;<b><?php 
    echo getcategroyname($cat_id);
    ?>
コード例 #8
0
ファイル: brand.php プロジェクト: blowfishJ/galaxyCode
 *
 *  HQ China:
 *    2319 Est.Tower Van Palace 
 *    No.2 Guandongdian South Street 
 *    Beijing , China
 *
 *  U.S. Office:
 *    One Park Place, Elmira College, NY, 14901, USA
 *
 *  QQ Group:   329673575
 *  BBS:        bbs.ecmobile.cn
 *  Fax:        +86-10-6561-5510
 *  Mail:       info@geek-zoo.com
 */
require EC_PATH . '/includes/init.php';
// define('DEBUG_MODE', 1);
// define('INIT_NO_SMARTY', true);
// $smarty = new GZ_Smarty('search');
$data = array();
$cat_id = _POST('category_id', 0);
if (!empty($cat_id)) {
    $children = get_children($cat_id);
    $sql = "SELECT b.brand_id, b.brand_name, b.brand_logo, COUNT(*) AS goods_num " . "FROM " . $GLOBALS['ecs']->table('brand') . "AS b, " . $GLOBALS['ecs']->table('goods') . " AS g LEFT JOIN " . $GLOBALS['ecs']->table('goods_cat') . " AS gc ON g.goods_id = gc.goods_id " . "WHERE g.brand_id = b.brand_id AND ({$children} OR " . 'gc.cat_id ' . db_create_in(array_unique(array_merge(array($cat_id), array_keys(cat_list($cat_id, 0, false))))) . ") AND b.is_show = 1 " . " AND g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 " . "GROUP BY b.brand_id HAVING goods_num > 0 ORDER BY b.sort_order, b.brand_id ASC";
    $brand_list = $GLOBALS['db']->getAll($sql);
} else {
    $brand_list = get_brands();
}
foreach ($brand_list as $key => $val) {
    $data[] = array('url' => $val['brand_logo'], 'brand_name' => $val['brand_name'], 'brand_id' => $val['brand_id']);
}
GZ_Api::outPut($data);
コード例 #9
0
							 <?php 
            $this->assign('cate2', get_adv('菜单_分类图片2', $this->_var['cat'][id]));
            ?>
							 <?php 
            echo $this->_var['cate2'];
            ?>
							</li>              
					  </ul> 
					  </dd> 
					 </dl>
					<dl class="categorys-brands">               
				 <dt>推荐品牌出版商</dt>          
				   <dd>              
				     <ul>                   
					   <?php 
            $this->assign('brand_nav', get_brands($GLOBALS['smarty']->_var['cat']['id']));
            ?>
                    <?php 
            $_from = $this->_var['brand_nav'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $this->push_vars('', 'brandnav');
            $this->_foreach['brand_foreach'] = array('total' => count($_from), 'iteration' => 0);
            if ($this->_foreach['brand_foreach']['total'] > 0) {
                foreach ($_from as $this->_var['brandnav']) {
                    $this->_foreach['brand_foreach']['iteration']++;
                    ?>
                    <?php 
                    if ($this->_foreach['brand_foreach']['iteration'] - 1 < 15) {
                        ?>
コード例 #10
0
    }
}
$args_category_material = array('taxonomy' => 'pa_material', 'hide_empty' => 1);
$categories_parent_material = get_categories($args_category_material);
$args_category_brand = array('taxonomy' => 'pa_brand', 'hide_empty' => 1);
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
/*
* Filtros.
*/
$filtros = array();
$filtros["category"] = get_query_var('category');
$filtros["material"] = get_query_var('material');
$filtros["brand"] = get_query_var('brand');
$taxonomy_product_cat = !empty($filtros["category"]) ? $filtros["category"] : $product_cat;
// get_categories($args_category_brand)
$categories_parent_brand = get_brands($taxonomy_product_cat);
$hide_out_of_stock_item = get_option("woocommerce_hide_out_of_stock_items") == "no" ? FALSE : TRUE;
if ($hide_out_of_stock_item) {
    $availability = array('instock');
} else {
    $availability = array('outofstock');
}
$order_by = get_field("order_by");
$order_by_parameters = array();
if ($order_by) {
    if ($order_by != "default") {
        if ($order_by == "_price") {
            $order_by_parameters["orderby"] = "meta_value_num";
            $order_by_parameters["meta_key"] = "_price";
            $order = get_field("order");
            if ($order) {
コード例 #11
0
 /**
  * show_brand function.
  *
  * @access public
  * @return void
  */
 function show_brand()
 {
     global $post;
     if (is_singular('product')) {
         echo get_brands($post->ID, ', ', ' <span class="posted_in">' . __('Brand:', 'wc_brands') . ' ', '.</span>');
     }
 }
コード例 #12
0
ファイル: template-homepage.php プロジェクト: hyzershop/site
					<div class="featured-disc-inner">
						<?php 
$fd_params = array('posts_per_page' => 1, 'product_cat' => 'featured-disc', 'post_type' => 'product');
$wc_query = new WP_Query($fd_params);
if ($wc_query->have_posts()) {
    while ($wc_query->have_posts()) {
        $wc_query->the_post();
        $post_id = get_the_ID();
        $twitter_header = get_post_meta($post_id, 'twitter_header', true) ?: get_brands($post_id);
        ?>
						<p class="featured-disc-pre">This month's disc</p>
						<h2><a href="<?php 
        the_permalink();
        ?>
"><?php 
        echo get_brands($post_id);
        ?>
 <?php 
        the_title();
        ?>
</a></h2>
						<?php 
        the_excerpt();
        ?>
						<a href="<?php 
        the_permalink();
        ?>
"><button>Learn more</button></a>
					</div>
				</div>
				<div class="featured-disc-image">