ecshop在线手册,非常不错

http://book.ecmoban.com/

 

$_LANG 手机端mobile/languages下,pc端在根目录languages下,根据文件类型找寻变量

$_CFG ecshop里的$_CFG数组主要是存放一些系统参数,并且全站共享的数据,在使用的时候,常常以$GLOBALS[‘_CFG’]全局变量的模式来处理。ecshop的$GLOBALS[‘_CFG’],主要是在includes/init.php中出现并且初始化的,代码如下:$_CFG = load_config(); load_config() 这个函数负责将参数取出来。load_config() 函数 存放位置在 /includes/lib_common.php 文件中。用代码编辑软件打开 /includes/lib_common.php 就能找到这个函数load_config()。

/**
 * 载入配置信息
 *
 * @access  public
 * @return  array
 */
function load_config()
{
    $arr = array();
 
    $data = read_static_cache('shop_config');
    if ($data === false)
    {
        $sql = 'SELECT code, value FROM ' . $GLOBALS['ecs']->table('shop_config') . ' WHERE parent_id > 0';
        $res = $GLOBALS['db']->getAll($sql);
 
        foreach ($res AS $row)
        {
            $arr[$row['code']] = $row['value'];
        }
 
        /* 对数值型设置处理 */
        $arr['watermark_alpha']      = intval($arr['watermark_alpha']);
        $arr['market_price_rate']    = floatval($arr['market_price_rate']);
        $arr['integral_scale']       = floatval($arr['integral_scale']);
        //$arr['integral_percent']     = floatval($arr['integral_percent']);
        $arr['cache_time']           = intval($arr['cache_time']);
        $arr['thumb_width']          = intval($arr['thumb_width']);
        $arr['thumb_height']         = intval($arr['thumb_height']);
        $arr['image_width']          = intval($arr['image_width']);
        $arr['image_height']         = intval($arr['image_height']);
        $arr['best_number']          = !empty($arr['best_number']) && intval($arr['best_number']) > 0 ? intval($arr['best_number'])     : 3;
        $arr['new_number']           = !empty($arr['new_number']) && intval($arr['new_number']) > 0 ? intval($arr['new_number'])      : 3;
        $arr['hot_number']           = !empty($arr['hot_number']) && intval($arr['hot_number']) > 0 ? intval($arr['hot_number'])      : 3;
        $arr['promote_number']       = !empty($arr['promote_number']) && intval($arr['promote_number']) > 0 ? intval($arr['promote_number'])  : 3;
        $arr['top_number']           = intval($arr['top_number'])      > 0 ? intval($arr['top_number'])      : 10;
        $arr['history_number']       = intval($arr['history_number'])  > 0 ? intval($arr['history_number'])  : 5;
        $arr['comments_number']      = intval($arr['comments_number']) > 0 ? intval($arr['comments_number']) : 5;
        $arr['article_number']       = intval($arr['article_number'])  > 0 ? intval($arr['article_number'])  : 5;
        $arr['page_size']            = intval($arr['page_size'])       > 0 ? intval($arr['page_size'])       : 10;
        $arr['bought_goods']         = intval($arr['bought_goods']);
        $arr['goods_name_length']    = intval($arr['goods_name_length']);
        $arr['top10_time']           = intval($arr['top10_time']);
        $arr['goods_gallery_number'] = intval($arr['goods_gallery_number']) ? intval($arr['goods_gallery_number']) : 5;
        $arr['no_picture']           = !empty($arr['no_picture']) ? str_replace('../', './', $arr['no_picture']) : 'images/no_picture.gif'; // 修改默认商品图片的路径
        // 代码修改_start bbs.hongyuvip.com
//         $arr['qq']                   = !empty($arr['qq']) ? $arr['qq'] : '';
//         $arr['ww']                   = !empty($arr['ww']) ? $arr['ww'] : '';
        $arr['qq'] = '';
        $arr['ww'] = '';
        $qq = $GLOBALS['db']->getAll("SELECT cus_no FROM " . $GLOBALS['ecs']->table('chat_third_customer') . " WHERE is_master = 1 AND cus_type = 0");
        $ww = $GLOBALS['db']->getAll("SELECT cus_no FROM " . $GLOBALS['ecs']->table('chat_third_customer') . " WHERE is_master = 1 AND cus_type = 1");
        foreach ($qq as $k => $v)
        {
            $arr['qq'] = $arr['qq'] . ',' . $v['cus_no'];
        }
        foreach ($ww as $k => $v)
        {
            $arr['ww'] = $arr['ww'] . ',' . $v['cus_no'];
        }
        // 代码修改_end bbs.hongyuvip.com
        $arr['default_storage']      = isset($arr['default_storage']) ? intval($arr['default_storage']) : 1;
        $arr['min_goods_amount']     = isset($arr['min_goods_amount']) ? floatval($arr['min_goods_amount']) : 0;
        $arr['one_step_buy']         = empty($arr['one_step_buy']) ? 0 : 1;
        $arr['invoice_type']         = empty($arr['invoice_type']) ? array('type' => array(), 'rate' => array()) : unserialize($arr['invoice_type']);
        $arr['show_order_type']      = isset($arr['show_order_type']) ? $arr['show_order_type'] : 0;    // 显示方式默认为列表方式
        $arr['help_open']            = isset($arr['help_open']) ? $arr['help_open'] : 1;    // 显示方式默认为列表方式
        /* fulltext_search_add_START_bbs.hongyuvip.com */
	$arr['fulltext_search']            = isset($arr['fulltext_search']) ? $arr['fulltext_search'] : 0;  
        /* fulltext_search_add_END_bbs.hongyuvip.com */
        $arr['shop_opint']            = isset($arr['shop_opint']) ? $arr['shop_opint'] : 0;  
 
        if (!isset($GLOBALS['_CFG']['ecs_version']))
        {
            /* 如果没有版本号则默认为2.0.5 */
            $GLOBALS['_CFG']['ecs_version'] = 'v2.0.5';
        }
 
        //限定语言项
        $lang_array = array('zh_cn', 'zh_tw', 'en_us');
        if (empty($arr['lang']) || !in_array($arr['lang'], $lang_array))
        {
            $arr['lang'] = 'zh_cn'; // 默认语言为简体中文
        }
 
        if (empty($arr['integrate_code']))
        {
            $arr['integrate_code'] = 'ecshop'; // 默认的会员整合插件为 ecshop
        }
        write_static_cache('shop_config', $arr);
    }
    else
    {
        $arr = $data;
    }
 
    return $arr;
}

从shop_config表中读取的数据,加工的,shop_config表如下:

支付宝支付  pay_config

a:4:{i:0;a:3:{s:4:”name”;s:14:”alipay_account”;s:4:”type”;s:4:”text”;s:5:”value”;s:17:”2475232949@qq.com”;}i:1;a:3:{s:4:”name”;s:10:”alipay_key”;s:4:”type”;s:4:”text”;s:5:”value”;s:32:”mszu3vwys85ykbqysja3ym9p268acmrk”;}i:2;a:3:{s:4:”name”;s:14:”alipay_partner”;s:4:”type”;s:4:”text”;s:5:”value”;s:16:”2088231943994888″;}i:3;a:3:{s:4:”name”;s:17:”alipay_pay_method”;s:4:”type”;s:6:”select”;s:5:”value”;s:1:”2″;}}

 

微信支付 pay_config

a:4:{i:0;a:3:{s:4:”name”;s:14:”wxnative_appid”;s:4:”type”;s:4:”text”;s:5:”value”;s:18:”wxa79e4954abdc0706″;}i:1;a:3:{s:4:”name”;s:18:”wxnative_appsecret”;s:4:”type”;s:4:”text”;s:5:”value”;s:32:”e3012b9005bf2ba5ed6708eb505a1bfb”;}i:2;a:3:{s:4:”name”;s:14:”wxnative_mchid”;s:4:”type”;s:4:”text”;s:5:”value”;s:10:”1515841331″;}i:3;a:3:{s:4:”name”;s:12:”wxnative_key”;s:4:”type”;s:4:”text”;s:5:”value”;s:32:”xpyXYcbN4DHQCT1OfXjme5AAqMPG501m”;}}

 

$payment_info

array(11) { [“pay_id”]=> string(1) “4” [“pay_code”]=> string(8) “wxnative” [“pay_name”]=> string(12) “微信支付” [“pay_fee”]=> string(1) “0” [“pay_desc”]=> string(255) “微信支付,是基于客户端提供的服务功能。同时向商户提供销售经营分析、账户和资金管理的功能支持。用户通过扫描二维码、微信内打开商品页面购买等多种方式调起微信支付模块完成支付。” [“pay_order”]=> string(1) “0” [“pay_config”]=> string(440) “a:4:{i:0;a:3:{s:4:”name”;s:14:”wxnative_appid”;s:4:”type”;s:4:”text”;s:5:”value”;s:18:”wxa79e4954abdc0706″;}i:1;a:3:{s:4:”name”;s:18:”wxnative_appsecret”;s:4:”type”;s:4:”text”;s:5:”value”;s:32:”e3012b9005bf2ba5ed6708eb505a1bfb”;}i:2;a:3:{s:4:”name”;s:14:”wxnative_mchid”;s:4:”type”;s:4:”text”;s:5:”value”;s:10:”1515841331″;}i:3;a:3:{s:4:”name”;s:12:”wxnative_key”;s:4:”type”;s:4:”text”;s:5:”value”;s:32:”xpyXYcbN4DHQCT1OfXjme5AAqMPG501m”;}}” [“enabled”]=> string(1) “1” [“is_cod”]=> string(1) “0” [“is_online”]=> string(1) “1” [“is_pickup”]=> string(1) “0” }

发表评论

邮箱地址不会被公开。 必填项已用*标注