文章中心

定制自己专属的商城/网站
成都 (模板城网络服务)

网址: www.kecnet.cn
邮箱: qrdwx#hotmail.com

在线联系:

客服1 客服2 售后

取消zencart后台多语言输入的方法

时间:2011-10-10 00:00:00来源:互联网 作者:秩名 点击:
zencart前台英文后台中文(zencart后台取消多言语输出的办法)办法是:在后台把默许言语设置成英文,这样每一次开启前台和后台默许都是英文。当装置了超越一个言语后,zencart后台有切换言语的...

zen cart前台英文后台中文(zen cart后台取消多言语输出的办法)
办法是:在后台把默许言语设置成英文,这样每一次开启前台和后台默许都是英文。当装置了超越一个言语后,zen cart后台有切换言语的功效,切换到中文就行了。
Issue(问题)是:当装置了超越一个言语后,zen cart后台的分类和商品的编辑页面会把各个言语的输出框都列出来,招致页面过长,无用信息过度,糜费输出材料的时刻。
我们要完成:不论后台切换到中文还是英文,分类和商品的编辑页面只保存英文言语输出。
1,\admin\includes\configure.php里的最终面参加上面几行:
代码:
  define('ONLY_ONE_LANGUAGE_WHEN_EDITING', true);  //bbs.phpdz.cn
  define('THE_LANGUAGE_WHEN_EDITING', 'en');
  //define('THE_LANGUAGE_WHEN_EDITING', 'gb');
2,\admin\includes\header.php里大约在18行,找到:
代码:
$languages = zen_get_languages();
变为:
代码:
$languages = zen_get_languages(false); //bbs.phpdz.cn
3,\admin\includes\functions\general.php里,找到:
代码:
  function zen_get_languages() {
    global $db;
    $languages = $db->Execute("select languages_id, name, code, image, directory
                               from " . TABLE_LANGUAGES . " order by sort_order");

    while (!$languages->EOF) {
      $languages_array[] = array('id' => $languages->fields['languages_id'],
                                 'name' => $languages->fields['name'],
                                 'code' => $languages->fields['code'],
                                 'image' => $languages->fields['image'],
                                 'directory' => $languages->fields['directory']);
      $languages->MoveNext();
    }

    return $languages_array;
  }
变为:
代码:
//bbs.phpdz.cn
  function zen_get_languages($only_one=ONLY_ONE_LANGUAGE_WHEN_EDITING) { 
    global $db;
   
    if ($only_one){
    $languages = $db->Execute("select languages_id, name, code, image, directory
                               from " . TABLE_LANGUAGES . " where code='" . THE_LANGUAGE_WHEN_EDITING . "'");  
    }
    else{
    $languages = $db->Execute("select languages_id, name, code, image, directory
                               from " . TABLE_LANGUAGES . " order by sort_order");
    }
    while (!$languages->EOF) {
      $languages_array[] = array('id' => $languages->fields['languages_id'],
                                 'name' => $languages->fields['name'],
                                 'code' => $languages->fields['code'],
                                 'image' => $languages->fields['image'],
                                 'directory' => $languages->fields['directory']);
      $languages->MoveNext();
    }
    return $languages_array;
  }

返回】【顶部】【打印

更多相关信息