让XiunoBBS吃上Gravatar头像
修改这个文件model/user.func.php
修改第201
行和第202
行,将:
$user['avatar_url'] = $user['avatar'] ? $conf['upload_url']."avatar/$dir/$user[uid].png?".$user['avatar'] : 'view/img/avatar.png';
$user['avatar_path'] = $user['avatar'] ? $conf['upload_path']."avatar/$dir/$user[uid].png?".$user['avatar'] : '';
修改为以下:
$user['avatar_url'] = 'https://secure.gravatar.com/avatar/'.MD5($user['email']).'?s=100&r=G&d=identicon';
$user['avatar_path'] = $user['avatar_url'] ;
如果怕改了之后会出事,可以像我一样,将原来的代码打上注释,就像下面这样
//$user['avatar_url'] = $user['avatar'] ? $conf['upload_url']."avatar/$dir/$user[uid].png?".$user['avatar'] : 'view/img/avatar.png';
$user['avatar_url'] = 'https://secure.gravatar.com/avatar/'.MD5($user['email']).'?s=100&r=G&d=identicon';
//$user['avatar_path'] = $user['avatar'] ? $conf['upload_path']."avatar/$dir/$user[uid].png?".$user['avatar'] : '';
$user['avatar_path'] = $user['avatar_url'] ;
然后通过修改模板来隐藏下头像的上传入口,禁止用户上传或者是将upload/avatar
文件夹设上“不可写”权限即可
提示:头像上传入口在view/htm/my_avatar.htm
里,但改了这里的内容只是改了用户的上传面板,上传的接口还是存在的,所以才需要禁止用户上传或者是设置不可写
修罗关了,还搞不
不耍了 害