コード例 #1
0
ファイル: userprofile.php プロジェクト: h3len/Project
 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');
 }