Changeset 17558 for branches/comu-ver2/data/class/pages/LC_Page_Sitemap.php
- Timestamp:
- 2008/08/26 17:02:14 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/LC_Page_Sitemap.php
r16582 r17558 78 78 function init() { 79 79 parent::init(); 80 $this->staticURL = array(SITE_URL, MOBILE_SITE_URL, SITE_URL . "rss/index.php"); 80 81 $this->staticURL[] = SITE_URL; 82 $this->staticURL[] = SITE_URL . 'rss/index.php'; 83 if (USE_MOBILE !== false) { 84 $this->staticURL[] = MOBILE_SITE_URL; 85 } 81 86 } 82 87 … … 128 133 $this->createSitemap($product['url'], '', 'daily'); 129 134 } 130 $mobileProducts = $this->getAllProducts(true);131 foreach($mobileProducts as $mobileProduct) {132 $this->createSitemap($mobileProduct['url'], '', 'daily');133 }134 135 135 136 // 商品詳細ページを処理 … … 138 139 $this->createSitemap($detail['url'], 139 140 $this->date2W3CDatetime($detail['update_date'])); 140 }141 $mobileDetails = $this->getAllDetail(true);142 foreach($mobileDetails as $mobileDetail) {143 $this->createSitemap($mobileDetail['url'],144 $this->date2W3CDatetime($mobileDetail['update_date']));145 141 } 146 142 … … 222 218 * すべての商品一覧ページを取得する. 223 219 * 224 * @param boolean $isMobile モバイルページを取得する場合 true225 220 * @return array 検索エンジンからアクセス可能な商品一覧ページの情報 226 221 */ 227 function getAllProducts($isMobile = false) { 222 function getAllProducts() { 223 224 // XXX: 商品登録の無いカテゴリーは除外する方が良い気もする 228 225 $conn = new SC_DBConn(); 229 226 $sql = "SELECT category_id FROM dtb_category WHERE del_flg = 0"; 230 227 $result = $conn->getAll($sql); 231 228 232 $mobile = "";233 if ($isMobile) {234 $mobile = "mobile/";235 }236 237 229 $arrRet = array(); 238 for ($i = 0; $i < count($result); $i++) {230 foreach ($result as $row) { 239 231 // :TODO: カテゴリの最終更新日を取得できるようにする 240 $page = array("url" => SITE_URL . sprintf("%sproducts/list.php?category_id=%d", $mobile, $result[$i]['category_id'])); 241 $arrRet[$i] = $page; 232 233 $page["url"] = SITE_URL . 'products/list.php?category_id=' . $row['category_id']; 234 $arrRet[] = $page; 235 236 // モバイルサイト 237 if (USE_MOBILE !== false) { 238 $page["url"] = MOBILE_SITE_URL . 'products/list.php?category_id=' . $row['category_id']; 239 $arrRet[] = $page; 240 } 242 241 } 243 242 return $arrRet; … … 247 246 * すべての商品詳細ページを取得する. 248 247 * 249 * @param boolean $isMobile モバイルページを取得する場合 true250 248 * @return array 検索エンジンからアクセス可能な商品詳細ページの情報 251 249 */ 252 function getAllDetail( $isMobile = false) {250 function getAllDetail() { 253 251 $conn = new SC_DBConn(); 254 252 $sql = "SELECT product_id, update_date FROM dtb_products WHERE del_flg = 0 AND status = 1"; 255 253 $result = $conn->getAll($sql); 256 254 257 $mobile = "";258 if ($isMobile) {259 $mobile = "mobile/";260 }261 262 255 $arrRet = array(); 263 for ($i = 0; $i < count($result); $i++) { 264 $page = array("url" => SITE_URL. sprintf("%sproducts/detail.php?product_id=%d", $mobile, $result[$i]['product_id']), 265 "update_date" => $result[$i]['update_date']); 266 $arrRet[$i] = $page; 256 foreach ($result as $row) { 257 258 $page["update_date"] = $row['update_date']; 259 260 $page["url"] = SITE_URL . 'products/detail.php?product_id=' . $row['product_id']; 261 $arrRet[] = $page; 262 263 // モバイルサイト 264 if (USE_MOBILE !== false) { 265 $page["url"] = MOBILE_SITE_URL . 'products/detail.php?product_id=' . $row['product_id']; 266 $arrRet[] = $page; 267 } 267 268 } 268 269 return $arrRet; … … 278 279 */ 279 280 function getPageData($where = '', $arrVal = ''){ 280 $objDBConn = new SC_DbConn; 281 $sql = ""; 282 $arrRet = array(); 281 $objDBConn = new SC_DbConn; // DB操作オブジェクト 282 $sql = ""; // データ取得SQL生成用 283 $arrRet = array(); // データ取得用 283 284 284 285 // SQL生成(url と update_date 以外は不要?) 285 286 $sql .= " SELECT"; 286 $sql .= " page_id"; 287 $sql .= " ,page_name"; 288 $sql .= " ,url"; 289 $sql .= " ,php_dir"; 290 $sql .= " ,tpl_dir"; 291 $sql .= " ,filename"; 292 $sql .= " ,header_chk "; 293 $sql .= " ,footer_chk "; 294 $sql .= " ,author"; 295 $sql .= " ,description"; 296 $sql .= " ,keyword"; 297 $sql .= " ,update_url"; 298 $sql .= " ,create_date"; 299 $sql .= " ,update_date"; 287 $sql .= " page_id"; // ページID 288 $sql .= " ,page_name"; // 名称 289 $sql .= " ,url"; // URL 290 $sql .= " ,php_dir"; // php保存先ディレクトリ 291 $sql .= " ,tpl_dir"; // tpl保存先ディdレクトリ 292 $sql .= " ,filename"; // ファイル名称 293 $sql .= " ,header_chk "; // ヘッダー使用FLG 294 $sql .= " ,footer_chk "; // フッター使用FLG 295 $sql .= " ,author"; // authorタグ 296 $sql .= " ,description"; // descriptionタグ 297 $sql .= " ,keyword"; // keywordタグ 298 $sql .= " ,update_url"; // 更新URL 299 $sql .= " ,create_date"; // データ作成日 300 $sql .= " ,update_date"; // データ更新日 300 301 $sql .= " FROM "; 301 302 $sql .= " dtb_pagelayout"; … … 306 307 } 307 308 308 $sql .= " ORDER BY 309 $sql .= " ORDER BY page_id"; 309 310 310 311 return $objDBConn->getAll($sql, $arrVal);
Note: See TracChangeset
for help on using the changeset viewer.