Ejemplo n.º 1
0
function lfMakeConfigFile()
{
    global $objWebParam;
    global $objDBParam;
    $root_dir = $objWebParam->getValue('install_dir');
    $root_dir = str_replace("\\", "/", $root_dir);
    // 語尾に'/'をつける
    if (!ereg("/\$", $root_dir)) {
        $root_dir = $root_dir . "/";
    }
    $normal_url = $objWebParam->getValue('normal_url');
    // 語尾に'/'をつける
    if (!ereg("/\$", $normal_url)) {
        $normal_url = $normal_url . "/";
    }
    $secure_url = $objWebParam->getValue('secure_url');
    // 語尾に'/'をつける
    if (!ereg("/\$", $secure_url)) {
        $secure_url = $secure_url . "/";
    }
    // ディレクトリの取得
    $url_dir = ereg_replace("^https?://[a-zA-Z0-9_:~=&\\?\\.\\-]+", "", $normal_url);
    $data_path = SC_Utils_Ex::sfRmDupSlash($root_dir . HTML2DATA_DIR);
    $data_path = str_replace("\\", "/", realpath($data_path));
    // 語尾に'/'をつける
    if (!ereg("/\$", $data_path)) {
        $data_path = $data_path . "/";
    }
    $filepath = $data_path . "install.php";
    $config_data = "<?php\n" . "    define ('ECCUBE_INSTALL', 'ON');\n" . "    define ('HTML_PATH', '" . $root_dir . "');\n" . "    define ('SITE_URL', '" . $normal_url . "');\n" . "    define ('SSL_URL', '" . $secure_url . "');\n" . "    define ('URL_DIR', '" . $url_dir . "');\n" . "    define ('DOMAIN_NAME', '" . $objWebParam->getValue('domain') . "');\n" . "    define ('DB_TYPE', '" . $objDBParam->getValue('db_type') . "');\n" . "    define ('DB_USER', '" . $objDBParam->getValue('db_user') . "');\n" . "    define ('DB_PASSWORD', '" . $objDBParam->getValue('db_password') . "');\n" . "    define ('DB_SERVER', '" . $objDBParam->getValue('db_server') . "');\n" . "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" . "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') . "');\n" . "    define ('DATA_PATH', '" . $data_path . "');\n" . "    define ('MOBILE_HTML_PATH', HTML_PATH . 'mobile/');\n" . "    define ('MOBILE_SITE_URL', SITE_URL . 'mobile/');\n" . "    define ('MOBILE_SSL_URL', SSL_URL . 'mobile/');\n" . "    define ('MOBILE_URL_DIR', URL_DIR . 'mobile/');\n" . "?>";
    if ($fp = fopen($filepath, "w")) {
        fwrite($fp, $config_data);
        fclose($fp);
    }
    /* install_mobile.incは使用しない用に変更
    
        // モバイル版の設定ファイル install_mobile.inc を作成する。
        $filepath = $data_path . "install_mobile.inc";
    
        $config_data =
        "<?php\n".
        "    define ('ECCUBE_INSTALL', 'ON');\n" .
        "    define ('HTML_PATH', '" . $root_dir . "mobile/');\n" .
        "    define ('PC_HTML_PATH', '" . $root_dir . "');\n" .
        "    define ('SITE_URL', '" . $normal_url . "mobile/');\n" .
        "    define ('PC_SITE_URL', '" . $normal_url . "');\n" .
        "    define ('SSL_URL', '" . $secure_url . "mobile/');\n" .
        "    define ('PC_SSL_URL', '" . $secure_url . "');\n" .
        "    define ('URL_DIR', '" . $url_dir . "mobile/');\n" .
        "    define ('PC_URL_DIR', '" . $url_dir . "');\n" .
        "    define ('DOMAIN_NAME', '" . $objWebParam->getValue('domain') . "');\n" .
        "    define ('DB_TYPE', '" . $objDBParam->getValue('db_type') . "');\n" .
        "    define ('DB_USER', '" . $objDBParam->getValue('db_user') . "');\n" .
        "    define ('DB_PASSWORD', '" . $objDBParam->getValue('db_password') . "');\n" .
        "    define ('DB_SERVER', '" . $objDBParam->getValue('db_server') . "');\n" .
        "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" .
        "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') .  "');\n" .
        "    define ('DATA_PATH', '".$data_path."');\n" .
        "?>";
    
        if($fp = fopen($filepath,"w")) {
            fwrite($fp, $config_data);
            fclose($fp);
        }
    */
}
Ejemplo n.º 2
0
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
$require_php_dir = realpath(dirname(__FILE__));
require_once $require_php_dir . "/define.php";
require_once $require_php_dir . HTML2DATA_DIR . "require_base.php";
// 携帯端末の場合は mobile 以下へリダイレクトする。
if (SC_MobileUserAgent::isMobile()) {
    $url = "";
    if (SC_Utils_Ex::sfIsHTTPS()) {
        $url = MOBILE_SSL_URL;
    } else {
        $url = MOBILE_SITE_URL;
    }
    if (preg_match('|^' . URL_DIR . '(.*)$|', $_SERVER['REQUEST_URI'], $matches)) {
        $path = $matches[1];
    } else {
        $path = '';
    }
    header("Location: " . SC_Utils_Ex::sfRmDupSlash($url . $path));
    exit;
}
        <?php 
                }
                ?>

      <a href="<?php 
                echo is_array($_tmp = @URL_DIR) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
products/detail.php?product_id=<?php 
                echo is_array($_tmp = $this->_tpl_vars['arrBestProducts'][$this->_tpl_vars['cnt2']]['product_id']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
">
        <img src="<?php 
                echo is_array($_tmp = @SITE_URL) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
resize_image.php?image=<?php 
                echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['image_path']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) ? $this->_run_mod_handler('sfRmDupSlash', true, $_tmp) : SC_Utils_Ex::sfRmDupSlash($_tmp);
                ?>
&amp;width=48&amp;height=48" alt="<?php 
                echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['arrBestProducts'][$this->_tpl_vars['cnt2']]['name']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp);
                ?>
" />
      </a>

      <h3>
      <a href="<?php 
                echo is_array($_tmp = @URL_DIR) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
products/detail.php?product_id=<?php 
                echo is_array($_tmp = $this->_tpl_vars['arrBestProducts'][$this->_tpl_vars['cnt2']]['product_id']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
"><?php