================================ ランディングページ ================================ 1 データベースの作成 (1)dtb_landing作成、mtb_use作成、mtb_useデータ挿入、mtb_display作成、mtb_displayデータ挿入、mtb_window_target作成、mtb_window_targetデータ挿入 -------------------------------------------------------- CREATE TABLE dtb_landing ( landing_id int NOT NULL, name text NOT NULL, url_name text NOT NULL, status smallint NOT NULL DEFAULT 2, canonical text, site_description text, author text, description text, keywords text, frame_check smallint NOT NULL DEFAULT 1, review_check smallint NOT NULL DEFAULT 1, law_check smallint NOT NULL DEFAULT 1, contact_check smallint NOT NULL DEFAULT 1, social_check smallint NOT NULL DEFAULT 1, bloc_check smallint NOT NULL DEFAULT 1, image1 text, alt1 text, link1 text, window1 smallint NOT NULL DEFAULT 1, comment1 text, youtube1 text, margin1 smallint NOT NULL DEFAULT 0, image2 text, alt2 text, link2 text, window2 smallint NOT NULL DEFAULT 1, comment2 text, youtube2 text, margin2 smallint NOT NULL DEFAULT 0, image3 text, alt3 text, link3 text, window3 smallint NOT NULL DEFAULT 1, comment3 text, youtube3 text, margin3 smallint NOT NULL DEFAULT 0, image4 text, alt4 text, link4 text, window4 smallint NOT NULL DEFAULT 1, comment4 text, youtube4 text, margin4 smallint NOT NULL DEFAULT 0, image5 text, alt5 text, link5 text, window5 smallint NOT NULL DEFAULT 1, comment5 text, youtube5 text, margin5 smallint NOT NULL DEFAULT 0, product1 int, product2 int, product3 int, product4 int, product5 int, product6 int, product7 int, product8 int, product9 int, product10 int, product11 int, product12 int, product13 int, product14 int, product15 int, product16 int, product17 int, product18 int, product19 int, product20 int, detail_open_check smallint NOT NULL DEFAULT 2, list_comment_check smallint NOT NULL DEFAULT 2, price_check smallint NOT NULL DEFAULT 1, display_check smallint NOT NULL DEFAULT 2, document text, rank int, del_flg smallint NOT NULL DEFAULT 0, creator_id int NOT NULL, create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, update_date timestamp NOT NULL, PRIMARY KEY (landing_id) ); CREATE TABLE mtb_use ( id smallint, name text, rank smallint NOT NULL, PRIMARY KEY (id) ); INSERT INTO mtb_use (id, name, rank) VALUES (1, '表示する', 0); INSERT INTO mtb_use (id, name, rank) VALUES (2, '表示しない', 1); CREATE TABLE mtb_display ( id smallint, name text, rank smallint NOT NULL, PRIMARY KEY (id) ); INSERT INTO mtb_display (id, name, rank) VALUES (1, '1列', 0); INSERT INTO mtb_display (id, name, rank) VALUES (2, '2列横並び', 1); INSERT INTO mtb_display (id, name, rank) VALUES (3, '3列横並び', 2); INSERT INTO mtb_display (id, name, rank) VALUES (4, '4列横並び', 3); INSERT INTO mtb_display (id, name, rank) VALUES (5, '5列横並び', 4); CREATE TABLE mtb_window_target ( id smallint, name text, rank smallint NOT NULL, PRIMARY KEY (id) ); INSERT INTO mtb_window_target (id, name, rank) VALUES (1, '別ウィンドウで開く', 0); INSERT INTO mtb_window_target (id, name, rank) VALUES (2, '同一ウィンドウで開く', 1); -------------------------------------------------------- (2)mtb_constantsテーブルにデータを追加する。 下記SQL文の、1501から1510の数字は、mtb_constantsテーブルの「rank」最終値からの続き番号を指定してください。 ★実行後、管理画面システム設定>パラメーター設定を開き、「この内容で登録する」をクリックしてください。設定が反映されます。 -------------------------------------------------------- INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_IMAGE_WIDTH', '950', 1501, 'ランディングページ 画像の横幅'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_CONTENT_NUM', '5', 1502, 'ランディングページ コンテンツの登録数(最大5)'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_PRODUCT_NUM', '10', 1503, 'ランディングページ 商品登録数(最大20)'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_REVIEW_MAX', '10', 1504, 'ランディングページ レビュー表示件数'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_LAW_TITLE', '"ご注文時の注意点"', 1505, 'ランディングページ 特定商取引表記のタイトル'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_STATIC_URL', 'true', 1506, 'ランディングページの静的URL(true:有効、false:無効)'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_FACEBOOK_APPID', '"false"', 1507, 'FacebookのApp_ID ""でくくる。(App_IDを持っていない場合は、"false" を指定)'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_ACCOUNT_KEY_TWITTER', '"false"', 1508, 'Twitterアカウント ""でくくる。(Twitterアカウントを持っていない場合は、"false" を指定)'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_SOCIAL_GOOGLE_RIGHT', '"-32px"', 1509, 'ソーシャル・グーグルボタンの右マージン(初期値:"-32px")'); INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('LANDING_SOCIAL_TWITTER_RIGHT', '"-57px"', 1510, 'ソーシャル・ツイッターボタンの右マージン(初期値:"-57px")'); -------------------------------------------------------- (3)ランディングページの作成 dtb_pagelayout 下記SQL文の、29、30、31は、「device_type_id」が10の中で、「page_id」最終値からの続き番号を指定してください。 -------------------------------------------------------- INSERT INTO dtb_pagelayout (device_type_id, page_id, page_name, url, filename, header_chk, footer_chk, edit_flg, author, description, keyword, update_url, create_date, update_date) VALUES (10, 29, 'ランディングページ', 'landing/index.php', 'landing/index', 1, 1, 2, NULL, NULL, NULL, NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); INSERT INTO dtb_pagelayout (device_type_id, page_id, page_name, url, filename, header_chk, footer_chk, edit_flg, author, description, keyword, update_url, create_date, update_date) VALUES (10, 30, 'ランディングページお問い合わせ入力(編集不可)', 'landing/lp_contact.php', 'landing/lp_contact', 2, 2, 2, NULL, NULL, NULL, NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); INSERT INTO dtb_pagelayout (device_type_id, page_id, page_name, url, filename, header_chk, footer_chk, edit_flg, author, description, keyword, update_url, create_date, update_date) VALUES (10, 31, 'ランディングページお問い合わせ完了(編集不可)', 'landing/lp_complete.php', 'landing/lp_complete', 2, 2, 2, NULL, NULL, NULL, NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); -------------------------------------------------------- (4)ブロックの作成 dtb_bloc 下記SQL文の、「2, 9,」の9は、「device_type_id」が2の中で、「bloc_id」最終値からの続き番号を指定してください。 下記SQL文の、「10, 11,」の11は、「device_type_id」が10の中で、「bloc_id」最終値からの続き番号を指定してください。 -------------------------------------------------------- INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 9, 'ランディングページメニュー', 'landing.tpl', 'landing', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/landing.php', 0); INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 11, 'ランディングページメニュー', 'landing.tpl', 'landing', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/landing.php', 0); -------------------------------------------------------- (5)[管理画面]→[マスタデータ管理]→[mtb_allowed_tag]に、エディタで使用できるHTMLタグを追加する。 ---------------------------------------------------- INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (19, 'span', 19); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (20, 'thead', 20); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (21, 'tbody', 21); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (22, 'caption', 22); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (23, 'form', 23); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (24, 'input', 24); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (25, 'textarea', 25); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (26, 'select', 26); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (27, 'em', 27); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (28, 'strike', 28); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (29, 'sub', 29); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (30, 'sup', 30); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (31, 'ul', 31); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (32, 'ol', 32); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (33, 'blockquote', 33); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (34, 'object', 34); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (35, 'param', 35); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (36, 'embed', 36); INSERT INTO mtb_allowed_tag (id, name, rank) VALUES (37, 'iframe', 37) ---------------------------------------------------- 2 必要ファイル (1)新規追加 ■html/admin/contents/landing.php ■html/admin/contents/landing_input.php ■html/admin/contents/landing_search.php ■html/frontparts/bloc/landing.php ■html/landing(フォルダ) ■html/upload/save_landing_image(フォルダ) ■html/upload/temp_landing_image(フォルダ) ■html/user_data/ckeditor4.4.0(フォルダ) ■html/user_data/packages/default/css/landing.css ■html/user_data/packages/default/img/btn_bg_landing1.png ■html/user_data/packages/default/img/btn_bg_landing2.png ■data/class/pages/admin/contents/LC_Page_Admin_Contents_Landing.php ■data/class/pages/admin/contents/LC_Page_Admin_Contents_LandingInput.php ■data/class/pages/admin/contents/LC_Page_Admin_Contents_LandingSearch.php ■data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Landing.php ■data/class/pages/landing(フォルダ) ■data/class_extends/page_extends/admin/contents/LC_Page_Admin_Contents_Landing_Ex.php ■data/class_extends/page_extends/admin/contents/LC_Page_Admin_Contents_LandingInput_Ex.php ■data/class_extends/page_extends/admin/contents/LC_Page_Admin_Contents_LandingSearch_Ex.php ■data/class_extends/page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Landing_Ex.php ■data/class_extends/page_extends/landing(フォルダ) ■data/Smarty/templates/admin/contents/landing.tpl ■data/Smarty/templates/admin/contents/landing_input.tpl ■data/Smarty/templates/admin/contents/landing_search.tpl ■data/Smarty/templates/default/frontparts/bloc/landing.tpl ■data/Smarty/templates/default/landing(フォルダ) ■data/Smarty/templates/sphone/frontparts/bloc/landing.tpl (2)修正が必要なファイル ■html/user_data/packages/default/css/import.css ■html/user_data/packages/default/css/bloc.css ■data/class/SC_Display.php ■data/class/SC_Product.php ■data/class/pages/LC_Page.php ■data/Smarty/templates/admin/main_frame.tpl ■data/Smarty/templates/admin/contents/subnavi.tpl ■data/Smarty/templates/default/site_frame.tpl ■data/Smarty/templates/default/site_main.tpl (3)修正ファイルの詳細 @ ■html/user_data/packages/default/css/import.css 最後に追加 -------------------------------------------------------- @import url("./landing.css"); -------------------------------------------------------- A ■html/user_data/packages/default/css/bloc.css 任意の箇所に追加 /* =============================================== ▼ランディングページメニュー =============================================== */ #landing_area .block_body { border:none; } #landing_area h2 { padding: 5px; background-color:#eee; margin-bottom:5px; } #landing_area ul.landing_button_like li { margin-bottom:5px; padding: 0 0 1px 0; background: url("../img/background/bg_btn_list.jpg") bottom repeat-x; } #landing_area ul.landing_button_like a { margin: 0; padding: 5px; border: 1px solid #ccc; border-bottom: none; display: block; text-decoration: none; outline: none; } B ■data/class/SC_Display.php 1) public function setDevice($device = DEVICE_TYPE_PC)内、case DEVICE_TYPE_SMARTPHONE: 【変更前】 -------------------------------------------------------- case DEVICE_TYPE_SMARTPHONE: $this->setView(new SC_SmartphoneView_Ex()); -------------------------------------------------------- 【変更後】 -------------------------------------------------------- case DEVICE_TYPE_SMARTPHONE: if (strstr($_SERVER["PHP_SELF"], "/landing/index.php") or strstr($_SERVER["PHP_SELF"], "/landing/lp_contact.php") or strstr($_SERVER["PHP_SELF"], "/landing/lp_complete.php")) { $this->setView(new SC_SiteView_Ex()); } else { $this->setView(new SC_SmartphoneView_Ex()); } -------------------------------------------------------- 2) public static function detectDevice($reset = FALSE)内、case DEVICE_TYPE_SMARTPHONE: 【変更前】 -------------------------------------------------------- } elseif ($su->isSmartphone()) { SC_Display_Ex::$device = DEVICE_TYPE_SMARTPHONE; -------------------------------------------------------- 【変更後】 -------------------------------------------------------- } elseif ($su->isSmartphone()) { if (strstr($_SERVER["PHP_SELF"], "/landing/index.php") or strstr($_SERVER["PHP_SELF"], "/landing/lp_contact.php") or strstr($_SERVER["PHP_SELF"], "/landing/lp_complete.php")) { SC_Display_Ex::$device = DEVICE_TYPE_PC; } else { SC_Display_Ex::$device = DEVICE_TYPE_SMARTPHONE; } -------------------------------------------------------- C ■data/class/SC_Product.php 152行目付近、public function lists 内に追加 -------------------------------------------------------- ,main_large_image -------------------------------------------------------- D ■data/class/pages/LC_Page.php public function init()内 -------------------------------------------------------- // ▼ランディングページ@/A $this->arrLandingFrame = $this->lfGetLandingFrame(); -------------------------------------------------------- 最後に -------------------------------------------------------- // ▼ランディングページA/A function lfGetLandingFrame() { $objQuery =& SC_Query_Ex::getSingletonInstance(); $landing = $_GET['landing']; $admin = $_GET['admin']; $col = '*'; if ($admin == "" OR $admin != AUTH_MAGIC) { $where = 'del_flg = 0 AND status = 1'; } elseif ($admin == AUTH_MAGIC) { $where = 'del_flg = 0'; } if ($landing != '') { $where .= ' AND url_name = ?'; } $arrWhereVal = array($landing); $arrRet = $objQuery->select($col, 'dtb_landing', $where, $arrWhereVal); return $arrRet[0]; } -------------------------------------------------------- E ■data/Smarty/templates/admin/main_frame.tpl 〜に以下を追加。 ---------------------------------------------------- ---------------------------------------------------- F ■data/Smarty/templates/admin/contents/subnavi.tpl 追加 ------------------------------------- class="on" id="navi-contents-landing">ランディングページ管理 ------------------------------------- G ■data/Smarty/templates/default/site_frame.tpl 最初に -------------------------------------------------------- -------------------------------------------------------- の次に -------------------------------------------------------- -------------------------------------------------------- の次に -------------------------------------------------------- -------------------------------------------------------- H ■data/Smarty/templates/default/site_main.tpl 最初に -------------------------------------------------------- --------------------------------------------------------  の前に -------------------------------------------------------- --------------------------------------------------------  の次に -------------------------------------------------------- --------------------------------------------------------  の前に -------------------------------------------------------- --------------------------------------------------------  の次に -------------------------------------------------------- --------------------------------------------------------  の前に -------------------------------------------------------- --------------------------------------------------------