Index: /branches/comu-ver2/html/install/sql/insert_data.sql
===================================================================
--- /branches/comu-ver2/html/install/sql/insert_data.sql (revision 17536)
+++ /branches/comu-ver2/html/install/sql/insert_data.sql (revision 17558)
@@ -1053,4 +1053,5 @@
INSERT INTO mtb_constants VALUES ('USE_POINT','true',290,'ポイントを利用するか(true:利用する、false:利用しない) (false は一部対応)');
INSERT INTO mtb_constants VALUES ('NOSTOCK_HIDDEN','false',291,'在庫無し商品の非表示(true:非表示、false:表示)');
+INSERT INTO mtb_constants VALUES ('USE_MOBILE','true',292,'モバイルサイトを利用するか(true:利用する、false:利用しない) (false は一部対応)');
INSERT INTO mtb_constants VALUES ('DEFAULT_TEMPLATE_NAME', '"default"', 300,'デフォルトテンプレート名');
INSERT INTO mtb_constants VALUES ('TEMPLATE_NAME', 'DEFAULT_TEMPLATE_NAME', 301,'テンプレート名');
Index: /branches/comu-ver2/html/mobile/require.php
===================================================================
--- /branches/comu-ver2/html/mobile/require.php (revision 17477)
+++ /branches/comu-ver2/html/mobile/require.php (revision 17558)
@@ -104,5 +104,5 @@
// Moba8対応(Moba8パラメータ引き継ぎ)
if (function_exists("sfGetMoba8Param") == TRUE) {
- sfGetMoba8Param($_GET['a8']);
+ sfGetMoba8Param($_GET['a8']);
}
Index: /branches/comu-ver2/data/class/SC_Initial_Mobile.php
===================================================================
--- /branches/comu-ver2/data/class/SC_Initial_Mobile.php (revision 16582)
+++ /branches/comu-ver2/data/class/SC_Initial_Mobile.php (revision 17558)
@@ -39,6 +39,13 @@
*/
function SC_Initial_Mobile() {
+
parent::SC_Initial();
-
+
+ // XXX モバイルはパラメータを読まないようなのでこの方法は使えなかった
+ // // モバイルサイトを利用しない設定の場合、落とす。
+ // if (USE_MOBILE === false) {
+ // exit;
+ // }
+
define('MOBILE_SITE', true);
}
Index: /branches/comu-ver2/data/class/pages/LC_Page_Sitemap.php
===================================================================
--- /branches/comu-ver2/data/class/pages/LC_Page_Sitemap.php (revision 16582)
+++ /branches/comu-ver2/data/class/pages/LC_Page_Sitemap.php (revision 17558)
@@ -78,5 +78,10 @@
function init() {
parent::init();
- $this->staticURL = array(SITE_URL, MOBILE_SITE_URL, SITE_URL . "rss/index.php");
+
+ $this->staticURL[] = SITE_URL;
+ $this->staticURL[] = SITE_URL . 'rss/index.php';
+ if (USE_MOBILE !== false) {
+ $this->staticURL[] = MOBILE_SITE_URL;
+ }
}
@@ -128,8 +133,4 @@
$this->createSitemap($product['url'], '', 'daily');
}
- $mobileProducts = $this->getAllProducts(true);
- foreach($mobileProducts as $mobileProduct) {
- $this->createSitemap($mobileProduct['url'], '', 'daily');
- }
// 商品詳細ページを処理
@@ -138,9 +139,4 @@
$this->createSitemap($detail['url'],
$this->date2W3CDatetime($detail['update_date']));
- }
- $mobileDetails = $this->getAllDetail(true);
- foreach($mobileDetails as $mobileDetail) {
- $this->createSitemap($mobileDetail['url'],
- $this->date2W3CDatetime($mobileDetail['update_date']));
}
@@ -222,22 +218,25 @@
* すべての商品一覧ページを取得する.
*
- * @param boolean $isMobile モバイルページを取得する場合 true
* @return array 検索エンジンからアクセス可能な商品一覧ページの情報
*/
- function getAllProducts($isMobile = false) {
+ function getAllProducts() {
+
+ // XXX: 商品登録の無いカテゴリーは除外する方が良い気もする
$conn = new SC_DBConn();
$sql = "SELECT category_id FROM dtb_category WHERE del_flg = 0";
$result = $conn->getAll($sql);
- $mobile = "";
- if ($isMobile) {
- $mobile = "mobile/";
- }
-
$arrRet = array();
- for ($i = 0; $i < count($result); $i++) {
+ foreach ($result as $row) {
// :TODO: カテゴリの最終更新日を取得できるようにする
- $page = array("url" => SITE_URL . sprintf("%sproducts/list.php?category_id=%d", $mobile, $result[$i]['category_id']));
- $arrRet[$i] = $page;
+
+ $page["url"] = SITE_URL . 'products/list.php?category_id=' . $row['category_id'];
+ $arrRet[] = $page;
+
+ // モバイルサイト
+ if (USE_MOBILE !== false) {
+ $page["url"] = MOBILE_SITE_URL . 'products/list.php?category_id=' . $row['category_id'];
+ $arrRet[] = $page;
+ }
}
return $arrRet;
@@ -247,22 +246,24 @@
* すべての商品詳細ページを取得する.
*
- * @param boolean $isMobile モバイルページを取得する場合 true
* @return array 検索エンジンからアクセス可能な商品詳細ページの情報
*/
- function getAllDetail($isMobile = false) {
+ function getAllDetail() {
$conn = new SC_DBConn();
$sql = "SELECT product_id, update_date FROM dtb_products WHERE del_flg = 0 AND status = 1";
$result = $conn->getAll($sql);
- $mobile = "";
- if ($isMobile) {
- $mobile = "mobile/";
- }
-
$arrRet = array();
- for ($i = 0; $i < count($result); $i++) {
- $page = array("url" => SITE_URL. sprintf("%sproducts/detail.php?product_id=%d", $mobile, $result[$i]['product_id']),
- "update_date" => $result[$i]['update_date']);
- $arrRet[$i] = $page;
+ foreach ($result as $row) {
+
+ $page["update_date"] = $row['update_date'];
+
+ $page["url"] = SITE_URL . 'products/detail.php?product_id=' . $row['product_id'];
+ $arrRet[] = $page;
+
+ // モバイルサイト
+ if (USE_MOBILE !== false) {
+ $page["url"] = MOBILE_SITE_URL . 'products/detail.php?product_id=' . $row['product_id'];
+ $arrRet[] = $page;
+ }
}
return $arrRet;
@@ -278,24 +279,24 @@
*/
function getPageData($where = '', $arrVal = ''){
- $objDBConn = new SC_DbConn; // DB操作オブジェクト
- $sql = ""; // データ取得SQL生成用
- $arrRet = array(); // データ取得用
+ $objDBConn = new SC_DbConn; // DB操作オブジェクト
+ $sql = ""; // データ取得SQL生成用
+ $arrRet = array(); // データ取得用
// SQL生成(url と update_date 以外は不要?)
$sql .= " SELECT";
- $sql .= " page_id"; // ページID
- $sql .= " ,page_name"; // 名称
- $sql .= " ,url"; // URL
- $sql .= " ,php_dir"; // php保存先ディレクトリ
- $sql .= " ,tpl_dir"; // tpl保存先ディdレクトリ
- $sql .= " ,filename"; // ファイル名称
- $sql .= " ,header_chk "; // ヘッダー使用FLG
- $sql .= " ,footer_chk "; // フッター使用FLG
- $sql .= " ,author"; // authorタグ
- $sql .= " ,description"; // descriptionタグ
- $sql .= " ,keyword"; // keywordタグ
- $sql .= " ,update_url"; // 更新URL
- $sql .= " ,create_date"; // データ作成日
- $sql .= " ,update_date"; // データ更新日
+ $sql .= " page_id"; // ページID
+ $sql .= " ,page_name"; // 名称
+ $sql .= " ,url"; // URL
+ $sql .= " ,php_dir"; // php保存先ディレクトリ
+ $sql .= " ,tpl_dir"; // tpl保存先ディdレクトリ
+ $sql .= " ,filename"; // ファイル名称
+ $sql .= " ,header_chk "; // ヘッダー使用FLG
+ $sql .= " ,footer_chk "; // フッター使用FLG
+ $sql .= " ,author"; // authorタグ
+ $sql .= " ,description"; // descriptionタグ
+ $sql .= " ,keyword"; // keywordタグ
+ $sql .= " ,update_url"; // 更新URL
+ $sql .= " ,create_date"; // データ作成日
+ $sql .= " ,update_date"; // データ更新日
$sql .= " FROM ";
$sql .= " dtb_pagelayout";
@@ -306,5 +307,5 @@
}
- $sql .= " ORDER BY page_id";
+ $sql .= " ORDER BY page_id";
return $objDBConn->getAll($sql, $arrVal);