当前位置: 首页>>代码示例>>PHP>>正文


PHP UserUtils::getUserName方法代码示例

本文整理汇总了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;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:25,代码来源:SurroundingAction.php

示例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;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:37,代码来源:TopicListAction.php

示例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;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:18,代码来源:UserAdminAction.php

示例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;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:41,代码来源:UserListAction.php


注:本文中的UserUtils::getUserName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。