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


PHP Pw::getAvatar方法代码示例

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


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

示例1: _buildSignKey

 private function _buildSignKey($list)
 {
     $_username = array();
     $_tids = array();
     foreach ($list as $k => $v) {
         $_tids[] = $v['lastpost_tid'];
     }
     $thread = $this->_getThread($_tids);
     foreach ($list as $k => $v) {
         $list[$k]['name'] = $this->_filterForumHtml($v['name']);
         if ($v['type'] == 'category') {
             $list[$k]['forum_url'] = WindUrlHelper::createUrl('bbs/cate/run', array('fid' => $v['fid']), '', 'pw');
         } else {
             $list[$k]['forum_url'] = WindUrlHelper::createUrl('bbs/thread/run', array('fid' => $v['fid']), '', 'pw');
         }
         $list[$k]['descrip'] = $this->_formatDes($v['descrip']);
         $list[$k]['logo'] = $v['logo'] ? Pw::getPath($v['logo']) : '';
         $lastthread = $thread[$v['lastpost_tid']];
         $list[$k]['lastpost_time'] = $this->_formatTime($lastthread['lastpost_time']);
         $list[$k]['lastpost_smallavatar'] = $lastthread['lastpost_userid'] ? Pw::getAvatar($lastthread['lastpost_userid'], 'small') : '';
         $list[$k]['lastpost_middleavatar'] = $lastthread['lastpost_userid'] ? Pw::getAvatar($lastthread['lastpost_userid'], 'middle') : '';
         $list[$k]['lastpost_userid'] = $lastthread['lastpost_userid'];
         $list[$k]['lastpost_username'] = $lastthread['lastpost_username'];
         $list[$k]['lastpost_space'] = $lastthread['lastpost_userid'] ? WindUrlHelper::createUrl('space/index/run', array('uid' => $lastthread['lastpost_userid']), '', 'pw') : '';
         $list[$k]['lastthread_space'] = $lastthread['created_userid'] ? WindUrlHelper::createUrl('space/index/run', array('uid' => $lastthread['created_userid']), '', 'pw') : '';
         $list[$k]['lastthread_smallavatar'] = $lastthread['created_userid'] ? Pw::getAvatar($lastthread['created_userid'], 'small') : '';
         $list[$k]['lastthread_middleavatar'] = $lastthread['created_userid'] ? Pw::getAvatar($lastthread['created_userid'], 'middle') : '';
         $list[$k]['lastthread_username'] = $lastthread['created_username'];
         $list[$k]['lastthread_time'] = $this->_formatTime($lastthread['created_time']);
         $list[$k]['lastthread'] = $this->_formatTitle($lastthread['subject']);
     }
     return $list;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:33,代码来源:PwDesignForumDataService.php

示例2: getAvatarPath

 public function getAvatarPath($uid)
 {
     if (intval($uid) > 0) {
         return str_replace('_middle', '', Pw::getAvatar($uid));
         //获取头像 √
     } else {
         return null;
     }
 }
开发者ID:taita2015,项目名称:NanaGate-2015,代码行数:9,代码来源:CustomController.php

示例3: getLastAction

 public function getLastAction()
 {
     $fromid = (int) $this->getInput('fromid', 'get');
     $typeid = (int) $this->getInput('typeid', 'get');
     $_users = array();
     $like = $this->_getLikeContentService()->getInfoByTypeidFromid($typeid, $fromid);
     !$like && $this->showError('BBS:like.fail');
     $uids = $like['users'] ? explode(',', $like['users']) : array();
     $userInfos = Wekit::load('user.PwUser')->fetchUserByUid($uids);
     foreach ($userInfos as $user) {
         if (!$user['uid']) {
             continue;
         }
         $_users[$user['uid']]['uid'] = $user['uid'];
         $_users[$user['uid']]['username'] = $user['username'];
         $_users[$user['uid']]['avatar'] = Pw::getAvatar($user['uid']);
     }
     $this->setOutput($_users, 'data');
     $this->showMessage('BBS:like.success');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:20,代码来源:LikeController.php

示例4: gather

 /**
  * 整理合并贴子内容 
  * 
  * @param mixed $tids 
  * @param mixed $pids 
  * @access public
  * @return void
  */
 public function gather($threadList, $attList)
 {
     if (!is_array($threadList) || !is_array($attList)) {
         return array();
     }
     foreach ($threadList as $key => $thread) {
         $pic_key = $thread['tid'] . '_0';
         $threadList[$key]['pic'] = isset($attList[$pic_key]) ? $attList[$pic_key] : array();
         //列表数据,过滤掉图片及附件url等标签
         $_shareData = Pw::formatContent($threadList[$key]['content']);
         $threadList[$key]['share'] = $_shareData['share'];
         $threadList[$key]['content'] = preg_replace('/(\\[)[^\\]]*$/i', '', mb_substr($_shareData['content'], 0, 90));
         //截字并修正表情标签
         //
         $threadList[$key]['created_user_avatar'] = Pw::getAvatar($threadList[$key]['created_userid'], '');
         //
         $threadList[$key]['lastpost_time'] = Pw::time2str($threadList[$key]['lastpost_time'], 'auto');
     }
     krsort($threadList, SORT_NUMERIC);
     return $threadList;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:29,代码来源:PwNativeThread.php

示例5: createHtml

 /**
  * 个人设置--绑定设置--页面
  * @see PwProfileExtendsDoBase::createHtml()
  */
 public function createHtml($left, $tab)
 {
     $this->typeFilter = $this->_getCommonService()->getAccountType();
     if ($this->typeFilter === false) {
         return false;
     }
     $res = $this->_getAccountBindDs()->fetchByUidAndTypes($this->uid, $this->typeFilter);
     $bindType = array();
     foreach ($res as $v) {
         $bindType[] = $v['type'];
         $this->bindInfo[$v['type']] = array('isopen' => 1, 'iconClass' => $this->_getAccountTypeService()->getIconClassByType($v['type']));
     }
     $unbindType = array();
     $unbindType = array_diff($this->typeFilter, $bindType);
     foreach ($unbindType as $v) {
         $this->bindInfo[$v] = array('isopen' => 0, 'iconClass' => $this->_getAccountTypeService()->getIconClassByType($v));
     }
     krsort($this->bindInfo);
     $this->avatar = Pw::getAvatar($this->uid, 'small');
     PwHook::template('displayAppProfileAccount', 'EXT:account.template.profile', true, $this);
 }
开发者ID:sanzhumu,项目名称:nextwind,代码行数:25,代码来源:App_Account_ProfileDo.php

示例6: bulidRead

 public function bulidRead($read)
 {
     $info = array();
     if (!$read['pid']) {
         $info = Wekit::load('like.PwLikeContent')->getInfoByTypeidFromid(PwLikeContent::THREAD, $read['tid']);
     }
     if ($read['pid'] == 0 && $info['users']) {
         $uids = explode(',', $info['users']);
         if (count($uids) > 10) {
             $uids = array_slice($uids, 0, 10);
         }
         $users = Wekit::load('user.PwUser')->fetchUserByUid($uids);
         foreach ($uids as $uid) {
             if (!$uid) {
                 continue;
             }
             $read['lastLikeUsers'][$uid]['uid'] = $uid;
             $read['lastLikeUsers'][$uid]['username'] = $users[$uid]['username'];
             $read['lastLikeUsers'][$uid]['avatar'] = Pw::getAvatar($uid);
         }
     }
     return $read;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:23,代码来源:PwThreadDisplayDoLike.php

示例7: likeUsersAction

 /**
 * 帖子点赞的用户
 * @access public
 * @return string
 * @example
 <pre>
 /index.php?m=native&c=read&a=likeusers&tid=21&page=1&_json=1
 cookie:usersession
 response: {err:"",data:""}  
 </pre>
 */
 public function likeUsersAction()
 {
     $tid = $this->getInput('tid');
     $page = $this->getInput('page');
     $page || ($page = 1);
     $perpage = 30;
     $start = ($page - 1) * $perpage;
     $res = Wekit::loadDao('native.dao.PwNativeLikeContentDao')->getLikeidByFromid($tid);
     $likeUsers = array();
     $count = 0;
     if (isset($res['likeid'])) {
         $count = Wekit::loadDao('native.dao.PwNativeLikeLogDao')->getLikeCount($res['likeid']);
         $uids = Wekit::loadDao('native.dao.PwNativeLikeLogDao')->fetchUidsByLikeid($res['likeid'], $start, $perpage);
         $res = Wekit::loadDao('user.dao.PwUserDao')->fetchUserByUid($uids);
         foreach ($res as $v) {
             $likeUsers[] = array('uid' => $v['uid'], 'username' => $v['username'], 'avatar' => Pw::getAvatar($v['uid'], 'small'));
         }
     }
     $data = array('likeUsers' => $likeUsers, 'pageCount' => ceil($count / $perpage) > 0 ? ceil($count / $perpage) : 1);
     $this->setOutput($data, 'data');
     $this->showMessage('success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:33,代码来源:ReadController.php

示例8: _buildSignKey

 /**
  * 构建模板用的标签
  *
  * @param array $list
  * @return string
  */
 private function _buildSignKey($list)
 {
     $clear = array();
     /* @var $userGroupSrv PwUserGroupsService */
     $userGroupSrv = Wekit::load('usergroup.srv.PwUserGroupsService');
     /* @var $workDs PwWork */
     $workDs = Wekit::load('work.PwWork');
     /* @var $educateDs PwEducation */
     $educateDs = Wekit::load('education.PwEducation');
     $location = $hometown = $schoolids = $_areaid = array();
     foreach ($list as $_uid => $_item) {
         $_one = array();
         $_one['uid'] = $_item['uid'];
         $_one['username'] = $_item['username'];
         $_one['url'] = WindUrlHelper::createUrl('space/index/run', array('uid' => $_item['uid']), '', 'pw');
         $_one['smallavatar'] = Pw::getAvatar($_uid, 'small');
         $_one['middleavatar'] = Pw::getAvatar($_uid, 'middle');
         $_one['bigavatar'] = Pw::getAvatar($_uid, 'big');
         $_one['regdate'] = $this->_formatTime($_item['regdate']);
         $_one['lastvisit'] = $this->_formatTime($_item['lastvisit']);
         $_one['posts'] = $_item['postnum'];
         $_one['topics'] = $_item['postnum'];
         //主题数
         $_one['digests'] = $_item['digest'];
         $_one['compositePoint'] = $userGroupSrv->getCredit($_item);
         $_one['realname'] = $_item['realname'];
         $_one['sex'] = !in_array($_item['gender'], array(0, 1)) ? '未知' : ($_item['gender'] == 0 ? '男' : '女');
         $_one['birthYear'] = $_item['byear'];
         $_one['birthMonth'] = $_item['bmonth'];
         $_one['birthDay'] = $_item['bday'];
         $_one['homepage'] = $_item['homepage'];
         $_one['profile'] = $_item['profile'];
         $_one['alipay'] = $_item['alipay'];
         $_one['mobile'] = $_item['mobile'];
         $_one['telphone'] = $_item['telphone'];
         $_one['address'] = $_item['address'];
         $_one['zipcode'] = $_item['zipcode'];
         $_one['email'] = $_item['email'];
         $_one['aliww'] = $_item['aliww'];
         $_one['qq'] = $_item['qq'];
         $_one['msn'] = $_item['msn'];
         $_one['worklist'] = $this->_buildWork($workDs, $_uid);
         list($_schoolids, $_one['educationlist']) = $this->_buildEducation($educateDs, $_uid);
         $schoolids += $_schoolids;
         $_one['home_province'] = $_one['home_city'] = $_one['home_area'] = '';
         $_one['locate_province'] = $_one['locate_city'] = $_one['locate_area'] = '';
         $location[$_uid] = $_item['location'];
         $hometown[$_uid] = $_item['hometown'];
         $_areaid[] = $_item['location'];
         $_areaid[] = $_item['hometown'];
         $clear[$_uid] = $_one;
     }
     //家庭和居住地
     $areaSrv = WindidApi::api('area');
     $areaList = $areaSrv->fetchAreaInfo(array_unique($_areaid));
     //学校列表
     $schoolSrv = WindidApi::api('school');
     $schoolList = $schoolSrv->fetchSchool($schoolids);
     foreach ($clear as $_uid => $_item) {
         if ($hometown[$_uid] && isset($areaList[$hometown[$_uid]])) {
             $_temp = explode(' ', $areaList[$hometown[$_uid]], 3);
             $clear[$_uid]['home_province'] = $_temp[0];
             isset($_temp[1]) && ($clear[$_uid]['home_city'] = $_temp[1]);
             isset($_temp[2]) && ($clear[$_uid]['home_area'] = $_temp[2]);
         }
         if ($location[$_uid] && isset($areaList[$location[$_uid]])) {
             $_temp = explode(' ', $areaList[$location[$_uid]], 3);
             $clear[$_uid]['locate_province'] = $_temp[0];
             isset($_temp[1]) && ($clear[$_uid]['locate_city'] = $_temp[1]);
             isset($_temp[2]) && ($clear[$_uid]['locate_area'] = $_temp[2]);
         }
         if ($_item['educationlist']) {
             $_temp = array();
             foreach ($_item['educationlist'] as $_i) {
                 if (isset($schoolList[$_i['schoolid']])) {
                     $_i['school'] = $schoolList[$_i['schoolid']]['name'];
                     unset($_i['schoolid']);
                     $_temp[] = $_i;
                 }
             }
             $clear[$_uid]['educationlist'] = $_temp;
         }
     }
     return $clear;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:91,代码来源:PwDesignUserDataService.php

示例9: fetchThreadsList

 /**
  * 获取列表页展示的帖子数据
  */
 public function fetchThreadsList($tids, $uid = 0, $result_type = 'ASSOC')
 {
     if (!$tids) {
         return array();
     }
     Wind::import('SRV:like.PwLikeContent');
     $threads = Wekit::loadDao('native.dao.PwNativeThreadsDao')->fetchThreads($tids);
     $threads_place = Wekit::loadDao('native.dao.PwThreadsPlaceDao')->fetchByTids($tids);
     $threads_content = Wekit::loadDao('forum.dao.PwThreadsContentDao')->fetchThread($tids);
     $PwThreadService = Wekit::load('forum.srv.PwThreadService');
     $PwNativeThreadService = Wekit::load('native.PwNativeThread');
     $threadLikeData = Wekit::load('like.srv.reply.do.PwLikeDoReply')->getAllLikeUserids(PwLikeContent::THREAD, $tids);
     foreach ($threadLikeData as $k => $v) {
         if (!in_array($uid, $v)) {
             unset($threadLikeData[$k]);
         }
     }
     $tag_names_str = '';
     foreach ($threads as $k => $v) {
         $content = isset($threads_content[$k]['content']) ? $threads_content[$k]['content'] : '';
         $threads[$k]['tags'] = $threads[$k]['tags_origin'] = isset($threads_content[$k]['tags']) ? $threads_content[$k]['tags'] : '';
         $threads[$k]['from_type'] = isset($threads_place[$k]['from_type']) ? $threads_place[$k]['from_type'] : 0;
         $threads[$k]['created_address'] = isset($threads_place[$k]['created_address']) ? $threads_place[$k]['created_address'] : '';
         $threads[$k]['area_code'] = isset($threads_place[$k]['area_code']) ? $threads_place[$k]['area_code'] : '';
         $threads[$k]['tags'] && ($tag_names_str .= ',' . $threads[$k]['tags']);
         $threads[$k]['avatar'] = Pw::getAvatar($v['created_userid'], 'small');
         $threads[$k]['created_time'] = Pw::time2str($v['created_time'], 'auto');
         $threads[$k]['lastpost_time'] = Pw::time2str($v['lastpost_time'], 'auto');
         preg_match("/\\[mp3.*?\\].*?\\[\\/mp3\\]/i", $content, $matches);
         $threads[$k]['have_mp3'] = $matches ? true : false;
         preg_match("/\\[flash.*?\\].*?\\[\\/flash\\]/i", $content, $matches);
         $threads[$k]['have_flash'] = $matches ? true : false;
         $format_content = Pw::formatContent($content);
         //格式化移动端帖子内容去除ubb标签、分享链接内容、推广链接内容
         $threads[$k]['isliked'] = isset($threadLikeData[$k]) ? true : false;
         $imgs = array_shift($PwNativeThreadService->getThreadAttach(array($k), array(0)));
         ksort($imgs);
         $imgs = array_slice($imgs, 0, 9);
         foreach ($imgs as $imgs_k => $imgs_v) {
             $imgs[$imgs_k]['realpath'] = str_replace("/thumb/mini", "", $imgs_v['path']);
         }
         $threads[$k]['content'] = array('text' => preg_replace('/(\\[)[^\\]]*$/i', '', Pw::substrs($format_content['content'], 70, 0, false)), 'imgs' => $imgs, 'share' => $format_content['share'], 'origin_content' => $content, 'format_content' => $format_content);
     }
     $tag_names_arr = array_unique(explode(',', trim($tag_names_str, ',')));
     $tag_names = Wekit::loadDao('tag.dao.PwTagDao')->getTagsByNames($tag_names_arr);
     //        var_dump($tag_names);exit;
     foreach ($threads as $k => $v) {
         if ($v['tags']) {
             $tag_arr = explode(',', $v['tags']);
             $tag_tmp = array();
             foreach ($tag_arr as $name) {
                 array_key_exists($name, $tag_names) && ($tag_tmp[] = array('tag_id' => $tag_names[$name]['tag_id'], 'tag_name' => $name));
             }
             $threads[$k]['tags'] = $tag_tmp;
         }
     }
     $threads_tmp = array();
     $sort_num = 0;
     if ($result_type == 'ASSOC') {
         //按照tids的顺序重新排序结果集,tid作为索引
         foreach ($tids as $v) {
             if (isset($threads[$v])) {
                 $threads_tmp[$v] = $threads[$v];
                 $threads_tmp[$v]['sort'] = $sort_num++;
             }
         }
     } else {
         //tid会有重复的情况,置顶帖在列表中显示2次,数字顺序索引
         foreach ($tids as $v) {
             if (isset($threads[$v])) {
                 $threads[$v]['sort'] = $sort_num++;
                 $threads_tmp[] = $threads[$v];
             }
         }
     }
     //        print_r($threads_tmp);exit;
     return $threads_tmp;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:81,代码来源:PwDynamicService.php

示例10: getMessageAndReply

 /**
  * 获取对话消息列表
  *
  * @param int $dialogId
  * @param int $start
  * @param int $limit
  * @return array
  */
 public function getMessageAndReply($dialogId, $offset, $limit)
 {
     list($dialogId, $offset, $limit) = array(intval($dialogId), intval($offset), intval($limit));
     if ($dialogId < 1) {
         return $this->buildResponse(MESSAGE_INVALID_PARAMS);
     }
     list($count, $dialogResult) = $this->getPwMessageService()->getDialogMessageList($dialogId, $limit, $offset);
     if ($dialogResult instanceof PwError) {
         return $this->buildResponse(-1, $dialogResult->getError());
     }
     $result = array();
     $dialogResult = array_values($dialogResult);
     foreach ($dialogResult as $k => $v) {
         $result[$k]['messageid'] = $v['message_id'];
         $result[$k]['uid'] = $v['from_uid'];
         $result[$k]['username'] = PwUserBo::getInstance($v['uid'])->username;
         $result[$k]['icon'] = Pw::getAvatar($v['from_uid']);
         $result[$k]['postdate'] = $v['created_time'];
         $result[$k]['content'] = $v['content'];
         $result[$k]['id'] = $v['id'];
         //dialog和message的关系id
         $result[$k]['dialog_id'] = $dialogId;
         $result[$k]['is_read'] = $v['is_read'];
         $result[$k]['from_username'] = $v['from_username'];
     }
     return $this->buildResponse(0, array('count' => $count, 'dialog' => $result));
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:35,代码来源:ACloudVerCustomizedMessage.php

示例11: getPostByTidAndUid

 /**
  * 获取用户(A)在帖子(B)中的回复
  *
  * @param int $tid
  * @param int $uid
  * @param int $limit
  * @param int $offset
  * @return array
  */
 public function getPostByTidAndUid($tid, $uid, $offset, $limit)
 {
     list($uid, $tid, $offset, $limit) = array(intval($uid), intval($tid), intval($offset), intval($limit));
     $user = PwUserBo::getInstance($uid);
     if (!$user->username) {
         return $this->buildResponse(THREAD_USER_NOT_EXIST, "用户不存在");
     }
     $postResult = $this->_getThread()->getPostByTidAndUid($tid, $uid, $limit, $offset);
     if ($postResult instanceof PwError) {
         return $this->buildResponse(-1, $postResult->getError());
     }
     $postResult = array_values($postResult);
     $count = $this->_getThread()->countPostByTidAndUid($tid, $uid);
     $result = array();
     foreach ($postResult as $k => $v) {
         $result[$k]['pid'] = $v['pid'];
         $result[$k]['tid'] = $v['tid'];
         $result[$k]['author'] = $uid;
         $result[$k]['authorid'] = $user->username;
         $result[$k]['subject'] = $v['subject'];
         $result[$k]['postdate'] = $v['created_time'];
         $result[$k]['icon'] = Pw::getAvatar($uid);
         $result[$k]['content'] = $v['content'];
         $result[$k]['attachlist'] = '';
         $result[$k]['fid'] = $v['fid'];
     }
     return $this->buildResponse(0, array('count' => $count, 'posts' => $result));
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:37,代码来源:ACloudVerCustomizedPost.php

示例12: followAction

 /**
  * 我关注的人
  * @access public
  * @return void
  * @example
  * <pre>
  * /index.php?m=native&c=Space&a=follow&page=1 <br>
  * </pre>
  */
 public function followAction()
 {
     $page = intval($this->getInput('page', 'get'));
     $page < 1 && ($page = 1);
     $perpage = 20;
     list($start, $limit) = Pw::page2limit($page, $perpage);
     $typeCounts = $this->_getAttentionTypeDs()->countUserType($this->uid);
     $follows = $this->_getPwAttentionDs()->getFollows($this->uid, $limit, $start);
     //
     $userBo = new PwUserBo($this->uid);
     $followsCount = $userBo->info['follows'];
     $uids = array_keys($follows);
     $fans = $this->_getPwAttentionDs()->fetchFans($this->uid, $uids);
     $userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_MAIN);
     if ($userList) {
         foreach ($userList as $key => $user) {
             $userList[] = array('uid' => $user['uid'], 'username' => $user['username'], 'avatar' => Pw::getAvatar($user['uid'], 'small'));
             unset($userList[$key]);
         }
     }
     $data = array('pageCount' => ceil($followsCount / $perpage), 'userList' => $userList);
     $this->setOutput($data, 'data');
     $this->showMessage('success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:33,代码来源:MyController.php

示例13: _getUserInfo

 /**
  * 获得基本用户信息 
  * 
  * @param mixed $uid 
  * @access private
  * @return void
  */
 protected function _getUserInfo($laiwangOK = true)
 {
     //
     $_userInfo = $this->_getUserAllInfo(PwUser::FETCH_MAIN + PwUser::FETCH_INFO);
     //登录成功后,加密身份key
     $_idInfo = array('username' => $_userInfo['username'], 'password' => $_userInfo['password']);
     $securityKey = Pw::encrypt(serialize($_idInfo), $this->_securityKey);
     //laiwang
     $wk_setting = PwLaiWangSerivce::$wk_setting;
     $wk_setting['openid'] = $_userInfo['uid'];
     $wk_setting['secretToken'] = PwLaiWangSerivce::getSecretToken($_userInfo['uid'], $_userInfo['password']);
     // 是否已经成功同步用户到来往
     $wk_setting['laiwangOK'] = $laiwangOK;
     //返回数据
     $_data = array('securityKey' => $securityKey, 'userinfo' => array('uid' => $_userInfo['uid'], 'username' => $_userInfo['username'], 'avatar' => Pw::getAvatar($_userInfo['uid'], 'big'), 'gender' => $_userInfo['gender']), 'laiwangSetting' => $wk_setting);
     return $_data;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:24,代码来源:NativeBaseController.php

示例14: openAccountRegisterAction

 /**
 * 开放帐号注册到本系统内
 *
 * @access public
 * @return void
 * @example
 <pre>
 os可以是android或者ios <br>
 post: access_token&platformname&native_name&username&email&sex
 </pre>
 */
 public function openAccountRegisterAction()
 {
     //        if($this->_getUserOpenAccountDs()->addUser(56,56,56)==false){
     //        if(true){
     //            echo "true";
     //            $this->downloadThirdPlatformAvatar(59,"http://q.qlogo.cn/qqapp/1104230675/A773C383D93AAF2986157BA34965A5CD/100");
     //        }else{
     //            echo "false";
     //        }
     //        exit;
     $accountData = $this->authThirdPlatform();
     //
     list($username, $email, $sex) = $this->getInput(array('username', 'email', 'sex'));
     //随机密码
     $password = substr(str_shuffle('abcdefghigklmnopqrstuvwxyz1234567890~!@#$%^&*()'), 0, 7);
     //
     Wind::import('SRC:service.user.dm.PwUserInfoDm');
     $userDm = new PwUserInfoDm();
     $userDm->setUsername($username);
     $userDm->setPassword($password);
     $userDm->setEmail($email);
     $userDm->setGender($sex);
     $userDm->setRegdate(Pw::getTime());
     $userDm->setLastvisit(Pw::getTime());
     $userDm->setRegip(Wind::getComponent('request')->getClientIp());
     //
     $registerService = new PwRegisterService();
     $registerService->setUserDm($userDm);
     /*[u_regsiter]:插件扩展*/
     $this->runHook('c_register', $registerService);
     if (($info = $registerService->register()) instanceof PwError) {
         $this->showError($info->getError());
     } else {
         // 这里注册成功,要把第三方帐号的头像下载下来并处理
         // 这里取了lastInsertId,但已经指定了主键的值,所以返回false表示成功
         if ($this->_getUserOpenAccountDs()->addUser($info['uid'], $accountData['uid'], $accountData['type']) == false) {
             $this->downloadThirdPlatformAvatar($info['uid'], $accountData['avatar']);
             $laiwangOK = PwLaiWangSerivce::registerUser($info['uid'], $info['username'], $info['password'], Pw::getAvatar($info['uid'], 'big'), $accountData['gender']);
             // 重置uid
             $this->uid = $info['uid'];
             $userdata = $this->_getUserInfo($laiwangOK);
             $this->setOutput($userdata, 'data');
             $this->showMessage('USER:register.success');
         }
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:57,代码来源:UserController.php

示例15: getLatestThreadsByFids

 public function getLatestThreadsByFids($fids, $offset, $limit)
 {
     if (!ACloudSysCoreS::isArray($fids)) {
         return $this->buildResponse(0, array());
     }
     Wind::import('SRV:forum.vo.PwThreadSo');
     $uids = $result = array();
     $threaddb = array();
     $so = new PwThreadSo();
     $so->setFid($fids)->setDisabled(0)->orderbyCreatedTime(0);
     $threaddb = $this->_getThread()->searchThread($so, $limit, $offset);
     if (!$threaddb) {
         return $this->buildResponse(THREAD_NOT_EXIST, "帖子不存在");
     }
     $forums = $this->_getForum()->fetchForum($fids, PwForum::FETCH_MAIN);
     $result = array();
     foreach ($threaddb as $key => $value) {
         if (!$value) {
             continue;
         }
         $value['forumname'] = strip_tags($forums[$value]['name']);
         $value['icon'] = Pw::getAvatar($value['created_userid']);
         $uids[$value['tid']] = $value['created_userid'];
         $result['threads'][$value['tid']] = $value;
     }
     return $this->buildResponse(0, $result);
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:27,代码来源:ACloudVerCustomizedThread.php


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