function __construct() { parent::__construct(); $this->userinfo['id'] = $this->input['id']; $this->userinfo['username'] = urldecode($this->input['username']); $this->userinfo['email'] = urldecode($this->input['email']); //获取发邮件配置 require ROOT_PATH . 'lib/class/uset.class.php'; $mUset = new uset(); $arr = array('emailsend', 'emailwrapbracket', 'emailtype', 'usessl', 'smtphost', 'smtpport', 'smtpuser', 'smtppassword', 'email_footer', 'email_title', 'system_name', 'verify_url', 'email_content', 'pwd_title', 'pwd_content', 'pwd_verify_url'); $rt = $mUset->get_desig_uset($arr); unset($rt['result']); $config = array(); foreach ($rt as $k => $v) { $config[$v['identi']] = $v['status']; } $this->settings = $config; $this->from = $this->settings['emailsend']; $this->emailwrapbracket = $this->settings['emailwrapbracket']; if ($this->settings['emailtype'] == 'smtp') { $this->emailtype = 'smtp'; $this->smtpport = empty($this->settings['smtpport']) ? 25 : intval($this->settings['smtpport']); $this->smtphost = empty($this->settings['smtphost']) ? 'localhost' : $this->settings['smtphost']; if ($this->settings['usessl']) { $this->smtphost = 'ssl://' . $this->smtphost; } $this->smtpuser = $this->settings['smtpuser']; $this->smtppassword = $this->settings['smtppassword']; } $this->boundry = "----=_NextPart_000_0022_01C1BD6C.D0C0F9F0"; $this->settings['system_name'] = $this->clean_message($this->settings['system_name']); $this->from_user = $this->settings['system_name']; }
function show() { $info = $this->info->getUserById($this->user['id'], "all"); $this->userinfo = $info[0]; $this->location = explode('-', $this->userinfo['location']); $this->birth = explode('-', $this->userinfo['birthday']); $this->getOption(); $this->getPrivacyOption(); hg_add_head_element('js-c', "\r\n\t\tvar userInfo ={\r\n\t\t\t\tprovince:" . json_encode($this->location[0]) . ",\r\n\t\t\t\tcity:" . json_encode($this->location[1]) . ",\r\n\t\t\t\tcountry:" . json_encode($this->location[2]) . "\r\n\t\t};\r\n\t\tvar show_location = " . (SHOW_LOCATION ? SHOW_LOCATION : 0) . ";\r\n\t\t"); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'zone.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'userprofile.js'); $gScriptName = SCRIPTNAME; $this->page_title = '个人资料'; //是否允许修改用户名 require ROOT_PATH . 'lib/class/uset.class.php'; $mUset = new uset(); $rt = $mUset->get_uset_array('modify_username'); if ($rt['modify_username'] == 1) { $edit_username = 1; } $this->tpl->addVar('birthday', $this->birthday); $this->tpl->addVar('edit_username', $edit_username); $this->tpl->addVar('userinfo', $this->userinfo); $this->tpl->addVar('privacy', $this->privacy); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->outTemplate('userprofile'); }