By raph on Thursday, 24 September 2015
Likes 0
Views 1.1K
Votes 0
Hi Stackideas team,

I would like easysocial to generate in addition to 32*32, 64*64 and 180*180 an avatar image of let's say 200*200 and the module user to display the 200*200 image file.

How to implement?

Many thanks in advance

Raph
You need to edit the file /modules/mod_easysocial_users/tmpl/default.php and at line 22, locate the codes below:


<img src="<?php echo $user->getAvatar();?>"<?php echo $params->get( 'popover' , true ) ? ' data-popbox="module://easysocial/profile/popbox" data-popbox-position="' . $params->get( 'popover_position' , 'top-left' ) . '" data-user-id="' . $user->id . '"' : '';?> />


Replace it with,


<img src="<?php echo $user->getAvatar(SOCIAL_AVATAR_LARGE);?>"<?php echo $params->get( 'popover' , true ) ? ' data-popbox="module://easysocial/profile/popbox" data-popbox-position="' . $params->get( 'popover_position' , 'top-left' ) . '" data-user-id="' . $user->id . '"' : '';?> />
·
Sunday, 04 October 2015 02:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Raph,

I am sorry but currently in EasySocial it is not possible to add additional sizes for the avatar photo
However, you can change the width and height on pre-defined sized. Take a look at file 'JOOMLA/administrator/components/com_easysocial/constants.php' and look for below constant variables:


define('SOCIAL_AVATAR_SMALL_WIDTH', 32);
define('SOCIAL_AVATAR_SMALL_HEIGHT', 32);
define('SOCIAL_AVATAR_MEDIUM_WIDTH', 64);
define('SOCIAL_AVATAR_MEDIUM_HEIGHT', 64);
define('SOCIAL_AVATAR_LARGE_WIDTH', 180);
define('SOCIAL_AVATAR_SQUARE_LARGE_WIDTH', 180);
define('SOCIAL_AVATAR_SQUARE_LARGE_HEIGHT', 180);


Hope this help.
Sam
·
Thursday, 24 September 2015 13:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Sam,

Thanks !

Could you tell me also how to change the size of the image avatar displayed by the module user. By default it is the medium size, how to change for large?
·
Friday, 02 October 2015 21:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Raph,

I am really sorry for the delay of this reply as it is a weekend for us here. It is possible to resize the avatars using the css but regardless, the largest width of the image source is 180 pixels and having it stretched to 200*200, it would mean that your pictures would be pixelated since you are upscaling the size from 180*180 to 200*200
·
Saturday, 03 October 2015 17:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Thanks!

Finally I just need a 135*135 size for the image so 180*180 would make it. (no pixelated because downsized) better than the actual 64*64

The image avatar displayed by the module user is by default the medium size, how to change for large ?

For the moment I have:
<a href="/profile/some-profile" class="es-avatar">
<img src="https://mysite/media/com_easysocial/avatars/users/450/64516885e0266279ee02b0d7895eb839_medium.jpg" data-popbox="module://easysocial/profile/popbox" data-popbox-position="top-left" data-user-id="450">
</a>

I would like to have the following:
<a href="/profile/some-profile" class="es-avatar">
<img src="https://mysite/media/com_easysocial/avatars/users/450/64516885e0266279ee02b0d7895eb839_large.jpg" data-popbox="module://easysocial/profile/popbox" data-popbox-position="top-left" data-user-id="450">
</a>

All the best

Raph
·
Saturday, 03 October 2015 22:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Superb !

Thanks Mark
·
Sunday, 04 October 2015 06:50
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Raph
·
Sunday, 04 October 2015 15:02
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post