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 getProfile() { return GWF_Profile::getProfile(GWF_Session::getUserID()); }