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('flash_theme', $_CFG['flash_theme']); // Flash轮播图片模板 $smarty->assign('feed_url', ($_CFG['rewrite'] == 1) ? 'feed.xml' : 'feed.php'); // RSS URL $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $sql = "SELECT b.brand_id, b.brand_name, COUNT(*) AS goods_num, b.format, b.brand_size ". "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 (g.cat_id IN ('21','33','30','40','37') or gc.cat_id IN ('21','33','30','40','37'))"." 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"; //echo $sql; $brands = $GLOBALS['db']->getAll($sql); foreach ($brands AS $key => $val) { //$temp_key = $key + 1; $brands[$key]['brand_name'] = $val['brand_name']; $brands[$key]['url'] = "http://".$_SERVER['HTTP_HOST']."/make_list.php?bid=".$val['brand_id']; /* 判断品牌是否被选中 */ if ($brand == $brands[$key]['brand_id']) { $brands[$temp_key]['selected'] = 1; } else { $brands[$temp_key]['selected'] = 0; } } /*$brands[0]['brand_name'] = $_LANG['all_attribute']; $brands[0]['url'] = build_uri('category', array('cid' => $cat_id, 'bid' => 0, 'price_min'=>$price_min, 'price_max'=> $price_max, 'filter_attr'=>$filter_attr_str), $cat['cat_name']); $brands[0]['selected'] = empty($brand) ? 1 : 0;*/ //print_r($brands); $smarty->assign('brands', $brands); $smarty->display('make.dwt'); ?>