Discuz!x 头像生成路径和格式记录
写插件需要用到,先记录下,用途是微信登陆后配合微信头像,生成Dz的用户头像。格式:
$uid = sprintf("%09d", $uid);
$dir1 = substr($uid, 0, 3);
$dir2 = substr($uid, 3, 2);
$dir3 = substr($uid, 5, 2);
$file1 = DISCUZ_ROOT.'uc_server/data/avatar/'.$dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).'_avatar_small.jpg';
$file2 = DISCUZ_ROOT.'uc_server/data/avatar/'.$dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).'_avatar_middle.jpg';
$file3 = DISCUZ_ROOT.'uc_server/data/avatar/'.$dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).'_avatar_big.jpg';
dmkdir(DISCUZ_ROOT.'uc_server/data/avatar/'.$dir1.'/'.$dir2.'/'.$dir3.'/', 0777);
$dir=DISCUZ_ROOT.'/uc_server/data/avatar/'.substr($uid,0,3).'/'.substr($uid,3,2).'/'.substr($uid,5,2).'/'.substr($uid,-2).'_avatar_middle.jpg';
附录
附件格式:
DISCUZ_ROOT.'data/attachment/forum/'.date('Ym',$dateline).'/'.date('d',$dateline).'/'.date('His',$dateline).strtolower(random(16)).'.拓展名';
相册格式:
DISCUZ_ROOT.'data/attachment/album/'.date('Ym',$dateline).'/'.date('d',$dateline).'/'.date('His',$dateline).strtolower(random(16)).'.拓展名';
页:
[1]