4 个回复
CMSYOU - CMS企业网站定制专家
赞同来自:
public function account_manage_avatar() {
$memberinfo = $this->memberinfo;
//初始化phpsso
$phpsso_api_url = $this->_init_phpsso();
$ps_auth_key = pc_base::load_config('system', 'phpsso_auth_key');
$auth_data = $this->client->auth_data(array('uid'=>$this->memberinfo['phpssouid'],'sys_auth_time'=>microtime(true)), '', $ps_auth_key);
$upurl = base64_encode($phpsso_api_url.'/index.php?m=phpsso&c=index&a=uploadavatar&auth_data='.$auth_data);
//获取头像数组
$avatar = $this->client->ps_getavatar($this->memberinfo['phpssouid']);
include template('member', 'account_manage_avatar');
}
public function ps_getavatar($uid) {
$dir1 = ceil($uid / 10000);
$dir2 = ceil($uid % 10000 / 1000);
$url = $this->ps_api_url.'/uploadfile/avatar/'.$dir1.'/'.$dir2.'/'.$uid.'/';
$avatar = array('180'=>$url.'180x180.jpg', '90'=>$url.'90x90.jpg', '45'=>$url.'45x45.jpg', '30'=>$url.'30x30.jpg');
return $avatar;
}
{php $dir1 = ceil($memberinfo[phpssouid] / 10000);}
{php $dir2 = ceil($memberinfo[phpssouid] % 10000 / 1000);}
{php $avatarurl = 'phpsso_server/uploadfile/avatar/'.$dir1.'/'.$dir2.'/'.$memberinfo[phpssouid].'/180x180.jpg';}
<img src="{$avatarurl}" class="img-circle">
最新活动:2016-10-14 20:44
浏览:3721 次
关注:3 人
Copyright © 2008-2024 CMSYOU - 互助问答社区 - 粤ICP备10060801号-3 RSS Feed
欢迎加入QQ群(346494585) “让我们一起来学习CMS建站吧!”
要评论问题请先登录或注册