Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Change Profile Avatar Size

7 years 11 months ago
  • Charlie's Avatar
    Topic Author
  • Charlie
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
Licenses:
JomSocial Expired

ISSUE SUMMARY:
I am using JomSocial 4.2 RC_1 and cannot change the profile avatar size, I have tried CSS and editing defines_community.php and then clearing caches, uploading new Avatars, nothing changes. Please help

STEPS TO REPLICATE:
1 Installed JomSocial 4.2 RC_1
2 Changed defines.community/php define('COMMUNITY_AVATAR_PROFILE_WIDTH, RESERVE, MINIMUM(s)
3 Edited Style.css to increase box size of jom-avatar--focus area
4
5
RESULT: Avatar remains at scaled to 100px
EXPECTED RESULT: Larger Avatar
BROWSER: Chrome, FF

7 years 11 months ago
Licenses:

Hi,

here the steps:
1. copy focus.php from /components/com_community/templates/jomsocial/layouts/profile/ to /templates/[your site frontend template]/html/com_community/layouts/profile/. create this location if not exist yet (/html/com_community/layouts/profile/)

2. edit that file (new location file), at line 103, find this code

<img src="<?php echo $user->getThumbAvatar() . '?_=' . time(); ?>" alt="<?php echo $this->escape( $user->getDisplayName() ); ?>">
with this code, the avatar size only 64 x 64. please changing it to
<img src="<?php echo $user->getAvatar() . '?_=' . time(); ?>" alt="<?php echo $this->escape( $user->getDisplayName() ); ?>">
with this code, the avatar size will be 160 x 160

and for changing the size, please put this CSS code at your site template custom CSS. every joomla site template must be can put custom CSS code. please find it at site template documentation.
.joms-avatar--focus img {
  max-width: 160px;
}

please do not edit jomsocial css (Style.css) it will disappear at upgrade process, because that file as part of jomsocial core files.

Regards

7 years 11 months ago
  • Charlie's Avatar
    Topic Author
  • Charlie
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
Licenses:
JomSocial Expired

That worked great, thanks! But I want the Avatar to be even bigger, I set the CSS to 256px, how can I get the Avatar to display that size with your code?

7 years 11 months ago
Licenses:

Hi,

after you changing COMMUNITY_AVATAR_PROFILE_WIDTH and COMMUNITY_AVATAR_PROFILE_HEIGHT

please edit /components/com_community/helpers/photos.php at line 111

$imageMaxWidth = 160;
$imageMaxHeight = 160;

but this changes will disappear at upgrade process. avatar size for web standard is 160 x 160.
256 is not common.

Regards

7 years 11 months ago
  • Charlie's Avatar
    Topic Author
  • Charlie
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
Licenses:
JomSocial Expired

Hi Albertus, I upgraded to Jomsocial 4.2 and now my profiles only show the AvatarThumb. I made the changes once again and it is still showing the cropped version in profiles, not the original. Is there a new place in 4.2 I have to make adjustments?
Quick edit*** I changed all the files the way I had them in 4.2RC, and got the display to show the right size - but when you upload a photo now and crop for the thumbnail, the Profile shows a 'cropped' version of the uploaded image. I have confirmed it is showing the Avatar image, but I think 4.2 has a bug that crops it.
I really don't want to go back to RC2, can you see if this is a bug and post the fix? Thanks!

7 years 11 months ago
  • Charlie's Avatar
    Topic Author
  • Charlie
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
Licenses:
JomSocial Expired

Hi Albertus, I think I have discovered a way to make a profile display any sized avatar you want, I followed your instructions but it led to stretched out 'cropped' images mentioned above. I did some experimenting and set the /* thumb size */ $currentWidth = and $currentHeight in helper/photos.php to my desired size of 360 by 480 and no more stretching!
If anyone else has this issue, its line 95 or so.

7 years 11 months ago
Licenses:

Hi,

Thank you for your post.
the changes for avatar size will be gone at upgrade process.

we will try to put custom size for avatar, as part of jomsocial backend configuration.

Regards

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW