MyBB Community Forums

Full Version: FBConnect and avatar size
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm setting up my first MyBB board. We are using FBConnect and it is working great, but I'm having trouble with the avatar size.

Is there a way to have it resize the avatar to a max resolution when users are joining using facebook? It seems it pulls their profile picture and will use it at the size given regardless of what setting are in MyBB.

I have:
Config->User Registration and Profile Options->Maximum Avatar set to 50x50 and Avatar Resizing Mode to automatic.

Config->Show Thread Options->Maximum Avatar Dimensions in Posts set to 50x50 as well. This says it will scale down avatars that are too big, but they are all showing up the original size.

If I try to change my avatar using an external link, it warns that the size is too big and references the size I have set.

It looks like the FBConnect is bypassing the checks maybe and just dumping the image into the DB? What I don't understand is what is the point of the "Maximum Avatar Dimensions in Posts" setting? It says it will scale large avatars which is exactly what is happening but it doesn't. Hopefully I'm missing some setting. Thanks.
The scale avatars setting is based on there being an avatar dimension in the database for that avatar.

Use css to scale Big Grin
Good idea, thanks. I was hoping there was just a simple setting.

For anyone with the same question (and to see if you have a better suggestion) this is what I did:
I'm using the Classic view

1) In the templates, edited the postbit_avatar to be the class postavatar, like this:
 <a href="{$post['profilelink_plain']}" ><img src="{$post['avatar']}" class="postavatar" {$avatar_width_height} /></a> 


2) In the themes I added to the showthread.css:
.postavatar {
        max-height:250px; 
        max-width:150px;
}
Seems to be working fine, need to play with the numbers but should work great.
That should do it. I would not do it very differently really.
I did it slightly different.

In the fbcore directory, edit fbconnect.php. Line 112. Find the part of "picture?type=large" and change to "picture?type=small"

This is best for a fresh server, as the line with ?type=large has already been inserted into the user db table, and would require editing to set to small.