当前位置:首页 > CMS教程 > ecshop > 列表

ecshop 代码解读

发布:smiling 来源: PHP粉丝网  添加日期:2015-09-28 15:47:20 浏览: 评论:0 
  1. $smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords'])); //关键信息 
  2. $smarty->assign('description', htmlspecialchars($_CFG['shop_desc'])); ////关键信息 
  3. $smarty->assign('flash_theme', $_CFG['flash_theme']); // Flash轮播图片模板 
  4.  
  5. $smarty->assign('feed_url', ($_CFG['rewrite'] == 1) ? 'feed.xml' : 'feed.php'); // RSS URL 
  6.  
  7. $smarty->assign('categories', get_categories_tree()); // 分类树 
  8. $smarty->assign('helps', get_shop_help()); // 网店帮助 
  9. $smarty->assign('top_goods', get_top10()); // 销售排行 
  10.  
  11. $smarty->assign('best_goods',ecshop, get_recommend_goods('best')); // 推荐商品 
  12. $smarty->assign('new_goods', get_recommend_goods('new')); // 最新商品 
  13. $smarty->assign('hot_goods', get_recommend_goods('hot')); // 热点文章 
  14. $smarty->assign('promotion_goods', get_promote_goods()); // 特价商品 
  15. $smarty->assign('brand_list', get_brands()); 
  16. $smarty->assign('promotion_info', get_promotion_info()); // 增加一个动态显示所有促销信息的标签栏 
  17.  
  18. $smarty->assign('invoice_list', index_get_invoice_query()); // 发货查询 
  19. $smarty->assign('new_articles', index_get_new_articles()); // 最新文章 
  20. $smarty->assign('group_buy_goods', index_get_group_buy()); // 团购商品 
  21. $smarty->assign('auction_list', index_get_auction()); // 拍卖活动 
  22. $smarty->assign('shop_notice', $_CFG['shop_notice']); // 商店公告 
  23. --phpfensi.com 
  24.  
  25. $smarty->assign('index_ad', $_CFG['index_ad']); 
  26. if ($_CFG['index_ad'] == 'cus'
  27. $sql = 'SELECT ad_type, content, url FROM ' . $ecs->table("ad_custom") . ' WHERE ad_status = 1'
  28. $ad = $db->getRow($sql, true); 
  29. $smarty->assign('ad', $ad); 
  30.  
  31.  
  32. $links = index_get_links(); 
  33. $smarty->assign('img_links', $links['img']); 
  34. $smarty->assign('txt_links', $links['txt']); 
  35. $smarty->assign('data_dir', DATA_DIR); // 数据目录 
  36.  
  37.  
  38. $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"); 
  39. if (!empty($cat_recommend_res)) 
  40. $cat_rec_array = array(); 
  41. foreach($cat_recommend_res as $cat_recommend_data) 
  42. $cat_rec[$cat_recommend_data['recommend_type']][] = array('cat_id' => $cat_recommend_data['cat_id'], 'cat_name' => $cat_recommend_data['cat_name']); 
  43. $smarty->assign('cat_rec', $cat_rec); 
  44.  
  45.  
  46. assign_dynamic('index'); 
  47.  
  48. $smarty->display('index.dwt', $cache_id); 
  49.  
  50. /*----------------------------------------------------

Tags: ecshop代码解释 ecshop代码解读

分享到: