Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 private function _getPMList($page, $pageSize)
 {
     $pmList = array('list' => array(), 'count' => 0);
     global $_G;
     // 在DISCUZ_ROOT/source/include/space/space_pm.php基础上二次开发
     loaducenter();
     $filter = 'privatepm';
     $perpage = $pageSize;
     $count = 0;
     $list = array();
     if ($filter == 'privatepm' || $filter == 'newpm') {
         $result = uc_pm_list($_G['uid'], $page, $perpage, 'inbox', $filter, 200);
         $count = $result['count'];
         $list = $result['data'];
     }
     if ($_G['member']['newpm']) {
         if ($newpm && $_G['setting']['cloud_status']) {
             $msgService = Cloud::loadClass('Cloud_Service_Client_Message');
             $msgService->setMsgFlag($_G['uid'], $_G['timestamp']);
         }
         C::t('common_member')->update($_G['uid'], array('newpm' => 0));
         uc_pm_ignore($_G['uid']);
     }
     $tempPMList = array();
     foreach ($list as $pm) {
         // 目前只要两人对话的列表
         if ($pm['members'] > 2 || $pm['pmtype'] != 1) {
             $count--;
             continue;
         }
         $tempPm = array();
         $tempPm['plid'] = (int) $pm['plid'];
         $tempPm['pmid'] = (int) $pm['pmid'];
         $tempPm['lastUserId'] = (int) $pm['lastauthorid'];
         $tempPm['lastUserName'] = (string) $pm['lastauthor'];
         $tempPm['lastSummary'] = (string) $pm['lastsummary'];
         $tempPm['lastDateline'] = $pm['lastdateline'] . '000';
         $tempPm['toUserId'] = (int) $pm['touid'];
         $tempPm['toUserAvatar'] = UserUtils::getUserAvatar($pm['touid']);
         $tempPm['toUserName'] = (string) $pm['tousername'];
         $tempPm['toUserIsBlack'] = UserUtils::isBlacklist($_G['uid'], $pm['touid']) ? 1 : 0;
         $tempPm['isNew'] = $pm['new'] ? 1 : 0;
         $tempPMList[] = $tempPm;
     }
     $pmList['list'] = $tempPMList;
     $pmList['count'] = $count;
     return $pmList;
 }
Exemplo n.º 3
0
 private function _getUserInfo($res, $uid, $puid)
 {
     loadcache('usergroups');
     $space = UserUtils::getUserInfo($puid);
     if (empty($space)) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'space_does_not_exist');
     }
     $spacePro = UserUtils::getUserProfile($puid);
     $spaceCount = DzUserInfo::getCommonMemberCount($puid);
     $space = array_merge($space, $spacePro, $spaceCount);
     $listCount = (int) DzUserInfo::getUserPhotosHomeAlbumCount($puid);
     $res['flag'] = $uid == $puid ? 1 : 0;
     $res['is_black'] = (int) UserUtils::isBlacklist($uid, $puid) ? 1 : 0;
     $res['is_follow'] = (int) UserUtils::isFollow($uid, $puid);
     $res['isFriend'] = (int) UserUtils::isFriend($uid, $puid) ? 1 : 0;
     $res['icon'] = UserUtils::getUserAvatar($puid, $spacePro);
     $res['level_url'] = '';
     $res['name'] = $space['username'];
     $res['email'] = $space['email'];
     $res['status'] = (int) UserUtils::getUserLoginStatus($puid);
     $res['gender'] = (int) UserUtils::getUserGender($puid, $spacePro);
     $res['email'] = $space['email'];
     $res['score'] = (int) $space['credits'];
     $res['credits'] = (int) $space['credits'];
     $res['gold_num'] = (int) $space['extcredits2'];
     $res['topic_num'] = (int) $this->_getHomeTopicNum($puid);
     $res['photo_num'] = (int) $listCount['nums'];
     $res['reply_posts_num'] = (int) DzUserInfo::getTopicsByUidWithPostCount($puid);
     $res['essence_num'] = (int) $space['digestposts'];
     $res['friend_num'] = (int) DzUserInfo::getFollowFriendsCount($puid);
     $res['follow_num'] = (int) DzUserInfo::getFollowedFriendsCount($puid);
     $res['level'] = (int) DzCommonUserList::getUserLevel($space['groupid']);
     $res['userTitle'] = UserUtils::getUserTitle($puid, $space);
     $repeatList = array();
     foreach (UserUtils::getRepeatList($uid) as $user) {
         $repeatList[] = array('userName' => $user);
     }
     $res['body']['repeatList'] = $repeatList;
     $res['body']['profileList'] = $this->_getPersonalDataInfo($puid, $space);
     $res['body']['creditList'] = $this->_getStatisticalInformation($uid, $space);
     $res['body']['creditShowList'] = $this->_getStatisticalInforSet($uid, $space);
     return $res;
 }
Exemplo n.º 4
0
 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;
 }