public function templateChalls(GWF_User $user) { $whitelist = array('chall_score', 'chall_title', 'chall_creator_name', 'chall_solvecount', 'chall_date', 'chall_dif', 'chall_edu', 'chall_fun', 'csolve_date', 'csolve_time_taken'); require_once GWF_CORE_PATH . 'module/WeChall/WC_ChallSolved.php'; $challs = GDO::table('WC_Challenge'); $db = gdo_db(); $uid = $user->getVar('user_id'); $challs = GWF_TABLE_PREFIX . 'wc_chall'; $solved = GWF_TABLE_PREFIX . 'wc_chall_solved'; $by = GDO::getWhitelistedByS(Common::getGet('pcby'), $whitelist, self::DEFAULT_BY); $dir = GDO::getWhitelistedDirS(Common::getGet('pcdir'), self::DEFAULT_DIR); $orderby = "ORDER BY {$by} {$dir}"; $query = "SELECT c.*, s.* FROM {$challs} c LEFT JOIN {$solved} s ON c.chall_id=s.csolve_cid AND s.csolve_uid={$uid} {$orderby}"; $tVars = array('data' => $db->queryAll($query), 'sort_url' => GWF_WEB_ROOT . 'index.php?mo=Profile&me=Profile&username='******'user_name') . '&pcby=%BY%&pcdir=%DIR%#wc_profile_challenges', 'table_title' => $this->module->lang('tt_challs_for', array('', $user->display('user_name')))); return $this->module->templatePHP('challs_profile.php', $tVars); }
private static function sendMail(Module_Account $module, GWF_User $user, array $data) { $token = GWF_AccountChange::createToken($user->getID(), 'demo', serialize($data)); $mail = new GWF_Mail(); $mail->setSender($module->cfgMailSender()); $mail->setReceiver($user->getVar('user_email')); $mail->setSubject($module->lang('chdemo_subj')); $username = $user->display('user_name'); $timeout = GWF_Time::humanDuration($module->cfgChangeTime()); $gender = GWF_HTML::display($user->getVar('user_gender')); $country = GWF_Country::getByIDOrUnknown($data['user_countryid'])->display('country_name'); $lang1 = GWF_Language::getByIDOrUnknown($data['user_langid'])->display('lang_nativename'); $lang2 = GWF_Language::getByIDOrUnknown($data['user_langid2'])->display('lang_nativename'); $gender = GWF_HTML::lang('gender_' . $data['user_gender']); $birthdate = $data['user_birthdate'] > 0 ? GWF_Time::displayDate($data['user_birthdate'], true, 1) : GWF_HTML::lang('unknown'); $link = self::getChangeLink($user->getID(), $token); $mail->setBody($module->lang('chdemo_body', array($username, $timeout, $gender, $country, $lang1, $lang2, $birthdate, $link))); return $mail->sendToUser($user) ? $module->message('msg_mail_sent') : GWF_HTML::err('ERR_MAIL_SENT'); }
private function getSEOTitle() { if ($this->pm === false) { return $this->module->lang('ft_create', array($this->rec->display('user_name'))); } else { return $this->module->lang('ft_reply', array($this->rec->display('user_name'))); } }
public function validate_ignore(GWF_User $recipient) { if (false === ($user = GWF_Session::getUser())) { return false; } if (false !== ($message = GWF_PMIgnore::isIgnored($recipient->getID(), $user->getID()))) { return $this->lang('err_ignored', array($recipient->display('user_name'), htmlspecialchars($message))); } return false; }
public function getIgnoreHREF(GWF_User $user) { return GWF_WEB_ROOT . sprintf('pm/do/ignore/%d/%s', $user->getID(), $user->display('user_name')); }