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


PHP UserUtils::getUserAvatar方法代码示例

本文整理汇总了PHP中UserUtils::getUserAvatar方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtils::getUserAvatar方法的具体用法?PHP UserUtils::getUserAvatar怎么用?PHP UserUtils::getUserAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserUtils的用法示例。


在下文中一共展示了UserUtils::getUserAvatar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getAnnouncementInfo

 private function _getAnnouncementInfo($res, $id)
 {
     global $_G;
     require_once libfile('function/discuzcode');
     $announce = DzForumAnnouncement::getAnnouncementByUid($id);
     if (!count($announce)) {
         $res = $this->makeErrorInfo($res, 'announcement_nonexistence');
     } else {
         $tempAnnounce = array();
         $tempAnnounce['author'] = $announce['author'];
         $tmp = explode('.', dgmdate($announce['starttime'], 'Y.m'));
         $months[$tmp[0] . $tmp[1]] = $tmp;
         if (!empty($_GET['m']) && $_GET['m'] != dgmdate($announce['starttime'], 'Ym')) {
             continue;
         }
         $tempAnnounce['starttime'] = dgmdate($announce['starttime'], 'd');
         $tempAnnounce['endtime'] = $announce['endtime'] ? dgmdate($announce['endtime'], 'd') : '';
         $tempAnnounce['title'] = WebUtils::emptyHtml($announce['subject']);
         $uid = DzCommonMember::getUidByUsername($announce['author']);
         $tempAnnounce['icon'] = UserUtils::getUserAvatar($uid);
         $announceMessage = $announce['type'] == 1 ? "{$announce[message]}" : $announceMessage;
         $announceMessage = nl2br(discuzcode($announce['message'], 0, 0, 1, 1, 1, 1, 1));
         $announceType = array();
         $announceType['infor'] = WebUtils::emptyHtml($announceMessage);
         $announce['type'] == 1 ? $announceType['type'] = 'url' : ($announceType['type'] = 'text');
         $tempAnnounce['content'] = $announceType;
         $res['body']['list'] = $tempAnnounce;
     }
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:30,代码来源:AnnouncementAction.php

示例2: _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

示例3: _getImageInfoByTids

 private function _getImageInfoByTids($page, $pageSize)
 {
     $imageList = $this->_getImageTidsByFids($page, $pageSize);
     $list = array();
     global $_G;
     $forum = $_G['forum'];
     foreach ($imageList as $image) {
         $tmpImageInfo = ForumUtils::getTopicInfo($image);
         $imageSummary = ForumUtils::getTopicCover((int) $image);
         $imageInfo['board_id'] = (int) $tmpImageInfo['fid'];
         $imageInfo['board_name'] = $fid != 0 ? $forum['name'] : ForumUtils::getForumName($tmpImageInfo['fid']);
         $imageInfo['board_name'] = WebUtils::emptyHtml($imageInfo['board_name']);
         $imageInfo['topic_id'] = (int) $image;
         $imageInfo['title'] = WebUtils::emptyHtml($tmpImageInfo['subject']);
         $imageInfo['user_id'] = (int) $tmpImageInfo['authorid'];
         $imageInfo['last_reply_date'] = $tmpImageInfo['lastpost'] . "000";
         $imageInfo['user_nick_name'] = $tmpImageInfo['author'];
         $imageInfo['hits'] = (int) $tmpImageInfo['views'];
         $imageInfo['replies'] = (int) $tmpImageInfo['replies'];
         $imageInfo['top'] = (int) ForumUtils::isTopTopic($image) ? 1 : 0;
         $imageInfo['status'] = (int) $tmpImageInfo['status'];
         $imageInfo['essence'] = (int) $tmpImageInfo['digest'] ? 1 : 0;
         $imageInfo['hot'] = (int) $tmpImageInfo['highlight'] ? 1 : 0;
         $tempImageInfo = ImageUtils::getThumbImageEx($imageSummary, 15, true, false);
         $imageInfo['pic_path'] = $tempImageInfo['image'];
         $imageInfo['ratio'] = $tempImageInfo['ratio'];
         $imageInfo['userAvatar'] = UserUtils::getUserAvatar($tmpImageInfo['authorid']);
         $imageInfo['recommendAdd'] = (int) ForumUtils::getRecommendAdd($image);
         $imageInfo['isHasRecommendAdd'] = (int) ForumUtils::isHasRecommendAdd($image);
         $imageInfo['imageList'] = array();
         $imageInfo['sourceWebUrl'] = (string) ForumUtils::getSourceWebUrl($image, 'topic');
         $list[] = $imageInfo;
     }
     return $list;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:35,代码来源:PhotoGalleryAction.php

示例4: _login

 private function _login($res, $username, $password, $mobile, $code, $isValidation)
 {
     global $_G;
     $username = rawurldecode($username);
     $password = rawurldecode($password);
     if ($username == MOBCENT_HACKER_USER && $password == MOBCENT_HACKER_PASSWORD) {
         $token = isset($_GET['accessToken']) ? $_GET['accessToken'] : '';
         $secret = isset($_GET['accessSecret']) ? $_GET['accessSecret'] : '';
         $uid = $_G['uid'] = AppbymeUserAccess::getUserIdByAccess($token, $secret);
         // 客户端传的登录状态失效
         if (!$uid) {
             return $this->makeErrorInfo($res, 'mobcent_login_status');
         }
         $result['member'] = getuserbyuid($uid);
         $_G['username'] = $result['member']['username'];
         // 把登录信息写入cookie中,并且更新登录的状态
         UserUtils::updateCookie($result['member'], $uid);
         // 需要整理token和secret再返回给客户端
         $userInfo = array('token' => $token, 'secret' => $secret);
     } else {
         $username = WebUtils::t($username);
         $logInfo = UserUtils::login($username, $password);
         if ($logInfo['errcode']) {
             UserUtils::delUserAccessByUsername($username);
             return $this->makeErrorInfo($res, $logInfo['message']);
         }
         if ($isValidation == 1) {
             // 是否开启了登录手机验证
             $isLoginValidation = WebUtils::getDzPluginAppbymeAppConfig('mobcent_login_validation');
             if ($isLoginValidation) {
                 $userMobileBind = AppbymeSendsms::getBindInfoByUid($_G['uid']);
                 if (!$userMobileBind) {
                     // 当前登录的用户没有绑定手机号码
                     if ($mobile == '' && $code == '') {
                         $res['isValidation'] = 1;
                         return $this->makeErrorInfo($res, '', array('noError' => 0, 'alert' => 0));
                     }
                     $checkInfo = UserUtils::checkMobileCode($res, $mobile, $code);
                     if ($checkInfo['rs'] == 0) {
                         return $this->makeErrorInfo($res, $checkInfo['errcode']);
                     }
                     $updataArr = array('uid' => $_G['uid']);
                     AppbymeSendsms::updateMobile($mobile, $updataArr);
                 }
             }
         }
         $userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
     }
     $userAvatar = UserUtils::getUserAvatar($_G['uid']);
     $res['isValidation'] = 0;
     $res['token'] = (string) $userInfo['token'];
     $res['secret'] = (string) $userInfo['secret'];
     $res['uid'] = (int) $_G['uid'];
     $res['avatar'] = (string) $userAvatar;
     $res['userName'] = (string) $_G['username'];
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:57,代码来源:LoginAction.php

示例5: _getUserInfo

 private function _getUserInfo($uid)
 {
     $userInfo = array('uid' => 0, 'name' => '', 'avatar' => '');
     $user = UserUtils::getUserInfo($uid);
     if (!empty($user)) {
         $userInfo['uid'] = (int) $uid;
         $userInfo['name'] = $user['username'];
         $userInfo['avatar'] = UserUtils::getUserAvatar($uid, 'small');
     }
     return $userInfo;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:11,代码来源:PMListAction.php

示例6: _switchVest

 private function _switchVest($res, $username)
 {
     global $_G;
     $username = WebUtils::t(rawurldecode($username));
     $_GET['username'] = $username;
     $myrepeatsusergroups = (array) dunserialize($_G['cache']['plugin']['myrepeats']['usergroups']);
     if (!in_array($_G['groupid'], $myrepeatsusergroups)) {
         $users = C::t('#myrepeats#myrepeats')->fetch_all_by_username($_G['username']);
         if (!$users) {
             return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'usergroup_disabled'));
         } else {
             $permusers = array();
             foreach ($users as $user) {
                 $permusers[] = $user['uid'];
             }
             $member = C::t('common_member')->fetch_by_username($_GET['username']);
             if (!$member || !in_array($member['uid'], $permusers)) {
                 return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'usergroup_disabled'));
             }
         }
     }
     $user = C::t('#myrepeats#myrepeats')->fetch_all_by_uid_username($_G['uid'], $_GET['username']);
     $user = current($user);
     $olddiscuz_uid = $_G['uid'];
     $olddiscuz_user = $_G['username'];
     $olddiscuz_userss = $_G['member']['username'];
     if (!$user) {
         $newuid = C::t('common_member')->fetch_uid_by_username($_GET['username']);
         if (C::t('#myrepeats#myrepeats')->count_by_uid_username($newuid, $olddiscuz_userss)) {
             // 第一次登录,需要输入密码
         }
         //return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'user_nonexistence'));
     } elseif ($user['locked']) {
         return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'user_locked', array('user' => $_GET['username'])));
     }
     list($password, $questionid, $answer) = explode("\t", authcode($user['logindata'], 'DECODE', $_G['config']['security']['authkey']));
     $logInfo = UserUtils::login($username, $password);
     if ($logInfo['errcode']) {
         return $this->makeErrorInfo($res, $logInfo['message']);
     }
     $userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
     $userAvatar = UserUtils::getUserAvatar($_G['uid']);
     $res['token'] = (string) $userInfo['token'];
     $res['secret'] = (string) $userInfo['secret'];
     $res['uid'] = (int) $_G['uid'];
     $res['avatar'] = (string) $userAvatar;
     $res['userName'] = (string) $_G['username'];
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:49,代码来源:SwitchAction.php

示例7: _getPMList

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

示例8: _getUserInfo

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

示例9: getCommentList

 protected function getCommentList($data)
 {
     $res = array('list' => array(), 'count' => 0);
     $list = array();
     $comments = DzPortalComment::getComments($data['id'], $data['idType'], $data['page'], $data['pageSize']);
     foreach ($comments as $comment) {
         $tmpComment = array();
         $tmpComment['managePanel'] = array(array('type' => 'quote', 'action' => '', 'title' => WebUtils::t('引用')));
         $tmpComment['id'] = (int) $comment['cid'];
         $tmpComment['uid'] = (int) $comment['uid'];
         $tmpComment['username'] = $comment['username'];
         $tmpComment['avatar'] = UserUtils::getUserAvatar($comment['uid']);
         $tmpComment['time'] = date('Y-m-d H:i', $comment['dateline']);
         $tmpComment['content'] = $this->transCommentMessage($comment['message']);
         $list[] = $tmpComment;
     }
     $res['list'] = $list;
     $res['count'] = DzPortalComment::getCount($data['id'], $data['idType']);
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:20,代码来源:CommentListAction.php

示例10: _qqInfo

 private function _qqInfo($res, $openId, $oauthToken, $platformId)
 {
     global $_G;
     $password = MOBCENT_HACKER_PASSWORD;
     require_once libfile('function/member');
     if (!empty($platformId) && $platformId == 20) {
         $qqUserInfo = $this->_getQQinfoByOpenId($openId);
         if (isset($qqUserInfo) && !empty($qqUserInfo)) {
             $userInfo = UserUtils::getUserInfo($qqUserInfo['uid']);
             setloginstatus($userInfo, $_GET['cookietime'] ? 2592000 : 0);
             C::t('common_member_status')->update($userInfo['uid'], array('lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP));
             $ipArray = explode('.', $_G['clientip']);
             $sid = FileUtils::getRandomFileName('', 6);
             $data = array('sid' => $sid, 'ip1' => $ipArray[0], 'ip2' => $ipArray[1], 'ip3' => $ipArray[2], 'ip4' => $ipArray[3], 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'groupid' => $userInfo['groupid'], 'invisible' => '0', 'action' => '', 'lastactivity' => time(), 'fid' => '0', 'tid' => '0', 'lastolupdate' => '0');
             $comSess = DzCommonSession::getComSessByUid($userInfo['uid']);
             if (!empty($comSess)) {
                 DzCommonSession::delComSess($userInfo['uid']);
             }
             DzCommonSession::insertComSess($data);
             $userAccess = AppbymeUserAccess::loginProcess($userInfo['uid'], $password);
             $res['body']['register'] = 0;
             $res['body']['uid'] = (int) $userInfo['uid'];
             $res['body']['userName'] = (string) $userInfo['username'];
             $res['body']['avatar'] = (string) UserUtils::getUserAvatar($userInfo['uid']);
             $res['body']['token'] = (string) $userAccess['token'];
             $res['body']['secret'] = (string) $userAccess['secret'];
             return $res;
         } else {
             $res['body']['register'] = 1;
             $res['body']['openId'] = (string) $openId;
             $res['body']['oauthToken'] = (string) $oauthToken;
             $res['body']['platformId'] = (int) $platformId;
             return $res;
         }
     }
     // 客户端参数不正确
     return $this->makeErrorInfo($res, 'mobcent_error_params');
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:38,代码来源:QQInfoAction.php

示例11: _login

 private function _login($res, $username, $password)
 {
     global $_G;
     $username = rawurldecode($username);
     $password = rawurldecode($password);
     if ($username == MOBCENT_HACKER_USER && $password == MOBCENT_HACKER_PASSWORD) {
         $token = isset($_GET['accessToken']) ? $_GET['accessToken'] : '';
         $secret = isset($_GET['accessSecret']) ? $_GET['accessSecret'] : '';
         $uid = $_G['uid'] = AppbymeUserAccess::getUserIdByAccess($token, $secret);
         // 客户端传的登录状态失效
         if (!$uid) {
             return $this->makeErrorInfo($res, 'mobcent_login_status');
         }
         $result['member'] = getuserbyuid($uid);
         $_G['username'] = $result['member']['username'];
         // 把登录信息写入cookie中,并且更新登录的状态
         UserUtils::updateCookie($result['member'], $uid);
         // 需要整理token和secret再返回给客户端
         $userInfo = array('token' => $token, 'secret' => $secret);
     } else {
         $username = WebUtils::t($username);
         $logInfo = UserUtils::login($username, $password);
         if ($logInfo['errcode']) {
             UserUtils::delUserAccessByUsername($username);
             return $this->makeErrorInfo($res, $logInfo['message']);
         }
         $userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
     }
     $userAvatar = UserUtils::getUserAvatar($_G['uid']);
     $res['token'] = (string) $userInfo['token'];
     $res['secret'] = (string) $userInfo['secret'];
     $res['uid'] = (int) $_G['uid'];
     $res['avatar'] = (string) $userAvatar;
     $res['userName'] = (string) $_G['username'];
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:36,代码来源:LoginAction.php

示例12: _getPostInfos

 private function _getPostInfos($res, $topic, $page, $pageSize, $order, $authorId, $params = array())
 {
     extract($params);
     $postInfos = array();
     $tid = (int) $topic['tid'];
     $postCount = ForumUtils::getPostCount($tid, array('authorId' => $authorId));
     if (!empty($topic)) {
         global $_G;
         $isOnlyAuthorTopic = ForumUtils::isOnlyAuthorTopic($topic);
         $postList = ForumUtils::getPostList($tid, $page, $pageSize, array('order' => $order ? 'dateline DESC' : 'dateline ASC', 'authorId' => $authorId));
         $position = $order ? $postCount + 1 - $pageSize * ($page - 1) : $pageSize * ($page - 1) + 2;
         if (MobcentDiscuz::getMobcentDiscuzVersion() > 'x25' && $_G['setting']['repliesrank'] && $postList) {
             if ($postList) {
                 $tempPids = array();
                 $tempPostRecommends = array();
                 foreach ($postList as $post) {
                     $tempPids[] = (int) $post['pid'];
                 }
                 foreach (C::t('forum_hotreply_number')->fetch_all_by_pids(array_values($tempPids)) as $pid => $post) {
                     $tempPostRecommends[$pid]['support'] = dintval($post['support']);
                     // $tempPostRecommends[$pid]['against'] = dintval($post['against']);
                 }
                 $isSupport = DzSupportInfo::getSupportPostsByUidAndTid($_G['uid'], $tid);
             }
         }
         foreach ($postList as $post) {
             $pid = (int) $post['pid'];
             $content = ForumUtils::getPostContent($tid, $pid, $post);
             $isOnlyAuthorPost = $isOnlyAuthorTopic && $_G['uid'] != $post['authorid'] && $_G['uid'] != $_G['forum_thread']['authorid'] && !$post['first'] && !$_G['forum']['ismoderator'];
             $postInfo['reply_id'] = ForumUtils::isAnonymousPost($tid, $post) ? 0 : (int) $post['authorid'];
             $postInfo['reply_content'] = $isOnlyAuthorPost ? $this->_filterContent(array(array('content' => WebUtils::t('此帖仅作者可见'), 'type' => 'text'))) : $this->_getPostContent($content);
             $postInfo['reply_type'] = 'normal';
             $this->_isComplexContent($postInfo['reply_content']) && ($postInfo['reply_type'] = 'normal_complex');
             $postInfo['reply_name'] = ForumUtils::isAnonymousPost($tid, $post) ? $this->_getAnonymoustext() : $post['author'];
             $postInfo['reply_posts_id'] = $pid;
             // 抢楼帖时采用原楼层
             if (getstatus($topic['status'], 3)) {
                 $postInfo['position'] = $post['position'];
             } else {
                 $postInfo['position'] = $order ? $position-- : $position++;
             }
             $postInfo['posts_date'] = $post['dateline'] . '000';
             $postInfo['icon'] = UserUtils::getUserAvatar($postInfo['reply_id']);
             $postInfo['level'] = $this->_getUserLevel($postInfo['reply_id']);
             $postInfo['userTitle'] = UserUtils::getUserTitle($postInfo['reply_id']);
             $postInfo['location'] = ForumUtils::getPostLocation($pid);
             $postInfo['mobileSign'] = ForumUtils::getMobileSign($post['status']);
             // if(empty($post['author']) && isset($post['authorid']) && !empty($post['authorid'])){
             //     $postInfo['reply_status'] = -1;
             // }elseif(empty($post ['author']) && empty($post ['authorid'])){
             //     $postInfo['reply_status'] = 0;
             // }else{
             //     $postInfo['reply_status'] = 1;
             // }
             $postInfo['reply_status'] = 1;
             $postInfo['status'] = 1;
             $postInfo['role_num'] = 1;
             $postInfo['title'] = '';
             $postInfo = array_merge($postInfo, $this->_getPostQuoteInfo($content, $isOnlyAuthorPost));
             // 回帖管理面板编辑 start
             $userMember = $this->_getUserInfoByAuthorid($post['authorid']);
             $userMember = array_merge($userMember, $post);
             $params = array('editPerm' => $editPerm, 'userMember' => $userMember);
             // end
             $manageItems = ForumUtils::getPostManagePanel($params);
             foreach ($manageItems['post'] as $key => $item) {
                 if ($item['action'] == 'edit') {
                     $item['action'] = WebUtils::getHttpFileName("forum.php?mod=post&action=edit&fid={$post['fid']}&tid={$post['tid']}&pid={$post['pid']}");
                 } else {
                     $item['action'] = WebUtils::createUrl_oldVersion('forum/topicadminview', array('fid' => $post['fid'], 'tid' => $tid, 'pid' => $post['pid'], 'act' => $item['action'], 'type' => 'post'));
                 }
                 $manageItems['post'][$key] = $item;
             }
             $count = mb_strlen($postInfo['reply_content'][0]['infor'], $_G['charset']);
             if ($count < $_G['setting']['threadfilternum']) {
                 $isWater = true;
             }
             $isWater = false;
             $count = mb_strlen($postInfo['reply_content'][0]['infor'], $_G['charset']);
             if ($_G['setting']['filterednovote'] && $count < $_G['setting']['threadfilternum']) {
                 $isWater = true;
             }
             $extraItems = array();
             $tempExtraItems = ForumUtils::getPostExtraPanel();
             foreach ($tempExtraItems['post'] as $key => $item) {
                 $item['extParams'] = array('beforeAction' => '');
                 $item['type'] = $item['action'];
                 $item['action'] = '';
                 if ($item['type'] == 'support' && !$isWater) {
                     $item['action'] = WebUtils::createUrl_oldVersion('forum/support', array('tid' => $tid, 'pid' => $post['pid'], 'type' => 'post'));
                     $item['extParams']['recommendAdd'] = (int) $tempPostRecommends[$post['pid']]['support'];
                     $isRecommendAdd = in_array($post['pid'], $isSupport) ? 1 : 0;
                     $item['extParams']['isHasRecommendAdd'] = (int) $isRecommendAdd;
                 }
                 if ($item['type'] != 'support' || !$isWater) {
                     $extraItems[] = $item;
                 }
             }
             $postInfo['managePanel'] = $manageItems['post'];
             $postInfo['extraPanel'] = $extraItems;
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:PostListAction.php

示例13: _saveWxInfo

 private function _saveWxInfo($res, $username, $oauthToken, $password, $openId, $email, $gender, $act, $platformId)
 {
     if ($act == 'register') {
         $regInfo = UserUtils::register($username, $password, $email);
         if ($regInfo['errcode']) {
             return $this->makeErrorInfo($res, $regInfo['message']);
         }
         $uid = $regInfo['info']['uid'];
         $member = UserUtils::getUserInfo($uid);
         $userInfo = AppbymeUserAccess::registerProcess($regInfo['info']['uid'], $password);
         $data = array('uid' => $uid, 'openid' => $openId, 'status' => 1, 'type' => 1);
         AppbymeConnection::insertMobcentWx($data);
         $res['body']['uid'] = (int) $uid;
         $res['body']['token'] = (string) $userInfo['token'];
         $res['body']['secret'] = (string) $userInfo['secret'];
     } elseif ($act == 'bind') {
         global $_G;
         $logInfo = UserUtils::login($username, $password);
         if ($logInfo['errcode']) {
             UserUtils::delUserAccessByUsername($username);
             return $this->makeErrorInfo($res, 'mobcent_bind_error');
         }
         $isBind = AppbymeConnection::getUserBindInfo($_G['uid']);
         if ($isBind) {
             return $this->makeErrorInfo($res, 'mobcent_bind_error_repeat');
         }
         $data = array('uid' => $_G['uid'], 'openid' => $openId, 'status' => 1, 'type' => 1);
         AppbymeConnection::insertMobcentWx($data);
         $userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
         $userAvatar = UserUtils::getUserAvatar($_G['uid']);
         $res['body']['token'] = (string) $userInfo['token'];
         $res['body']['secret'] = (string) $userInfo['secret'];
         $res['body']['uid'] = (int) $_G['uid'];
         $res['body']['avatar'] = (string) $userAvatar;
         $res['body']['userName'] = (string) $_G['username'];
     }
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:38,代码来源:SavePlatFormInfoAction.php

示例14: _getListField

 private function _getListField($topicList)
 {
     global $_G;
     $forum = $_G['forum'];
     $isImageList = isset($_GET['isImageList']) ? $_GET['isImageList'] : 0;
     $list = array();
     foreach ($topicList as $topic) {
         // 该主题是由别的版块移动过来的
         $isTopicMoved = false;
         $movedTitle = '';
         if ($topic['closed'] > 1) {
             $movedTitle = WebUtils::t('移动: ');
             $isTopicMoved = true;
             $topic['tid'] = $topic['closed'];
         }
         $tid = (int) $topic['tid'];
         $topicFid = (int) $topic['fid'];
         // 主题分类标题
         $typeTitle = '';
         if (WebUtils::getDzPluginAppbymeAppConfig('forum_allow_topictype_prefix')) {
             if (isset($forum['threadtypes']['prefix']) && $forum['threadtypes']['prefix'] == 1 && isset($forum['threadtypes']['types'][$topic['typeid']])) {
                 $typeTitle = '[' . $forum['threadtypes']['types'][$topic['typeid']] . ']';
             }
         }
         // 分类信息标题
         $sortTitle = '';
         if (WebUtils::getDzPluginAppbymeAppConfig('forum_allow_topicsort_prefix')) {
             if (!empty($forum['threadsorts']['prefix']) && isset($forum['threadsorts']['types'][$topic['sortid']])) {
                 $sortTitle = '[' . $forum['threadsorts']['types'][$topic['sortid']] . ']';
             }
         }
         $isTopicMoved && ($typeTitle = $sortTitle = '');
         $topicInfo['board_id'] = $topicFid;
         $topicInfo['board_name'] = $fid != 0 ? $forum['name'] : ForumUtils::getForumName($topicFid);
         $topicInfo['board_name'] = WebUtils::emptyHtml($topicInfo['board_name']);
         $topicInfo['topic_id'] = $tid;
         $topicInfo['type'] = ForumUtils::getTopicType($topic);
         $topicInfo['title'] = $movedTitle . $typeTitle . $sortTitle . $topic['subject'];
         $topicInfo['title'] = WebUtils::emptyHtml($topicInfo['title']);
         // 修正帖子查看数
         if (isset($_G['forum_thread']['views']) && $_G['forum_thread']['tid'] == $topic['tid'] && $_G['forum_thread']['views'] > $topic['views']) {
             $topic['views'] = $_G['forum_thread']['views'];
         }
         $topicInfo['user_id'] = (int) $topic['authorid'];
         $topicInfo['user_nick_name'] = $topic['author'];
         $topicInfo['last_reply_date'] = $topic['lastpost'] . '000';
         $topicInfo['vote'] = ForumUtils::isVoteTopic($topic) ? 1 : 0;
         $topicInfo['hot'] = ForumUtils::isHotTopic($topic) ? 1 : 0;
         $topicInfo['hits'] = (int) $topic['views'];
         $topicInfo['replies'] = (int) $topic['replies'];
         $topicInfo['essence'] = ForumUtils::isMarrowTopic($topic) ? 1 : 0;
         $topicInfo['top'] = ForumUtils::isTopTopic($topic) ? 1 : 0;
         $topicInfo['status'] = (int) $topic['status'];
         $cache = Yii::app()->params['mobcent']['cache']['topicSummary'];
         $key = sprintf('mobcentTopicSummary_%s_%s_%s', $tid, $_G['groupid'], $isImageList);
         if (!$cache['enable'] || ($topicSummary = Yii::app()->cache->get($key)) === false) {
             $topicSummary = ForumUtils::getTopicSummary($tid, 'forum', true, array('imageList' => $isImageList, 'imageListLen' => 9, 'imageListThumb' => 1));
             if ($cache['enable']) {
                 Yii::app()->cache->set($key, $topicSummary, $cache['expire']);
             }
         }
         $topicInfo['subject'] = $topicSummary['msg'];
         // $topicInfo['pic_path'] = ImageUtils::getThumbImage($topicSummary['image']);
         $tempTopicInfo = ImageUtils::getThumbImageEx($topicSummary['image'], 15, true, false);
         $topicInfo['pic_path'] = $tempTopicInfo['image'];
         $topicInfo['ratio'] = $tempTopicInfo['ratio'];
         $topicInfo['userAvatar'] = UserUtils::getUserAvatar($topic['authorid']);
         $topicInfo['gender'] = (int) UserUtils::getUserGender($topic['authorid']);
         $topicInfo['recommendAdd'] = (int) ForumUtils::getRecommendAdd($tid);
         $topicInfo['isHasRecommendAdd'] = ForumUtils::isHasRecommendAdd($tid);
         $topicInfo['imageList'] = (array) $topicSummary['imageList'];
         $topicInfo['sourceWebUrl'] = (string) ForumUtils::getSourceWebUrl($tid, 'topic');
         $tmpList = $list[] = $topicInfo;
     }
     return $list;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:76,代码来源:TopicListAction.php

示例15: _getListField

 /**
  * 列表显示需要的字段
  * 
  * @param array $list      帖子或者文章的详细字段信息.
  * @param array $summary      帖子或者文章的摘要和图片.
  * @param string $source_type 源的类型.
  * @param int $source_id      源的id.
  *
  * @return array 整理好的字段.
  */
 private function _getListField($list, $summary, $source_type, $source_id, $params = array())
 {
     $row = array();
     // 显示样式
     if ($params['topic_style'] == 2) {
         $statu = 'lastpost';
     } else {
         $statu = 'dateline';
     }
     if ($source_type == 'topic') {
         $row['fid'] = (int) $list['fid'];
     }
     $row['source_type'] = (string) $source_type;
     $row['source_id'] = (int) $source_id;
     $row['title'] = $source_type == 'topic' ? (string) $list['subject'] : (string) $list['title'];
     $row['title'] = WebUtils::emptyHtml($row['title']);
     $row['user_id'] = $source_type == 'topic' ? (int) $list['authorid'] : (int) $list['uid'];
     $row['last_reply_date'] = $source_type == 'topic' ? $list[$statu] . '000' : $list['dateline'] . '000';
     $row['user_nick_name'] = $source_type == 'topic' ? (string) $list['author'] : (string) $list['username'];
     $row['hits'] = $source_type == 'topic' ? (int) $list['views'] : (int) $list['viewnum'];
     $row['summary'] = (string) $summary['msg'];
     $row['replies'] = $source_type == 'topic' ? (int) $list['replies'] : (int) $list['commentnum'];
     $tempRow = ImageUtils::getThumbImageEx($summary['image'], 15, true, true);
     $row['pic_path'] = (string) $tempRow['image'];
     $row['ratio'] = $tempRow['ratio'];
     $row['redirectUrl'] = (string) $list['url'];
     $row['userAvatar'] = (string) UserUtils::getUserAvatar($row['user_id']);
     $row['gender'] = (int) UserUtils::getUserGender($row['user_id']);
     $row['recommendAdd'] = $source_type == 'topic' ? (int) ForumUtils::getRecommendAdd($row['source_id']) : 0;
     $row['isHasRecommendAdd'] = $source_type == 'topic' ? (int) ForumUtils::isHasRecommendAdd($row['source_id']) : 0;
     $row['distance'] = isset($list['distance']) ? (string) $list['distance'] : '';
     $row['location'] = isset($list['location']) ? (string) $list['location'] : '';
     $row['imageList'] = (array) $summary['imageList'];
     $row['sourceWebUrl'] = (string) ForumUtils::getSourceWebUrl($source_id, $source_type);
     return $row;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:46,代码来源:NewsListAction.php


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