Ignore:
Timestamp:
2010/07/20 13:25:33 (14 years ago)
Author:
kajiwara
Message:

EC-CUBE Ver2.4.4 分コミット。詳細はこちら( http://www.ec-cube.net/release/detail.php?release_id=223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/class/pages/LC_Page_Sitemap.php

    r16582 r18758  
    33 * This file is part of EC-CUBE 
    44 * 
    5  * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 
     5 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. 
    66 * 
    77 * http://www.lockon.co.jp/ 
     
    105105        print("<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>\n"); 
    106106 
    107         // 静的なページを処理 
    108         foreach($this->staticURL as $url) { 
    109             $this->createSitemap($url, '', 'daily', 1.0); 
    110         } 
    111  
    112107        // TOPページを処理 
    113108        $topPage = $this->getTopPage($this->arrPageList); 
     
    116111                             'daily', 1.0); 
    117112 
     113        // 静的なページを処理 
     114        foreach ($this->staticURL as $url) { 
     115            $this->createSitemap($url, '', 'daily', 1.0); 
     116        } 
     117 
    118118        // 編集可能ページを処理 
    119119        $editablePages = $this->getEditablePage($this->arrPageList); 
    120         foreach($editablePages as $editablePage) { 
     120        foreach ($editablePages as $editablePage) { 
    121121            $this->createSitemap($editablePage['url'], 
    122122                                 $this->date2W3CDatetime($editablePage['update_date'])); 
     
    125125        // 商品一覧ページを処理 
    126126        $products = $this->getAllProducts(); 
    127         foreach($products as $product) { 
     127        foreach ($products as $product) { 
    128128            $this->createSitemap($product['url'], '', 'daily'); 
    129129        } 
    130130        $mobileProducts = $this->getAllProducts(true); 
    131         foreach($mobileProducts as $mobileProduct) { 
     131        foreach ($mobileProducts as $mobileProduct) { 
    132132            $this->createSitemap($mobileProduct['url'], '', 'daily'); 
    133133        } 
     
    135135        // 商品詳細ページを処理 
    136136        $details = $this->getAllDetail(); 
    137         foreach($details as $detail) { 
     137        foreach ($details as $detail) { 
    138138            $this->createSitemap($detail['url'], 
    139139                                 $this->date2W3CDatetime($detail['update_date'])); 
    140140        } 
    141141        $mobileDetails = $this->getAllDetail(true); 
    142         foreach($mobileDetails as $mobileDetail) { 
     142        foreach ($mobileDetails as $mobileDetail) { 
    143143            $this->createSitemap($mobileDetail['url'],  
    144144                                 $this->date2W3CDatetime($mobileDetail['update_date'])); 
     
    192192    function getTopPage($pageData) { 
    193193        $arrRet = array(); 
    194         foreach($pageData as $page) { 
     194        foreach ($pageData as $page) { 
    195195            if ($page['page_id'] == "1") { 
    196                 $page['url'] = SITE_URL . $page['url']; 
    197196                $arrRet[0] = $page; 
    198197                return $arrRet; 
     
    209208    function getEditablePage($pageData) { 
    210209        $arrRet = array(); 
    211         $i = 0; 
    212         foreach($pageData as $page) { 
     210        foreach ($pageData as $page) { 
    213211            if ($page['page_id'] > 4) { 
    214                 $arrRet[$i] = $page; 
    215                 $i++; 
     212                $arrRet[] = $page; 
    216213            } 
    217214        } 
     
    308305        $sql .= " ORDER BY  page_id"; 
    309306 
    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; 
    311318    } 
    312319 
Note: See TracChangeset for help on using the changeset viewer.