本文整理汇总了PHP中UserUtils::getUserName方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtils::getUserName方法的具体用法?PHP UserUtils::getUserName怎么用?PHP UserUtils::getUserName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtils
的用法示例。
在下文中一共展示了UserUtils::getUserName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getUserInfos
private function _getUserInfos($uid, $longitude, $latitude, $radius, $page, $pageSize)
{
$userInfos = array('count' => 0, 'list' => array());
$count = SurroundingInfo::getUserCountByUid($uid, $longitude, $latitude, $radius);
$surroundUsers = SurroundingInfo::getAllUsersByUid($uid, $longitude, $latitude, $radius, $page, $pageSize);
$list = array();
foreach ($surroundUsers as $user) {
$userInfo = array();
$tmpUid = (int) $user['object_id'];
$userInfo['uid'] = $tmpUid;
$userInfo['distance'] = $user['distance'];
$userInfo['location'] = $user['location'];
$userInfo['nickname'] = UserUtils::getUserName($tmpUid);
$userInfo['gender'] = UserUtils::getUserGender($tmpUid);
$userInfo['status'] = UserUtils::getUserLoginStatus($tmpUid) == UserUtils::STATUS_ONLINE ? 1 : 0;
$userInfo['icon'] = UserUtils::getUserAvatar($tmpUid);
// $userInfo['is_friend'] = UserUtils::isFriend($uid, $tmpUid) ? 1 : 0;
$userInfo['is_friend'] = UserUtils::isFollow($uid, $tmpUid) ? 1 : 0;
$userInfo['is_black'] = UserUtils::isBlacklist($uid, $tmpUid) ? 1 : 0;
$list[] = $userInfo;
}
$userInfos['count'] = $count;
$userInfos['list'] = $list;
return $userInfos;
}
示例2: _transTopicList
private function _transTopicList($topicList, $type)
{
$list = array();
global $_G;
$forum = $_G['forum'];
foreach ($topicList as $topic) {
$tmpTopicInfo = ForumUtils::getTopicInfo((int) $topic);
$topicSummary = ForumUtils::getTopicSummary((int) $topic);
$topicInfo['board_id'] = (int) $tmpTopicInfo['fid'];
$topicInfo['board_name'] = $fid != 0 ? $forum['name'] : ForumUtils::getForumName($tmpTopicInfo['fid']);
$topicInfo['board_name'] = WebUtils::emptyHtml($topicInfo['board_name']);
$topicInfo['topic_id'] = (int) $topic;
$topicInfo['type_id'] = (int) $tmpTopicInfo['typeid'];
$topicInfo['sort_id'] = (int) $tmpTopicInfo['sortid'];
$topicInfo['title'] = WebUtils::emptyHtml($tmpTopicInfo['subject']);
$topicSummary['msg'] = WebUtils::emptyReturnLine($topicSummary['msg'], ' ');
$topicInfo['subject'] = $topicSummary['msg'];
$topicInfo['user_id'] = (int) $tmpTopicInfo['authorid'];
if ($type = 'favorite' && empty($tmpTopicInfo['author'])) {
$dateline = UserTopicInfo::getUserfavorite($_G['uid'], $topic);
$topicInfo['last_reply_date'] = $dateline . '000';
$topicInfo['user_nick_name'] = UserUtils::getUserName($dateline['uid']);
} else {
$topicInfo['last_reply_date'] = $tmpTopicInfo['dateline'] . '000';
$topicInfo['user_nick_name'] = (string) $tmpTopicInfo['author'];
}
$topicInfo['hits'] = (int) $tmpTopicInfo['views'];
$topicInfo['replies'] = (int) $tmpTopicInfo['replies'];
$topicInfo['top'] = (int) ForumUtils::isTopTopic($topic) ? 1 : 0;
$topicInfo['status'] = (int) $tmpTopicInfo['status'];
$topicInfo['essence'] = (int) $tmpTopicInfo['digest'] ? 1 : 0;
$topicInfo['hot'] = (int) $tmpTopicInfo['highlight'] ? 1 : 0;
$topicInfo['pic_path'] = ImageUtils::getThumbImage($topicSummary['image']);
$list[] = $topicInfo;
}
return $list;
}
示例3: _userBlackSetting
private function _userBlackSetting($res, $blackUid)
{
global $_G;
$uid = $_G['uid'];
$blackName = UserUtils::getUserName($blackUid);
require_once libfile('function/friend');
if (!($blackName = C::t('common_member')->fetch_by_username($blackName))) {
$res = $this->makeErrorInfo($res, 'space_does_not_exist');
} elseif ($blackUid == $uid) {
$res = $this->makeErrorInfo($res, 'unable_to_manage_self');
} else {
friend_delete($blackUid);
C::t('home_blacklist')->insert(array('uid' => $uid, 'buid' => $blackUid, 'dateline' => $_G['timestamp']), false, false, true);
$params['noError'] = 1;
$res = $this->makeErrorInfo($res, 'do_success', $params);
}
return $res;
}
示例4: _transUserList
private function _transUserList($users, $viewUid, $longitude, $latitude, $radius, $page, $pageSize, $sortType)
{
loadcache('usergroups');
$list = array();
foreach ($users as $user) {
if ($sortType == 'range') {
$tmpUserInfo['distance'] = (string) $user['distance'];
$tmpUserInfo['location'] = (string) WebUtils::t($user['location']);
$uid = $user['uid'];
} else {
$tmpUserInfo['distance'] = '';
$tmpUserInfo['location'] = '';
$uid = $user;
}
$tmpUserInfo['is_friend'] = UserUtils::isFollow($viewUid, $uid) ? 1 : 0;
$tmpUserInfo['isFriend'] = UserUtils::isFriend($viewUid, $uid) ? 1 : 0;
$tmpUserInfo['isFollow'] = UserUtils::isFollow($viewUid, $uid) ? 1 : 0;
$tmpUserInfo['uid'] = (int) $uid;
$tmpUserInfo['name'] = UserUtils::getUserName($uid);
$tmpUserInfo['name'] = WebUtils::emptyHtml($tmpUserInfo['name']);
$tmpUserInfo['status'] = (int) UserUtils::getUserLoginStatus($uid);
$tmpUserInfo['is_black'] = UserUtils::isBlacklist($viewUid, $uid) ? 1 : 0;
$tmpUserInfo['gender'] = (int) UserUtils::getUserGender($uid);
$tmpUserInfo['icon'] = UserUtils::getUserAvatar($uid);
$tmpUserInfo['level'] = (int) DzCommonUserList::getUserLevel($uid);
$lastLogin = WebUtils::t(DzCommonUserList::getUserLastVisit($uid));
$tmpUserInfo['lastLogin'] = $lastLogin . '000';
if ($sortType == 'regdate') {
$lastRegdate = DzCommonUserList::getUserLastRegdate($uid);
$tmpUserInfo['dateline'] = $lastRegdate . '000';
} else {
$tmpUserInfo['dateline'] = $lastLogin . '000';
}
$signature = WebUtils::emptyHtml(DzCommonUserList::getUserSightml($uid));
$tmpUserInfo['signature'] = WebUtils::t($signature);
$userInfo = UserUtils::getUserInfo($uid);
$tmpUserInfo['credits'] = (int) $userInfo['credits'];
$list[] = $tmpUserInfo;
}
return $list;
}