Is it possible to make your avatar size larger when you post something?
Announcement
Collapse
No announcement yet.
Resizing Avatar in Postbits
Collapse
X
-
You can do this in CSS. However, you'll be resizing a smaller image so there can be some artifacting. Browsers aren't the best at resizing images.
Visit your site. Turn on Edit Site. Click Style in the Site Builder Menu. Then select the CSS Editor tab. Enter in the code below, adjust as needed.
Code:.b-userinfo .b-avatar, .b-userinfo .b-avatar img { max-height: 128px; max-width: 128px !important; width: 128px; height: 128px; }
Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 API
-
Question: I resized the avatar size in the postbit using similar code as above, I also set the max avatar size in each user group to that size (175 x 175 px) and I edited /core/includes/class_core.php to change the lines to:
define('FIXED_SIZE_AVATAR_WIDTH', 175);
define('FIXED_SIZE_AVATAR_HEIGHT', 175);
I then rebuilt all of the avatar thumbnails and everything looked great.
But when anyone uploads a new avatar, instead of resizing it to 175 x 175, the upload script resizes the avatar thumbnail to 100 x 100 and they then appear blurry. Until I rebuild the avatar thumbnails in the admincp maintenance again. Then they become sharp and are 175 x 175.
What am I missing? How do I tell the upload page to resize to 175 x 175 when uploading? Even if I upload an image that is already 175 x 175, it still gets resized to 100 x 100.
Last edited by TheologyWeb; Tue 6 Oct '20, 11:39am.
Comment
-
The thumbnail size is written in the customavatar table of the database. I don't actually know where it picks up the value though. It isn't related to anything in the AdminCP as far as I can see. Even the max height and width for Avatar size in the Usergroup permissions doesn't change it. And the default thumbnail size for image attachments is 121 X 121 (why? I don't know)...
Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 API
Comment
-
Originally posted by Wayne Luke View PostThe thumbnail size is written in the customavatar table of the database. I don't actually know where it picks up the value though. It isn't related to anything in the AdminCP as far as I can see. Even the max height and width for Avatar size in the Usergroup permissions doesn't change it. And the default thumbnail size for image attachments is 121 X 121 (why? I don't know)...
separate question, Is there a way to create a scheduled task to rebuild the Avatar Thumbnails on a regular basis? I could just run it every few days to redo any new avatars.
PS thanks for all of your help here.
Comment
-
Found the answer in another thread:
Originally posted by Slowmin View PostSorted.
Incase anyone is wanting to do this, I edited image.php in the core directory, if you find $table = 'customavatar';, then replace the $filedata_thumb to just say $filedata as I have here, it's not elegant, and I think someone can probably do this better! But it's doing what I wanted now.
Code:else { $table = 'customavatar'; if ($vbulletin->GPC['type'] == 'thumb' OR !empty($vbulletin->GPC['thumb'])) { //$filedata = 'filedata_thumb'; $filedata = 'filedata'; } }
Last edited by TheologyWeb; Mon 12 Oct '20, 5:15am.
Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment