Changeset 18758 for trunk/data/class/pages/LC_Page_Sitemap.php
- Timestamp:
- 2010/07/20 13:25:33 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/class/pages/LC_Page_Sitemap.php
r16582 r18758 3 3 * This file is part of EC-CUBE 4 4 * 5 * Copyright(c) 2000-20 07LOCKON CO.,LTD. All Rights Reserved.5 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. 6 6 * 7 7 * http://www.lockon.co.jp/ … … 105 105 print("<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>\n"); 106 106 107 // 静的なページを処理108 foreach($this->staticURL as $url) {109 $this->createSitemap($url, '', 'daily', 1.0);110 }111 112 107 // TOPページを処理 113 108 $topPage = $this->getTopPage($this->arrPageList); … … 116 111 'daily', 1.0); 117 112 113 // 静的なページを処理 114 foreach ($this->staticURL as $url) { 115 $this->createSitemap($url, '', 'daily', 1.0); 116 } 117 118 118 // 編集可能ページを処理 119 119 $editablePages = $this->getEditablePage($this->arrPageList); 120 foreach ($editablePages as $editablePage) {120 foreach ($editablePages as $editablePage) { 121 121 $this->createSitemap($editablePage['url'], 122 122 $this->date2W3CDatetime($editablePage['update_date'])); … … 125 125 // 商品一覧ページを処理 126 126 $products = $this->getAllProducts(); 127 foreach ($products as $product) {127 foreach ($products as $product) { 128 128 $this->createSitemap($product['url'], '', 'daily'); 129 129 } 130 130 $mobileProducts = $this->getAllProducts(true); 131 foreach ($mobileProducts as $mobileProduct) {131 foreach ($mobileProducts as $mobileProduct) { 132 132 $this->createSitemap($mobileProduct['url'], '', 'daily'); 133 133 } … … 135 135 // 商品詳細ページを処理 136 136 $details = $this->getAllDetail(); 137 foreach ($details as $detail) {137 foreach ($details as $detail) { 138 138 $this->createSitemap($detail['url'], 139 139 $this->date2W3CDatetime($detail['update_date'])); 140 140 } 141 141 $mobileDetails = $this->getAllDetail(true); 142 foreach ($mobileDetails as $mobileDetail) {142 foreach ($mobileDetails as $mobileDetail) { 143 143 $this->createSitemap($mobileDetail['url'], 144 144 $this->date2W3CDatetime($mobileDetail['update_date'])); … … 192 192 function getTopPage($pageData) { 193 193 $arrRet = array(); 194 foreach ($pageData as $page) {194 foreach ($pageData as $page) { 195 195 if ($page['page_id'] == "1") { 196 $page['url'] = SITE_URL . $page['url'];197 196 $arrRet[0] = $page; 198 197 return $arrRet; … … 209 208 function getEditablePage($pageData) { 210 209 $arrRet = array(); 211 $i = 0; 212 foreach($pageData as $page) { 210 foreach ($pageData as $page) { 213 211 if ($page['page_id'] > 4) { 214 $arrRet[$i] = $page; 215 $i++; 212 $arrRet[] = $page; 216 213 } 217 214 } … … 308 305 $sql .= " ORDER BY page_id"; 309 306 310 return $objDBConn->getAll($sql, $arrVal); 307 $pageData = $objDBConn->getAll($sql, $arrVal); 308 // URL にプロトコルの記載が無い場合、SITE_URL を前置する。 309 foreach (array_keys($pageData) as $key) { 310 $page =& $pageData[$key]; 311 if (!preg_match('|^https?://|i', $page['url'])) { 312 $page['url'] = SITE_URL . $page['url']; 313 } 314 } 315 unset($page); 316 317 return $pageData; 311 318 } 312 319
Note: See TracChangeset
for help on using the changeset viewer.