//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());   // 最新文章
 /* links */
 $smarty->assign('data_dir', DATA_DIR);
 // 数据目录
 $smarty->assign('suppinfo', $suppinfo);
 /* 首页推荐分类 */
 $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);
Example #2
0
 //分解首页三类商品的显示数量
 $index_goods_num[0] = 10;
 $index_goods_num[1] = 10;
 $index_goods_num[2] = 10;
 if (!empty($GLOBALS['_CFG']['shop_index_num'])) {
     $index_goods_info = explode("\r\n", $GLOBALS['_CFG']['shop_index_num']);
     if (is_array($index_goods_info) && count($index_goods_info) >= 3) {
         $index_goods_num = $index_goods_info;
     }
 }
 //1,2,3对应店铺商品分类中的精品,最新,热门
 $smarty->assign('best_goods', get_supplier_goods(1, $index_goods_num[0]));
 // 精品商品
 $smarty->assign('new_goods', get_supplier_goods(2, $index_goods_num[1]));
 // 最新商品
 $smarty->assign('hot_goods', get_supplier_goods(3, $index_goods_num[2]));
 // 热门商品
 $smarty->assign('category_goods', get_supplier_category_info());
 // 首页推荐分类商品
 //$smarty->assign('new_articles',    index_get_new_articles());   // 最新文章
 /* links */
 $smarty->assign('data_dir', DATA_DIR);
 // 数据目录
 $smarty->assign('suppinfo', $suppinfo);
 /* 首页推荐分类 */
 $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']);
     }