private function contactData(GWF_User $user) { require_once GWF_CORE_PATH . 'module/Profile/GWF_Profile.php'; if (false === ($p = GWF_Profile::getProfile($user->getID()))) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } if ($p->isGuestHidden() || $p->isHiddenLevel(0)) { return ''; } $back = ''; if ('' !== ($v = $p->getVar('prof_firstname'))) { $back .= 'FirstName:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_lastname'))) { $back .= 'LastName:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_street'))) { $back .= 'Street:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_city'))) { $back .= 'City:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_zip'))) { $back .= 'ZIPCode:' . $v . PHP_EOL; } if ($p->isContactHiddenLevel(0)) { return $back; } if ($user->isOptionEnabled(GWF_User::SHOW_EMAIL)) { if ('' !== ($v = $user->displayEMail())) { $back .= 'EMail:' . $v . PHP_EOL; } } if ('' !== ($v = $p->getVar('prof_tel'))) { $back .= 'Tel:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_mobile'))) { $back .= 'Mobile:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_icq'))) { $back .= 'ICQ:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_msn'))) { $back .= 'MSN:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_jabber'))) { $back .= 'Jabber:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_skype'))) { $back .= 'Skype:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_yahoo'))) { $back .= 'Yahoo!:' . $v . PHP_EOL; } if ('' !== ($v = $p->getVar('prof_aim'))) { $back .= 'AIM:' . $v . PHP_EOL; } return $back; }
private function profile(GWF_User $user) { if (false === ($profile = GWF_Profile::getProfile($user->getID()))) { return GWF_HTML::err('ERR_UNKNOWN_USER'); } $watcher = GWF_User::getStaticOrGuest(); if ($profile->isRobotHidden() && $watcher->isWebspider()) { return $this->module->error('err_no_spiders'); } if (false === ($prof_view = GWF_Session::getOrDefault('prof_view', false))) { $prof_view = array(); } $uid = $user->getID(); if (!in_array($uid, $prof_view, true)) { $prof_view[] = $uid; if (false === $profile->increase('prof_views', 1)) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } } GWF_Session::set('prof_view', $prof_view); $tVars = array('user' => $user, 'profile' => $profile, 'jquery' => Common::getGet('ajax') !== false); return $this->module->templatePHP('profile.php', $tVars); }
private function onSaveSettings() { $form = $this->formSettings(); if (false !== ($error = $form->validate($this->module))) { return $error; } $profile = GWF_Profile::getProfile(GWF_Session::getUserID()); if (!$profile->saveOption(GWF_Profile::POI_WHITELIST, isset($_POST['use_white']))) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } return $this->module->message('msg_edited'); }
private function getForm(GWF_Profile $profile) { $href_poi_white = GWF_WEB_ROOT . 'index.php?mo=Profile&me=POISWhitelist'; $data = array('firstname' => array(GWF_Form::STRING, $profile->getVar('prof_firstname'), $this->module->lang('th_firstname'), '', 32, false), 'lastname' => array(GWF_Form::STRING, $profile->getVar('prof_lastname'), $this->module->lang('th_lastname'), '', 32, false), 'street' => array(GWF_Form::STRING, $profile->getVar('prof_street'), $this->module->lang('th_street'), '', 32, false), 'zip' => array(GWF_Form::STRING, $profile->getVar('prof_zip'), $this->module->lang('th_zip'), '', 6, false), 'city' => array(GWF_Form::STRING, $profile->getVar('prof_city'), $this->module->lang('th_city'), '', 32, false), 'div1' => array(GWF_Form::DIVIDER), 'tel' => array(GWF_Form::STRING, $profile->getVar('prof_tel'), $this->module->lang('th_tel'), '', 16, false), 'mobile' => array(GWF_Form::STRING, $profile->getVar('prof_mobile'), $this->module->lang('th_mobile'), '', 16, false), 'div2' => array(GWF_Form::DIVIDER), 'website' => array(GWF_Form::STRING, $profile->getVar('prof_website'), $this->module->lang('th_website'), '', 32, false), 'icq' => array(GWF_Form::STRING, $profile->getVar('prof_icq'), $this->module->lang('th_icq'), '', 16, false), 'msn' => array(GWF_Form::STRING, $profile->getVar('prof_msn'), $this->module->lang('th_msn'), '', 32, false), 'jabber' => array(GWF_Form::STRING, $profile->getVar('prof_jabber'), $this->module->lang('th_jabber'), '', 32, false), 'skype' => array(GWF_Form::STRING, $profile->getVar('prof_skype'), $this->module->lang('th_skype'), '', 32, false), 'yahoo' => array(GWF_Form::STRING, $profile->getVar('prof_yahoo'), $this->module->lang('th_yahoo'), '', 32, false), 'aim' => array(GWF_Form::STRING, $profile->getVar('prof_aim'), $this->module->lang('th_aim'), '', 32, false), 'irc' => array(GWF_Form::STRING, $profile->getVar('prof_irc'), $this->module->lang('th_irc'), '', 32, false), 'div3' => array(GWF_Form::DIVIDER), 'about_me' => array(GWF_Form::MESSAGE, $profile->getVar('prof_about_me'), $this->module->lang('th_about_me'), '', 0, false), 'hidecountry' => array(GWF_Form::CHECKBOX, $profile->isCountryHidden(), $this->module->lang('th_hidecountry')), 'hideguests' => array(GWF_Form::CHECKBOX, $profile->isGuestHidden(), $this->module->lang('th_hideguest')), 'hiderobots' => array(GWF_Form::CHECKBOX, $profile->isRobotHidden(), $this->module->lang('th_hiderobot'), $this->module->lang('tt_hiderobot')), 'level_all' => array(GWF_Form::INT, $profile->getVar('prof_level_all'), $this->module->lang('th_level_all'), $this->module->lang('tt_level_all'), 5, true), 'level_contact' => array(GWF_Form::INT, $profile->getVar('prof_level_contact'), $this->module->lang('th_level_contact'), $this->module->lang('tt_level_contact'), 5, true), 'div4' => array(GWF_Form::DIVIDER), 'poi_score' => array(GWF_Form::INT, $profile->getVar('prof_poi_score'), $this->l('th_poi_score'), $this->l('tt_poi_score'), 5, true), 'poi_white' => array(GWF_Form::CHECKBOX, $profile->isPOIWhitelisting(), $this->l('th_poi_white', $href_poi_white), $this->l('tt_poi_white')), 'edit' => array(GWF_Form::SUBMIT, $this->module->lang('btn_edit'))); return new GWF_Form($this, $data); }