public function __construct() { $this->serverUrl = getUpdateServer(); $this->key = trim(C("server_key")); $this->topdomain = trim(C("server_topdomain")); if (!$this->topdomain) { $this->topdomain = $this->getTopDomain(); } $this->token = $token; }
public function __construct($wxuser, $openid) { $this->wxid = $wxuser["wxid"]; $this->token = $wxuser["token"]; $this->openid = $openid; $this->serverUrl = getUpdateServer(); $this->key = trim(C("server_key")); $this->topdomain = trim(C("server_topdomain")); if (!$this->topdomain) { $this->topdomain = $this->getTopDomain(); } }
protected function _initialize(){ //检测终端类型 $userAgent=strtolower($_SERVER['HTTP_USER_AGENT']); if (strpos($userAgent,'alipayclient')){ $this->isFuwu=1; }elseif (strpos($userAgent,'micromessenger')){ $this->isWechat=1; } define('ALI_FUWU_GROUP',$this->check_fuwu_exist()); //检测电脑PC版 if(GROUP_NAME == 'Home' && MODULE_NAME == 'Index' && ACTION_NAME == 'index'){ $this->check_company_website(); } $own_domain=$this->_get('owndomain', 'trim');//用户手机站自定义域名或第三方服务器独立配置手机站标识参数 $rget=intval($this->_get('rget', 'trim'));//第三方服务器独立配置手机站标识参数 $this->owndomain=$own_domain && !empty($own_domain) ? $own_domain : false; $this->rget=$rget>0 ? $rget : 0; $nomsite=$_SESSION[$_SERVER['HTTP_HOST'].'nomsite']; if(!$this->owndomain && (GROUP_NAME!="User") && !$nomsite){ $this->check_mobile_website(); } if($this->_get('openId') != NULL){ $this->isQcloud = true; if(session('isQcloud') == NULL){ session('isQcloud',true); } } define('RES',THEME_PATH.'common'); define('STATICS',TMPL_PATH.'static'); $this->updateServerDomain = getUpdateServer(); $this->assign('action',$this->getActionName()); if (C('STATICS_PATH')){ $staticPath=''; }else { $staticPath='http://s.404.cn'; } $this->isAgent=0; if (C('agent_version')){ $thisAgent=M('agent')->where(array('siteurl'=>'http://'.$_SERVER['HTTP_HOST']))->find(); if ($thisAgent){ $this->isAgent=1; } } if (!$this->isAgent){ $this->agentid=0; if (!C('site_logo')){ $f_logo='tpl/Home/pigcms/common/images/logo-pigcms.png'; }else { $f_logo=C('site_logo'); } $f_siteName=C('SITE_NAME'); $f_siteTitle=C('SITE_TITLE'); $f_metaKeyword=C('keyword'); $f_metaDes=C('content'); $f_qq=C('site_qq'); $f_ipc=C('ipc'); $f_qrcode='tpl/Home/pigcms/common/images/ewm2.jpg'; $f_siteUrl=C('site_url'); $this->home_theme=C('DEFAULT_THEME'); $f_regNeedMp=C('reg_needmp')=='true'?1:0; $this->reg_needCheck=C('ischeckuser')=='false'?1:0; $this->minGroupid=1; $this->reg_validDays=C('reg_validdays'); $this->reg_groupid=C('reg_groupid'); $this->adminMp=C('site_mp'); }else { $this->agentid=$thisAgent['id']; $this->thisAgent=$thisAgent; if (!C('site_logo')){ $f_logo='tpl/Home/pigcms/common/images/logo-pigcms.png'; }else { if($thisAgent['sitelogo'] == ''){ $f_logo=C('site_logo'); }else{ $f_logo=$thisAgent['sitelogo']; } } $f_siteName=$thisAgent['sitename']; $f_siteTitle=$thisAgent['sitetitle']; $f_metaKeyword=$thisAgent['metakeywords']; $f_metaDes=$thisAgent['metades']; $f_qq=$thisAgent['qq']; $f_qrcode=$thisAgent['qrcode']; $f_siteUrl=$thisAgent['siteurl']; $f_ipc=$thisAgent['copyright']; $this->home_theme=C('DEFAULT_THEME'); if (file_exists($_SERVER['DOCUMENT_ROOT'].'/tpl/Home/'.'agent_'.$thisAgent['id'])){ $this->home_theme='agent_'.$thisAgent['id']; } $f_regNeedMp=$thisAgent['regneedmp']; $this->reg_needCheck=$thisAgent['needcheckuser']; $minGroup=M('User_group')->where(array('agentid'=>$thisAgent['id']))->order('id ASC')->find(); $this->minGroupid=$minGroup['id']; $this->reg_validDays=$thisAgent['regvaliddays']; $this->reg_groupid=$thisAgent['reggid']; $this->adminMp=$thisAgent['mp']; } if(empty($staticPath) && ($rget==3) && !empty($own_domain)){ $staticPath=$f_siteUrl; /**第三方服务器独立配置手机站时文件资源地址需要本站的**/ } $this->staticPath=$staticPath; $this->assign('staticPath',$staticPath); define('STATICS',$staticPath.'/tpl/static'); //********************/ if (!$f_siteUrl){ $f_siteUrl='http://'.$_SERVER['SERVER_NAME']; } $this->siteUrl=$f_siteUrl; $this->f_logo=$f_logo; $this->assign('f_logo',$f_logo); $this->assign('f_siteName',$f_siteName); $this->assign('f_siteTitle',$f_siteTitle); $this->assign('f_metaKeyword',$f_metaKeyword); $this->assign('f_metaDes',$f_metaDes); $this->assign('f_qq',$f_qq); $this->assign('f_qrcode',$f_qrcode); $this->assign('f_siteUrl',$f_siteUrl); $this->assign('f_regNeedMp',$f_regNeedMp); $this->assign('f_ipc',$f_ipc); $this->assign('reg_validDays',$this->reg_validDays); //******************/ }