Exemplo n.º 1
0
 private function _getImageInfoList($res, $landUid, $uid, $page, $pageSize, $albumId)
 {
     $list = array();
     $imageList = UserPhotoInfo::getImageListByAlbumId($albumId, $uid, $page, $pageSize);
     foreach ($imageList as $image) {
         $tempimageInfo = PhotoUtils::getPhotoInfo($image);
         // $imageInfo['board_id'] = (Int)$albumId;
         $imageInfo['pic_id'] = (int) $image;
         $imageInfo['title'] = $tempimageInfo['title'] == "" ? $tempimageInfo['filename'] : $tempimageInfo['title'];
         $imageInfo['title'] = WebUtils::emptyHtml($imageInfo['title']);
         $imageInfo['user_id'] = (int) $uid;
         $imageInfo['release_date'] = $tempimageInfo['dateline'] . "000";
         $lastReplyDate = PhotoUtils::getReplyDate($image);
         $imageInfo['last_update_date'] = $lastReplyDate['last_reply_date'] . "000";
         $imageInfo['user_nick_name'] = $tempimageInfo['username'];
         $imageInfo['hot'] = (int) $tempimageInfo['hot'];
         $imageInfo['replies'] = (int) PhotoUtils::getReplyCount($image);
         $imageInfo['thumb_pic'] = PhotoUtils::getImageCover($image);
         $imageInfo['origin_pic'] = PhotoUtils::getPhotosoRiginCover($tempimageInfo);
         $list[] = $imageInfo;
     }
     global $_G;
     if ($_G['adminid'] != 1) {
         $albumInfo = UserPhotoInfo::getAlbumInfo($uid, $albumId);
         switch ($albumInfo['friend']) {
             case 0:
                 $list;
                 break;
             case 1:
                 UserUtils::isFriend($uid, $landUid) || $landUid == $uid ? $list : ($list = 1);
                 break;
             case 2:
                 $list = PhotoUtils::judgeDesignatedFriends($albumInfo, $landUid, $uid, $list);
                 break;
             case 3:
                 $uid == $landUid ? $list : ($list = 3);
                 break;
             case 4:
                 $landUid == $uid ? $list : ($list = 4);
                 break;
         }
     }
     $res['list'] = $list;
     if ($albumId == 0) {
         $count = UserPhotoInfo::getImageListCountByAlbumId($uid);
     } else {
         $count = UserPhotoInfo::getImageListCount($albumId, $uid);
     }
     $res = WebUtils::getWebApiArrayWithPage_oldVersion($page, $pageSize, $count, $res);
     if (empty($res['list'])) {
         if ($albumId == 0) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_defaultAlbum_does_not_exist');
         }
         return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_photo_does_not_exist');
     } elseif ($res['list'] == 1 || $res['list'] == 2 || $res['list'] == 3 || $res['list'] == 4) {
         $res['list'] = array();
         return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_photo_set_privacy', array('{username}' => $albumInfo['username']));
     }
     return $res;
 }
Exemplo n.º 2
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.º 3
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;
 }