- Timestamp:
- 2010/03/10 15:26:23 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_4-dev/data/class/pages/LC_Page_Sitemap.php
r18573 r18606 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 } … … 310 307 $sql .= " ORDER BY page_id"; 311 308 312 return $objDBConn->getAll($sql, $arrVal); 309 $pageData = $objDBConn->getAll($sql, $arrVal); 310 // URL にプロトコルの記載が無い場合、SITE_URL を前置する。 311 foreach (array_keys($pageData) as $key) { 312 $page =& $pageData[$key]; 313 if (!preg_match('|^https?://|i', $page['url'])) { 314 $page['url'] = SITE_URL . $page['url']; 315 } 316 } 317 unset($page); 318 319 return $pageData; 313 320 } 314 321
Note: See TracChangeset
for help on using the changeset viewer.