Changeset 16147 for branches/feature-module-update/html
- Timestamp:
- 2007/09/28 13:08:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/html/mobile/frontparts/bloc/category.php
r15532 r16147 1 1 <?php 2 2 /** 3 * 3 * 4 4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 5 5 * 6 6 * http://www.lockon.co.jp/ 7 * 8 * モバイルサイト/メインカテゴリー 7 * 8 * 9 * モバイルサイト/カテゴリ 9 10 */ 10 11 11 class LC_CatPage { 12 function LC_CatPage() { 13 /** 必ず変更する **/ 14 $this->tpl_mainpage = 'frontparts/bloc/category.tpl'; // メインテンプレート 15 } 16 } 12 // {{{ requires 13 require_once("../require.php"); 14 require_once(CLASS_PATH . "page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Category_Ex.php"); 17 15 18 $objSubPage = new LC_CatPage(); 19 $objSubView = new SC_MobileView(); 16 // }}} 17 // {{{ generate page 20 18 21 $objSubPage = lfGetMainCat(true, $objSubPage); 22 23 $objSubView->assignobj($objSubPage); 24 $objSubView->display($objSubPage->tpl_mainpage); 25 26 //----------------------------------------------------------------------------------------------------------------------------------- 27 28 // メインカテゴリーの取得 29 function lfGetMainCat($count_check = false, $objSubPage) { 30 $objQuery = new SC_Query(); 31 $col = "*"; 32 $from = "dtb_category left join dtb_category_total_count using (category_id)"; 33 // メインカテゴリーとその直下のカテゴリーを取得する。 34 $where = 'level <= 2 AND del_flg = 0'; 35 // 登録商品数のチェック 36 if($count_check) { 37 $where .= " AND product_count > 0"; 38 } 39 $objQuery->setoption("ORDER BY rank DESC"); 40 $arrRet = $objQuery->select($col, $from, $where); 41 42 // メインカテゴリーを抽出する。 43 $arrMainCat = array(); 44 foreach ($arrRet as $cat) { 45 if ($cat['level'] != 1) { 46 continue; 47 } 48 49 // 子カテゴリーを持つかどうかを調べる。 50 $arrChildrenID = sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $cat['category_id']); 51 $cat['has_children'] = count($arrChildrenID) > 0; 52 $arrMainCat[] = $cat; 53 } 54 55 $objSubPage->arrCat = $arrMainCat; 56 return $objSubPage; 57 } 19 $objPage = new LC_Page_FrontParts_Bloc_Category_Ex(); 20 $objPage->mobileInit(); 21 $objPage->mobileProcess(); 22 register_shutdown_function(array($objPage, "destroy")); 58 23 ?>
Note: See TracChangeset
for help on using the changeset viewer.