本文整理汇总了PHP中Language::getGBK方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::getGBK方法的具体用法?PHP Language::getGBK怎么用?PHP Language::getGBK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::getGBK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkmemberOp
public function checkmemberOp()
{
$name = trim($_GET['name']);
if (!$name) {
echo '';
die;
}
/**
* 转码
*/
if (strtoupper(CHARSET) == 'GBK') {
$name = Language::getGBK($name);
}
$obj_member = Model('member');
$member_info = $obj_member->getMemberInfo(array('member_name' => $name));
if (is_array($member_info) && count($member_info) > 0) {
if (strtoupper(CHARSET) == 'GBK') {
$member_info['member_name'] = Language::getUTF8($member_info['member_name']);
}
echo json_encode(array('id' => $member_info['member_id'], 'name' => $member_info['member_name'], 'points' => $member_info['member_points']));
} else {
echo '';
die;
}
}
示例2: indexOp
/**
* 查看店铺动态
*/
public function indexOp()
{
//获得店铺ID
$sid = intval($_GET['sid']);
$this->getStoreInfo($sid);
// where 条件
$where = array();
$where['strace_state'] = 1;
$where['strace_storeid'] = $sid;
if ($_GET['type'] != '') {
switch (trim($_GET['type'])) {
case 'promotion':
$where['strace_type'] = array('in', array(4, 5, 6, 7, 8));
break;
case 'new':
$where['strace_type'] = 3;
break;
case 'hotsell':
$where['strace_type'] = 10;
break;
case 'recommend':
$where['strace_type'] = 9;
break;
}
}
$model_stracelog = Model('store_sns_tracelog');
$strace_array = $model_stracelog->getStoreSnsTracelogList($where, '*', 'strace_id desc', 0, 40);
// 整理
if (!empty($strace_array) && is_array($strace_array)) {
foreach ($strace_array as $key => $val) {
if ($val['strace_content'] == '') {
$val['strace_goodsdata'] = json_decode($val['strace_goodsdata'], true);
if (CHARSET == 'GBK') {
foreach ((array) $val['strace_goodsdata'] as $k => $v) {
$val['strace_goodsdata'][$k] = Language::getGBK($v);
}
}
$content = $model_stracelog->spellingStyle($val['strace_type'], $val['strace_goodsdata']);
$strace_array[$key]['strace_content'] = str_replace("%siteurl%", SHOP_SITE_URL . DS, $content);
}
}
}
Tpl::output('strace_array', $strace_array);
//验证码
Tpl::output('nchash', substr(md5(SHOP_SITE_URL . $_GET['act'] . $_GET['op']), 0, 8));
//允许插入新记录的最大条数
Tpl::output('max_recordnum', self::MAX_RECORDNUM);
Tpl::output('show_page', $model_stracelog->showpage(2));
// 最多收藏的会员
$favorites = Model('favorites')->getStoreFavoritesList(array('fav_id' => $sid), '*', 0, 'fav_time desc', 8);
if (!empty($favorites)) {
$memberid_array = array();
foreach ($favorites as $val) {
$memberid_array[] = $val['member_id'];
}
$favorites_list = Model('member')->getMemberList(array('member_id' => array('in', $memberid_array)), 'member_id,member_name,member_avatar');
Tpl::output('favorites_list', $favorites_list);
}
Tpl::showpage('store_snshome');
}
示例3: __construct
public function __construct()
{
parent::__construct();
Language::read('member_chat');
if (strtoupper(CHARSET) == 'GBK') {
$_GET = Language::getGBK($_GET);
$_POST = Language::getGBK($_POST);
}
}
示例4: __construct
public function __construct()
{
parent::__construct();
if (strtoupper(CHARSET) == 'GBK') {
$_GET = Language::getGBK($_GET);
$_POST = Language::getGBK($_POST);
}
Language::read('web_config');
}
示例5: __construct
/**
* 构造函数
*/
public function __construct()
{
/**
* 读取通用、布局的语言包
*/
Language::read('common');
Language::read('microshop');
/**
* 判断微商城是否关闭
*/
if (C('microshop_isuse') != '1') {
header('location: ' . SHOP_SITE_URL);
die;
}
/**
* 设置布局文件内容
*/
Tpl::setLayout('microshop_layout');
/**
* 转码
*/
if ($_GET['column'] && strtoupper(CHARSET) == 'GBK') {
$_GET = Language::getGBK($_GET);
}
/**
* 获取导航
*/
Tpl::output('nav_list', ($nav = F('nav')) ? $nav : H('nav', true, 'file'));
/**
* 搜索类型列表
*/
$search_type = array();
$search_type['goods'] = Language::get('nc_microshop_goods');
$search_type['personal'] = Language::get('nc_microshop_personal');
$search_type['store'] = Language::get('nc_microshop_store');
//$search_type['album'] = Language::get('nc_microshop_album');
Tpl::output('search_type', $search_type);
/**
* 登录后读取用户头像
*/
if (!empty($_SESSION['member_id']) && intval($_SESSION['member_id']) > 0) {
self::get_member_avatar($_SESSION['member_id']);
}
/**
* 系统状态检查
*/
if (!C('site_status')) {
halt(C('closed_reason'));
}
/**
* seo
*/
Tpl::output('html_title', Language::get('nc_microshop') . '-' . C('site_name'));
Tpl::output('seo_keywords', C('microshop_seo_keywords'));
Tpl::output('seo_description', C('microshop_seo_description'));
}
示例6: __construct
public function __construct()
{
parent::__construct();
if (strtoupper(CHARSET) == 'GBK') {
$_GET = Language::getGBK($_GET);
$_POST = Language::getGBK($_POST);
}
Language::read('web_config,control');
Tpl::setLayout('homeview_layout');
}
示例7: stracelistOp
/**
* 买家中心店铺动态
*/
public function stracelistOp(){
//查询收藏的店铺
$model_favorites = Model('favorites');
//条件
$where = array('member_id' => $_SESSION['member_id']);
$fav_store_id = $model_favorites->getStoreFavoritesList($where, 'fav_id');
// 整理
if(!empty($fav_store_id) && is_array($fav_store_id)){
$storeid_array = '';
foreach($fav_store_id as $val){
$storeid_array[] = $val['fav_id'];
}
$where = array(
'strace_storeid'=>array('in',$storeid_array),
'strace_state'=>1
);
$model_stracelog = Model('store_sns_tracelog');
$count = $model_stracelog->getStoreSnsTracelogCount($where);
//分页
$page = new Page();
$page->setEachNum(30);
$page->setStyle('admin');
$page->setTotalNum($count);
$delaypage = intval($_GET['delaypage'])>0?intval($_GET['delaypage']):1;//本页延时加载的当前页数
$lazy_arr = lazypage(10,$delaypage,$count,true,$page->getNowPage(),$page->getEachNum(),$page->getLimitStart());
//动态列表
$limit = $lazy_arr['limitstart'].",".$lazy_arr['delay_eachnum'];
$strace_array = $count = $model_stracelog->getStoreSnsTracelogList($where, '*', 'strace_id desc', $limit);
if (!empty($strace_array)){
foreach ($strace_array as $key=>$val){
if($val['strace_content'] == ''){
$val['strace_goodsdata'] = json_decode($val['strace_goodsdata'],true);
if( CHARSET == 'GBK') {
foreach ((array)$val['strace_goodsdata'] as $k=>$v){
$val['strace_goodsdata'][$k] = Language::getGBK($v);
}
}
$content = $model_stracelog->spellingStyle($val['strace_type'], $val['strace_goodsdata']);
$strace_array[$key]['strace_content'] = str_replace("%siteurl%", SHOP_SITE_URL.DS, $content);
}
}
}
Tpl::output('show_page',$page->show());
}
Tpl::output('hasmore',$lazy_arr['hasmore']);
Tpl::output('strace_array',$strace_array);
Tpl::output('type','index');
Tpl::showpage('member_storesns.tracelist','null_layout');
}
示例8: getStyleConfig
/**
* 主题配置信息
*
* @return array 数组格式的返回结果
*/
public function getStyleConfig()
{
$style_data = array();
$style_configurl = BASE_TPL_PATH . DS . 'store' . DS . 'style' . DS . "styleconfig.php";
if (file_exists($style_configurl)) {
include_once $style_configurl;
}
/**
* 转码
*/
if (strtoupper(CHARSET) == 'GBK') {
$style_data = Language::getGBK($style_data);
}
return $style_data;
}
示例9: __construct
public function __construct()
{
/**
* 读取通用、布局的语言包
*/
Language::read('common');
Language::read('home');
/**
* 判断本地生活是否关闭
*/
//if (C('offline_isuse') != '1'){
// header('location: '.SiteUrl);die;
//}
/**
* 设置模板文件夹路径
*/
Tpl::setDir('home');
/**
* 设置布局文件内容
*/
Tpl::setLayout('home_layout');
/**
* 转码
*/
if ($_GET['column'] && strtoupper(CHARSET) == 'GBK') {
$_GET = Language::getGBK($_GET);
}
/**
* 获取导航
*/
//Tpl::output('nav_list',($nav = F('nav'))? $nav :H('nav',true,'file'));
/**
* 本地生活Logo,标题
*/
Tpl::output('html_logo', C('offline_logo'));
Tpl::output('html_title', C('offline_style'));
/**
* 页面导航列表
*/
$nav_list = $this->nav_list();
Tpl::output('nav_list', $nav_list);
/**
* seo
*/
Tpl::output('seo_keywords', C('offlineshop_seo_keywords'));
Tpl::output('seo_description', C('offlineshop_seo_description'));
Tpl::output('index_sign', 'index');
}
示例10: __construct
protected function __construct()
{
Language::read('common,layout');
/**
* 验证用户是否登录
* $admin_info 管理员资料 name id
*/
$this->admin_info = $this->systemLogin();
if ($this->admin_info['id'] != 1) {
// 验证权限
$this->checkPermission();
}
//转码 防止GBK下用ajax调用时传汉字数据出现乱码
if (($_GET['branch'] != '' || $_GET['op'] == 'ajax') && strtoupper(CHARSET) == 'GBK') {
$_GET = Language::getGBK($_GET);
}
}
示例11: stracelistOp
/**
* 动态列表
*/
public function stracelistOp()
{
// where条件
$where = array();
if ($_POST['search_sname'] != '') {
$where['strace_storename'] = array('like', '%' . trim($_POST['search_sname']) . '%');
}
if ($_POST['search_scontent'] != '') {
$where['strace_content'] = array('like', '%' . trim($_POST['strace_content']) . '%');
}
if ($_POST['search_type'] != '') {
$where['strace_type'] = trim($_POST['search_type']);
}
if ($_POST['search_stime'] != '') {
$where['strace_time'] = array('egt', strtotime($_POST['search_stime']));
}
if ($_POST['search_etime'] != '') {
$where['strace_time'] = array('elt', strtotime($_POST['search_etime']));
}
// 实例化模型
$model_stracelog = Model('store_sns_tracelog');
$strace_list = Model('store_sns_tracelog')->getStoreSnsTracelogList($where, '*', 'strace_id desc', 0, 10);
if (!empty($strace_list) && is_array($strace_list)) {
foreach ($strace_list as $key => $val) {
if ($val['strace_content'] == '') {
$data = json_decode($val['strace_goodsdata'], true);
if (CHARSET == 'GBK') {
foreach ((array) $data as $k => $v) {
$data[$k] = Language::getGBK($v);
}
}
$content = $model_stracelog->spellingStyle($val['strace_type'], $data);
$strace_list[$key]['strace_content'] = str_replace("%siteurl%", SHOP_SITE_URL . DS, $content);
}
}
}
Tpl::output('show_page', $model_stracelog->showpage(2));
Tpl::output('strace_list', $strace_list);
Tpl::showpage('sns_strace.index');
}
示例12: searchOp
/**
* 搜索设置
*/
public function searchOp()
{
if (chksubmit()) {
$lang = Language::getLangContent();
$model_setting = Model('setting');
/**
* 转码 防止GBK下用中文逗号截取不正确
*/
$comma = ',';
if (strtoupper(CHARSET) == 'GBK') {
$comma = Language::getGBK($comma);
}
$result = $model_setting->updateSetting(array('hot_search' => str_replace($comma, ',', $_POST['hot_search'])));
if ($result) {
showMessage($lang['nc_common_save_succ']);
} else {
showMessage($lang['nc_common_save_fail']);
}
}
$model_setting = Model('setting');
$list_setting = $model_setting->getListSetting();
Tpl::output('list_setting', $list_setting);
Tpl::showpage('setting.search');
}
示例13: show_handle_pageOp
public function show_handle_pageOp()
{
$this->show_menu('inform_list');
$inform_id = intval($_GET['inform_id']);
$inform_goods_name = urldecode($_GET['inform_goods_name']);
if (strtoupper(CHARSET) == 'GBK') {
$inform_goods_name = Language::getGBK($inform_goods_name);
}
TPL::output('inform_id', $inform_id);
TPL::output('inform_goods_name', $inform_goods_name);
Tpl::showpage('inform.handle');
}
示例14: listOp
//.........这里部分代码省略.........
case 2:
$form = $lang['brand_form_used'];
$goods_form = 2;
break;
}
Tpl::output('form', $form);
}
/**
* 筛选类型
*/
$xianshi_flag = 0;
$group_flag = 0;
if (!empty($_GET['promotion'])) {
//当前选项
$promotion = '';
switch ($_GET['promotion']) {
case 'xianshi':
$promotion = $lang['nc_xianshi'];
$xianshi_flag = 1;
break;
case 'groupbuy':
$promotion = $lang['brand_index_groupbuy'];
$group_flag = 1;
break;
}
}
Tpl::output('promotion', $promotion);
/**
* 分页信息
*/
$page = new Page();
$page->setEachNum(40);
$page->setStyle('admin');
/**
* 得到地区id
*/
if (intval($_GET['area_id']) > 0) {
$area_id = intval($_GET['area_id']);
}
/**
* 得到商品列表
*/
$model_goods = Model('goods');
$ext_order = C('promotion_allow') ? 'xianshi_flag desc,goods_id desc' : 'goods_id desc';
$fieldstr = " goods.goods_id,goods.goods_name,goods.gc_id,goods.gc_name,goods.store_id,goods.goods_image,goods.goods_store_price,goods.spec_id,goods.goods_spec,\n\t\tgoods.goods_click,goods.goods_state,goods.goods_commend,goods.commentnum,goods.salenum,goods.goods_goldnum,goods.goods_isztc,\n\t\tgoods.goods_ztcstartdate,goods.goods_ztclastdate,goods.group_flag,goods.group_price,goods.xianshi_flag,goods.xianshi_discount,\n\t\tgoods.city_id,goods.province_id,goods.kd_price,goods.py_price,goods.es_price,\n\t\tstore.store_name,store.grade_id,store.store_domain,store.store_credit,store.praise_rate,store.store_desccredit";
$goods_list = $model_goods->getGoods(array('brand_id' => $brand_id, 'price' => $price_interval, 'group_flag' => $group_flag, 'xianshi_flag' => $xianshi_flag, 'province_id' => $area_id, 'goods_show' => '1', 'goods_form' => $goods_form, 'order' => $order ? $order . ',' . $ext_order : $ext_order), $page, $fieldstr, 'store');
// 直通车
if (C('gold_isuse') == 1 && C('ztc_isuse') == 1) {
$fieldstr = " goods.goods_id,goods.goods_name,goods.gc_id,goods.gc_name,goods.store_id,goods.goods_image,goods.goods_store_price,\n\t\t\tgoods.goods_click,goods.goods_state,goods.goods_commend,goods.commentnum,goods.salenum,goods.goods_goldnum,goods.goods_isztc,\n\t\t\tgoods.goods_ztcstartdate,goods.goods_ztclastdate";
$ztc_list = $model_goods->getGoods(array('brand_id' => $brand_id, 'goods_show' => '1', 'goods_isztc' => '1', 'goods_ztcopen' => '1', 'limit' => '8', 'order' => rand(1, 5)), '', $fieldstr, 'goods');
Tpl::output('ztc_list', $ztc_list);
}
/**
* 输出分页
*/
Tpl::output('show_page', $page->show());
/**
* 商品展示形式
*/
$display_mode = $_COOKIE['goodsDisplayMode'] ? $_COOKIE['goodsDisplayMode'] : 'squares';
//默认以方格展示
/**
* 整理商品列表
*/
if (!empty($goods_list) && is_array($goods_list)) {
//获得店铺等级名称
// $store_grade = F('store_grade');
// foreach ($goods_list as $key=>$goods){
// $goods_list[$key]['grade_name'] = $store_grade[$goods['grade_id']]['name'];
// }
//得到商品数
$goods_count = $page->getTotalNum();
Tpl::output('goods_count', $goods_count);
}
Tpl::output('goods_list', $goods_list);
/**
* 地区
*/
$area_url = BasePath . DS . 'data' . DS . 'area' . DS . 'area.php';
if (file_exists($area_url)) {
include_once $area_url;
}
if (strtoupper(CHARSET) == 'GBK') {
$area_array = Language::getGBK($area_array);
}
Tpl::output('area_array', $area_array);
/**
* 分类导航
*/
$nav_link = array(0 => array('title' => $lang['homepage'], 'link' => 'index.php'), 1 => array('title' => $lang['brand_index_all_brand'], 'link' => 'index.php?act=brand'), 2 => array('title' => $brand_lise['brand_name']));
Tpl::output('nav_link_list', $nav_link);
/**
* 页面输出
*/
Tpl::output('display_mode', $display_mode);
// Tpl::output('html_title',$lang['nc_brand'].'-'.$brand_lise['brand_name']);
Tpl::output('index_sign', 'brand');
Model('seo')->type('brand_list')->param(array('name' => $brand_lise['brand_name']))->show();
Tpl::showpage('brand_goods');
}
示例15: add_invOp
/**
* 新增发票信息
*
*/
public function add_invOp()
{
$model_inv = Model('invoice');
if (chksubmit()) {
//如果是增值税发票验证表单信息
if ($_POST['invoice_type'] == 2) {
if (empty($_POST['inv_company']) || empty($_POST['inv_code']) || empty($_POST['inv_reg_addr'])) {
exit(json_encode(array('state' => false, 'msg' => Language::get('nc_common_save_fail', 'UTF-8'))));
}
}
$data = array();
if ($_POST['invoice_type'] == 1) {
$data['inv_state'] = 1;
$data['inv_title'] = $_POST['inv_title_select'] == 'person' ? '个人' : $_POST['inv_title'];
$data['inv_content'] = $_POST['inv_content'];
} else {
$data['inv_state'] = 2;
$data['inv_company'] = $_POST['inv_company'];
$data['inv_code'] = $_POST['inv_code'];
$data['inv_reg_addr'] = $_POST['inv_reg_addr'];
$data['inv_reg_phone'] = $_POST['inv_reg_phone'];
$data['inv_reg_bname'] = $_POST['inv_reg_bname'];
$data['inv_reg_baccount'] = $_POST['inv_reg_baccount'];
$data['inv_rec_name'] = $_POST['inv_rec_name'];
$data['inv_rec_mobphone'] = $_POST['inv_rec_mobphone'];
$data['inv_rec_province'] = $_POST['area_info'];
$data['inv_goto_addr'] = $_POST['inv_goto_addr'];
}
$data['member_id'] = $_SESSION['member_id'];
//转码
$data = strtoupper(CHARSET) == 'GBK' ? Language::getGBK($data) : $data;
$insert_id = $model_inv->addInv($data);
if ($insert_id) {
exit(json_encode(array('state' => 'success', 'id' => $insert_id)));
} else {
exit(json_encode(array('state' => 'fail', 'msg' => Language::get('nc_common_save_fail', 'UTF-8'))));
}
} else {
Tpl::showpage('buy_address.add', 'null_layout');
}
}