本文整理汇总了PHP中GWF_User::displayUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_User::displayUsername方法的具体用法?PHP GWF_User::displayUsername怎么用?PHP GWF_User::displayUsername使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_User
的用法示例。
在下文中一共展示了GWF_User::displayUsername方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAssign
public function onAssign(GWF_HelpdeskTicket $ticket, GWF_User $user)
{
if (false === $ticket->saveVars(array('hdt_worker' => $user->getID(), 'hdt_status' => 'working'))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_assigned', array($ticket->getID(), $user->displayUsername()));
}
示例2: sendMail
private function sendMail(GWF_User $user)
{
if ('' === ($email = $user->getValidMail())) {
return $this->module->error('err_no_mail');
}
$sender = $this->module->getMailSender();
$username = $user->displayUsername();
$link = $this->getRequestLink($user);
$body = $this->module->lang('mail_body', array($username, $sender, $link));
$mail = new GWF_Mail();
$mail->setSender(GWF_SUPPORT_EMAIL);
$mail->setReceiver($email);
$mail->setSubject($this->module->lang('mail_subj'));
$mail->setBody($body);
return $mail->sendToUser($user) ? $this->module->message('msg_sent_mail', array('<em>' . GWF_HTML::display(GWF_HTML::lang('unknown')) . '</em>')) : GWF_HTML::err('ERR_MAIL_SENT');
}
示例3: templateHistory
private function templateHistory(GWF_User $user)
{
require_once GWF_CORE_PATH . 'module/WeChall/WC_SiteDescr.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_HistoryUser2.php';
$uid = $user->getID();
$ipp = 50;
$history = GDO::table('WC_HistoryUser2');
$nItems = $history->countRows("userhist_uid={$uid}");
$nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
$page = Common::clamp(Common::getGet('page', 1), 1, $nPages);
$from = GWF_PageMenu::getFrom($page, $ipp);
$by = Common::getGet('by', '');
$dir = Common::getGet('dir', '');
$orderby = $history->getMultiOrderby($by, $dir);
$uuname = $user->urlencode2('user_name');
$duname = $user->displayUsername();
GWF_Website::setPageTitle($this->module->lang('pt_texthis', array($duname)));
GWF_Website::setMetaDescr($this->module->lang('md_texthis', array($duname)));
GWF_Website::setMetaTags($this->module->lang('mt_texthis', array($duname)));
$tVars = array('user' => $user, 'duname' => $duname, 'sites' => WC_Site::getSites('site_id'), 'data' => $history->selectObjects('*', "userhist_uid={$uid}", $orderby, $ipp, $from), 'sort_url' => GWF_WEB_ROOT . 'history/for/' . $uuname . '/by/%BY%/%DIR%/page-1', 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'history/for/' . $uuname . '/by/' . urlencode($by) . '/' . urlencode($dir) . '/page-%PAGE%'));
return $this->module->templatePHP('text_history.php', $tVars);
}
示例4: isExcludedFromAPI
public function isExcludedFromAPI(GWF_User $user, $override_pass = false)
{
$data = $user->getUserData();
if (!isset($data['WC_NO_XSS'])) {
return false;
}
if (isset($data['WC_NO_XSS_PASS']) && $override_pass === $data['WC_NO_XSS_PASS']) {
return false;
}
return sprintf('The user %s does not want to be included in API calls.', $user->displayUsername());
}
示例5: wcProfileOwnLinks
function wcProfileOwnLinks(GWF_User $user, Module_Links $mod_links)
{
$linksT = GDO::table('GWF_Links');
$user_browsing = GWF_Session::getUser();
$perm_query = $mod_links->cfgShowPermitted() ? '1' : $mod_links->getPermQuery($user_browsing);
$mod_query = $linksT->getModQuery($user_browsing);
$member_query = $linksT->getMemberQuery($user_browsing);
$private_query = $linksT->getPrivateQuery($user_browsing);
$aff_query = $linksT->getUnaffQuery($user_browsing);
$conditions = "({$perm_query}) AND ({$mod_query}) AND ({$member_query}) AND ({$private_query}) AND ({$aff_query})";
// $mod_links->onInclude();
// $mod_links->onLoadLanguage();
$links = $linksT->getTableName();
$votes = GDO::table('GWF_VoteScore')->getTableName();
$private = GWF_Links::ONLY_PRIVATE;
$userid = $user->getID();
$query = "SELECT {$links}.*, {$votes}.* FROM {$links} JOIN {$votes} ON vs_id=link_voteid WHERE link_user={$userid} AND {$conditions}";
// var_dump($query);
$db = gdo_db();
if (false === ($result = $db->queryRead($query))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
$links = array();
while (false !== ($row = $db->fetchAssoc($result))) {
$links[] = new GWF_Links($row);
# $linksT->createClass($row);
}
if (0 === ($count = count($links))) {
return '';
}
return '<h2>' . WC_HTML::lang('own_links', array($user->displayUsername(), $count)) . '</h2>' . $mod_links->templateLinks($links, '', '', '', false, false, false, false);
}
示例6: sendModMailB
private function sendModMailB(GWF_Download $dl, GWF_User $uploader, GWF_User $staff)
{
if ('' === ($rec = $staff->getValidMail())) {
return;
}
$mail = new GWF_Mail();
$mail->setSender(GWF_BOT_EMAIL);
$mail->setReceiver($rec);
$mail->setSubject($this->module->langUser($staff, 'mod_mail_subj'));
$token = $dl->getHashcode();
$dlid = $dl->getID();
$url1 = "index.php?mo=Download&me=Moderate&token={$token}&dlid={$dlid}&action=download";
$url2 = "index.php?mo=Download&me=Moderate&token={$token}&dlid={$dlid}&action=allow";
$url3 = "index.php?mo=Download&me=Moderate&token={$token}&dlid={$dlid}&action=delete";
$args = array($staff->displayUsername(), $uploader->displayUsername(), $dl->display('dl_filename'), $dl->display('dl_realname'), $dl->display('dl_mime'), $dl->getFilesize(), $dl->display('dl_descr'), Common::getAbsoluteURL($url1, true), Common::getAbsoluteURL($url2, true), Common::getAbsoluteURL($url3, true));
$mail->setBody($this->module->langUser($staff, 'mod_mail_body', $args));
$mail->sendToUser($staff);
}
示例7: sendAlertMail
public static function sendAlertMail(Module_Account $module, GWF_User $user, $record_alert = 'record_alert')
{
if ($receive_mail = $user->getValidMail()) {
$module->onLoadLanguage();
$mail = new GWF_Mail();
$mail->setSender(GWF_BOT_EMAIL);
$sig = $module->lang("mail_signature");
$mail->setSenderName($sig);
$mail->setReceiver($receive_mail);
$mail->setSubject($module->lang("mails_{$record_alert}"));
$url = Common::getAbsoluteURL($module->getMethodURL('Access'));
$mail->setBody($module->lang("mailb_record_alert", array($user->displayUsername(), $module->lang("mailv_{$record_alert}"), GWF_HTML::display($_SERVER['HTTP_USER_AGENT']), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']), GWF_HTML::anchor($url, $url, 'Manage IP recording'), $sig)));
$mail->sendToUser($user);
}
}
示例8: sendSubscriptionB
private static function sendSubscriptionB(Module_Forum $module, GWF_ForumThread $thread, GWF_User $user, $postername, $msg_block, $msg_count, $boardText, $threadTitle, $sender)
{
$userid = $user->getID();
$username = $user->displayUsername();
if (false === ($receiver = $user->getValidMail())) {
GWF_Log::logCron('[ERROR] User ' . $username . ' has no valid email.');
return false;
}
if (false === ($options = GWF_ForumOptions::getUserOptions($user))) {
GWF_Log::logCron('[ERROR] User ' . $username . ' has no valid forum options.');
}
$token = $options->getVar('fopt_token');
$href = Common::getAbsoluteURL($thread->getLastPageHREF(false), false);
$showLink = GWF_HTML::anchor($href, $href);
$href = Common::getAbsoluteURL($thread->getExternalUnSubscribeHREF($userid, $token, true), false);
$unsubLink = GWF_HTML::anchor($href, $href);
$href = Common::getAbsoluteURL($thread->getExternalUnSubscribeAllHREF($userid, $token, true), false);
$unsubLinkAll = GWF_HTML::anchor($href, $href);
$mail = new GWF_Mail();
$mail->setSender($sender);
$mail->setReceiver($receiver);
$mail->setSubject($module->langUser($user, 'submail_subj', array($threadTitle, $postername, $boardText)));
$mail->setBody($module->langUser($user, 'submail_body', array($username, $msg_count, $boardText, $threadTitle, $msg_block, $showLink, $unsubLink, $unsubLinkAll)));
if (false === $mail->sendToUser($user)) {
GWF_Log::logCron('[ERROR] Can not send mail to ' . $username . '; EMail: ' . $receiver);
} else {
GWF_Log::logCron('[+] Successfully sent Email to ' . $username . '; EMail: ' . $receiver);
}
}
示例9: sendWelcomePM
private function sendWelcomePM(GWF_User $user)
{
$this->onLoadLanguage();
$title = $this->lang('wpm_title');
$message = $this->lang('wpm_message', array($user->displayUsername()));
if (0 > $this->deliver($this->cfgBotUserID(), $user->getID(), $title, $message)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return true;
}
示例10: onRequestMail
private function onRequestMail(GWF_Group $group, GWF_User $user, GWF_UsergroupsInvite $request)
{
if (false === ($leader = $group->getFounder())) {
return false;
}
if ('' === ($email = $leader->getValidMail())) {
return false;
}
$userid = $user->getID();
$groupid = $group->getID();
$token = $request->getHashcode();
$link = Common::getAbsoluteURL('index.php?mo=Usergroups&me=Accept&uid=' . $userid . '&gid=' . $groupid . '&token=' . $token);
$link = GWF_HTML::anchor($link, $link);
$mail = new GWF_Mail();
$mail->setSender(GWF_BOT_EMAIL);
$mail->setReceiver($email);
$mail->setSubject($this->module->lang('mail_subj_req', array($user->displayUsername(), $group->display('group_name'))));
$mail->setBody($this->module->lang('mail_body_req', array($leader->displayUsername(), $user->displayUsername(), $group->display('group_name'), $link)));
return $mail->sendToUser($leader);
}
示例11: onSendCommentedMailB
private function onSendCommentedMailB($user, GWF_Comment $comment, GWF_User $admin)
{
if ('' === ($rec = $admin->getValidMail())) {
return;
}
$username = $user === false ? $_POST['username'] : $user->getVar('user_name');
$username = htmlspecialchars($username);
$www = htmlspecialchars(Common::getPostString('www', ''));
$email = htmlspecialchars(Common::getPostString('email', ''));
$href_delete = Common::getAbsoluteURL('index.php?mo=Comments&me=Moderate&delete=' . $comment->getID() . '&ctoken=' . $comment->getHashcode());
$args = array($admin->displayUsername(), $username, $email, $www, $comment->display('cmt_message'), $href_delete);
$mail = new GWF_Mail();
$mail->setSender(GWF_BOT_EMAIL);
$mail->setReceiver($rec);
$mail->setSubject($this->module->langUser($admin, 'subj_cmt'));
$mail->setBody($this->module->langUser($admin, 'body_cmt', $args));
$mail->sendToUser($admin);
}
示例12: onLinkSiteMail
private function onLinkSiteMail(WC_Site $site, GWF_User $user, $onsitename, $onsitemail)
{
$userid = $user->getID();
$link = Common::getAbsoluteURL(sprintf('link_site/%d/%s/to/%d/as/%s/%s', $site->getID(), $site->urlencode('site_name'), $userid, urlencode($onsitename), $site->getLinkToken($userid, $onsitename)));
$link = GWF_HTML::anchor($link, $link);
$mail = new GWF_Mail();
$mail->setSender(GWF_BOT_EMAIL);
$mail->setReceiver($onsitemail);
$mail->setSubject($this->module->lang('mail_link_subj', array($site->display('site_name'))));
$mail->setBody($this->module->lang('mail_link_body', array($user->displayUsername(), $site->displayName(), $link)));
$mail->setAllowGPG(false);
return $mail->sendToUser($user) ? $this->module->message('msg_linkmail_sent') : GWF_HTML::err('ERR_MAIL_SENT');
}
示例13: displayLogoU
/**
* Display logo for a user.
* @param GWF_User $user
* @param unknown_type $solved
* @param unknown_type $min
* @param unknown_type $max
* @param unknown_type $pad
* @return unknown_type
*/
public function displayLogoU(GWF_User $user, $solved, $min = 2, $max = 32, $pad = false)
{
$username = $user->displayUsername();
return $this->displayLogoUN($user->displayUsername(), $solved, $min, $max, $pad);
}